ffmpeg Duplicating Frames

6,720

Use

ffmpeg -i ~/Desktop/file.mpg -vsync 0 ~/Desktop/file.mp4

This skips duplication.

Share:
6,720

Related videos on Youtube

Henry7720
Author by

Henry7720

Updated on September 18, 2022

Comments

  • Henry7720
    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
    Henry7720 over 6 years
    This sounds like it might work, but I get innumerable errors!
  • Gyan
    Gyan over 6 years
    DTS errors? You can ignore those if the file plays correctly. Show the full log.
  • l --marc l
    l --marc l almost 5 years
    where -vsync 0 is the same as the newer value -vsync passthrough. Each frame is passed with its timestamp from the demuxer to the muxer.