Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show duration (in hours) next to the video title #259

Closed
hkirat opened this issue Mar 22, 2024 · 8 comments
Closed

Show duration (in hours) next to the video title #259

hkirat opened this issue Mar 22, 2024 · 8 comments

Comments

@hkirat
Copy link
Contributor

hkirat commented Mar 22, 2024

In the sidebar

@nimit9
Copy link
Contributor

nimit9 commented Mar 22, 2024

Will add this in #253

@nimit9
Copy link
Contributor

nimit9 commented Mar 22, 2024

Currently, there is no video duration stored in our db

The way we can do this is whenever the admin adds the video metadata (which has the video url), we can use ffmpeg to get the video duration from the url and pass it along in the metadata.

In the videometadata table, duration column is already present, which will be mapped to whatever the duration we get from ffmpeg

P.S. I'm not sure how slow will ffmpeg work for large file.

The other option is to let the admin add duration itself.

@hkirat please let me know if this the correct approach?

@nimit9
Copy link
Contributor

nimit9 commented Mar 22, 2024

Tried fluent-ffmpeg, but it requires ffmpeg to be installed on the machine. Will we be able to install it on the server? @hkirat

@hkirat
Copy link
Contributor Author

hkirat commented Mar 22, 2024

there should be duration in the db - https://github.com/code100x/cms/blob/main/prisma/schema.prisma#L104
This is in seconds

@nimit9
Copy link
Contributor

nimit9 commented Mar 22, 2024

How Is it getting added in prod db though? @hkirat
In local, we're not setting it anywhere,not in the admin panel

@nimit9
Copy link
Contributor

nimit9 commented Mar 24, 2024

@hkirat, could you please make sure if the duration is not null in the db, as it's allowed as null.
Screenshot from 2024-03-24 18-39-18

if the video duration isn't there in the db,
we would need to run a script which will add the duration to the existing VideoMetadata table, where duration is null.
Also add the code for adding the duration for the new video added.

for this, we would need to use fluent-ffmpeg library, which requires ffmpeg installed on the machine.

Please assign me the issue if this is the correct approach

@hkirat
Copy link
Contributor Author

hkirat commented Mar 24, 2024

yeah people are adding it manually

@nimit9
Copy link
Contributor

nimit9 commented Mar 24, 2024

yeah people are adding it manually

Okay, cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants