0

I want to re-encode a video using H264, and I want to control the number of i-frames contained in the re-encoded video. I've tried the following.

ffmpeg -i video.mp4 -y -c:v libx264 -crf 21 -sc_threshold 40 -c:a copy reencoded_video.mp4

This successfully re-encodes the video, but I can't affect the number of i-frames by adjusting the -crf and -sc_threshold values, as I have checked with ffprobe. Most of the time, the same set of i-frames are obtained regardless of the -crf and -sc_threshold values I set.

How do I control (to some extent) the number of i-frames in the re-encoded video? For example, how do I make every frame and i-frame? How do I re-encode it so that there is about 1 i-frame every 2 seconds?

EDIT

It seems that I just wasn't trying a big enough range for -sc_threshold; setting it to 9999 solved the problem. I still can't find the documentation for a valid range of -sc_threshold though, could anyone point me to an official documentation that describes its valid range?

Ray
  • 481

0 Answers0