Correcting for wildly incorrect time of .webm with FFMPEG
7,355
There is an old related bug report, marked as fixed. about this: Incorrect duration displayed in webm file. This seems to be related to the fact that a webm file doesn't contain an index of all frames, but only keyframes.
First option is to rewrap the WebM
ffmpeg -i current.webm -c copy -fflags +genpts new.webm
Related videos on Youtube
Author by
Ron
Updated on September 18, 2022Comments
-
Ron almost 2 years
I have a file that when I run ffpmeg -i on it will display a time of 351909:41:29.64.
I know I didn't record for 40 + years. Any suggestions on what would be the best way to fix this?
I appreciate any and all answers!
Regards,
-
Metabolix over 8 yearsWhat is your ffmpeg version? Have you tried
ffmpeg -i old.webm -c:a copy -c:v copy new.webm
or the like? -
Gyan over 8 yearsTo the OP, post the full output of
ffprobe
for the file. -
Ron over 8 yearsffprobe output Input #0, matroska,webm, from 'recording.webm': Duration: 351909:41:29.64, start: 0.000000, bitrate: N/A Stream #0.0(eng): Video: vp8, yuv420p, 640x360, PAR 1:1 DAR 16:9, 1k fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: title : Video Stream #0.1(eng): Audio: vorbis, 48000 Hz, stereo, s16 (default) Metadata: title : Audio
-
Ron over 8 yearsffmpeg version 0.8.13-4:0.8.13
-
Gyan over 8 yearsThat's an ancient version. Get something 2.8+ or nightly build.
-
Ron over 8 yearsUpdating. Thanks for all the help by the way!
-
-
Ron over 8 yearsI don't know if it's just an ffmpeg thing though. I see it when watching the video in the browser and VLC. I think it may actually be a file encoding issue.
-
Gyan over 8 yearsAs Metabolix said, rewrap it in a new WebM, except add
-fflags +genpts
to their command. -
Ron over 8 yearsThanks for the help! Kind of new to FFMPEG. So the command would be ffmpeg -fflags +genpts -i old.webm -c:a copy -c:v copy new.webm
-
Gyan over 8 yearsSee edited answer.
-
Ron over 8 yearsUpdated ffmpeg, ran the above command and then used ffprobe and got: Input #0, matroska,webm, from 'new.webm': Metadata: encoder : Lavf56.36.100 Duration: 351909:41:29.65, start: 0.000000, bitrate: N/A Stream #0:0(eng): Video: vp8, yuv420p, 640x360, SAR 1:1 DAR 16:9, 1k fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: title : Video Stream #0:1(eng): Audio: vorbis, 48000 Hz, stereo, fltp (default) Metadata: title : Audio
-
Ron over 8 yearsI believe my file may be corrupt as I look at it. The video seems to be only 6kb while the audio is 9000+ kb
-
Gyan over 8 yearsLooks like it. How long is the file supposed to be?
-
Ron over 8 yearsSorry for the delay in my response. It is actually supposed to be 16:54.