Show duration (in hours) next to the video title
In the sidebar
Will add this in #253
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?
Tried fluent-ffmpeg, but it requires ffmpeg to be installed on the machine. Will we be able to install it on the server? @hkirat
there should be duration in the db - https://github.com/code100x/cms/blob/main/prisma/schema.prisma#L104 This is in seconds
How Is it getting added in prod db though? @hkirat In local, we're not setting it anywhere,not in the admin panel
@hkirat, could you please make sure if the duration is not null in the db, as it's allowed as null.
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
yeah people are adding it manually
yeah people are adding it manually
Okay, cool, thanks!