开发者

aggressive h.264 compression settings specifically for very long scenes with very little scene changes

开发者 https://www.devze.com 2023-01-30 07:04 出处:网络
Assuming I have a video stream that has very very few scene changes for very long periods of time (minutes to hours), and I am using something like FFmpeg to transcode the raw video to h.2开发者_开发知

Assuming I have a video stream that has very very few scene changes for very long periods of time (minutes to hours), and I am using something like FFmpeg to transcode the raw video to h.2开发者_开发知识库64, what settings can I play with to get to take advantage of the mega redundancy?

Is it as simple as setting the setting the minimum key frame interval to the max (whatever that is)?

Is there room in the h.264 spec to enhance FFmpeg to take further advantage of very long periods of time with no scene changes?


Firstly, note that FFmpeg does not itself encode the h264 but rather x264 does.

Yes, defining an unusually long keyframe should dramatically reduce the size of videos with long periods of little or no motion. Why? Because a "keyframe" is a frame with all the video data--a snapshot, if you will. All the other frames will be differentials from the key frame. One caveat to doing this is that if there is any corruption to an intermediate frame then the video will be corrupted until the next keyframe appears.

To explicitly set the keyframe interval when encoding with FFmpeg, use the -g switch. If your video is 25 frames per second, and you want the keyframe to show up once per minute of video, add -g 1500 to your FFmpeg command line. (25 f/s x 60 s = 1500 f)

There are other interesting aspects that you can control regarding keyframes that may be of interest to you, many of which are documented here: x264 ffmpeg mapping and options guide

0

精彩评论

暂无评论...
验证码 换一张
取 消