
Now we add the previously created h264 raw video to an mp4 container as this is our container format of choice. For more details and options consult x264’s documentation. Depending on the use case, you might need to use totally different options.


Can be omitted if the resolution should stay the same as in the source video. Can be set to 2 to further improve quality, but takes a long time. See -keyint for more information.We achieve a constant segment length by setting minimum and maximum keyframe interval to the same value and furthermore by disabling scenecut detection with the -no-scenecut parameter.Ĭompletely disables adaptive keyframe decision. Sets the minimum interval between keyframes. Here: 4 seconds * 24 frames/seconds = 96 frames. Therefore, -keyint should match the desired segment length in seconds mulitplied with the frame rate. This setting is important as we will later split the video into segments and at the beginning of each segment should be a keyframe. Sets the maximum interval between keyframes. Rule of thumb: set this value to the double of -vbv-maxrate. Rule of thumb: set this value to the double of -bitrate. The bitrate this representation should achieve in kbps. Presets can be used to easily tell x264 if it should try to be fast to enhance compression/quality. Specifies the framerate which shall be used, here 24 frames per second.

X264 -output intermediate_2400k.264 -fps 24 -preset slow -bitrate 2400 -vbv-maxrate 4800 -vbv-bufsize 9600 -min-keyint 48 -keyint 48 -scenecut 0 -no-scenecut -pass 1 -video-filter "resize:width=1280,height=720" inputvideo.mkv (Although this is likely undesirable due to file size limitations on VFAT filesystems.) To extract the three individual stream types into one large file, you can use FFmpeg. Extract Audio Streams Extract Full Audio Streams Keep an eye on the Hz, s16/s24/s32 and kb/s, as they’re indicators of audio quality. Stream #2 is the PCM 5.1 high resolution mix. Stream #1 is the PCM two channel stereo mix. We'll skip this stream since we want audio only PCM WAV

Stream #0 on this audio only Blu-Ray is only a black screen with song titles.
