ffmpeg Duplicating Frames
6,720
Use
ffmpeg -i ~/Desktop/file.mpg -vsync 0 ~/Desktop/file.mp4
This skips duplication.
Related videos on Youtube
Author by
Henry7720
Updated on September 18, 2022Comments
-
Henry7720 almost 2 years
A very annoying situation...
I have an MPG2 video that is at the framerate of 29.97, yet when converting to MP4 frames are duplicated.That command (straight conversion, no options):
ffmpeg -i ~/Desktop/file.mpg ~/Desktop/file.mp4
causes duplicated frames...
While setting the framerate with:
ffmpeg -i ~/Desktop/file.mpg -framerate 29.97 ~/Desktop/file.mp4
Doesn't work either!
Leading me to try:
ffmpeg -i ~/Desktop/file.mpg -r 29.97 ~/Desktop/file.mp4
Still with duplicated frames!
Finally I tried ffmpeg's 3rd framerate option!:
ffmpeg -i ~/Desktop/file.mpg -vf fps=fps=29.97 ~/Desktop/file.mp4
Except, when it outputted, the audio/video was out of sync!
Which FPS option should I use?
-
Henry7720 over 6 yearsThis sounds like it might work, but I get innumerable errors!
-
Gyan over 6 yearsDTS errors? You can ignore those if the file plays correctly. Show the full log.
-
l --marc l almost 5 yearswhere
-vsync 0
is the same as the newer value-vsync passthrough
. Each frame is passed with its timestamp from the demuxer to the muxer.