0

I'm looking for a way to lower the framerate of an H264 mp4 video without re-encoding the video.

Example: I have a 30 FPS input file and I need it to be 5 FPS. I want to avoid re-encoding because of time constraints and I also don't want to introduce additional compression artifacts.

Is this possible?

  • When you say you want to lower the framerate do you want the video to slow down, or to keep its current length? If it's the former you could accomplish this by changing the display frmerate in the metadata, if it's the latter then I think you're asking the impossible. – stib May 18 '17 at 12:20
  • @stib I wanted to drop frames as necessary until target framerate was reached. I understand now that this is not possible because of P and B frames. – rxj May 18 '17 at 17:18
0

No. The video can be slowed down, but frames from an inter-coded codec stream (like H.264) can't be dropped without re-encoding.

Update:

The command below produces a file that plays in Potplayer and ffplay but not in VLC. It works for me on MP4s, Should work on MOVs. Doesn't work with MKV (you should be able to remux to MOV/MP4 and execute).

ffmpeg -discard nokey -i input.mp4 -c copy -vsync 0 I-only.mp4

Timestamps are retained. So each I-frame shows as a freeze frame till it's time for the next one. There may be a way to make this playable in VLC, but I'll try when I have more time.

  • Let's say that I am interested only in the I-frames. What process would you use to extract them along with their timestamps for later stitching? – rxj May 18 '17 at 17:21
  • Can extra frames be added without re-encoding? Say I want to go from 20fps to 30, just doubling frames where needed? (This question actually refers to webm, but I guess it probably applies too.) – felwithe Mar 8 at 13:16
  • 1
    @felwithe, if you wish to add or drop frames, re-encoding is needed for codecs like H264, VP8. – Gyan Mar 8 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.