Skip to content
Snippets Groups Projects
Commit ef68b294 authored by Sybren A. Stüvel's avatar Sybren A. Stüvel
Browse files

Create Video: always pad video to even sizes

H.264 requires that the width and height of the video frame are
multiples of the chroma block size. When using the default yuv420 pixel
format this means the dimensions should be even (e.g. multiples of 2).
The video filter added in this commit ensures this by padding out the
frame with black pixels.
parent 1cfb7eb7
Branches
No related tags found
No related merge requests found
......@@ -1239,6 +1239,7 @@ class CreateVideoCommand(AbstractFFmpegCommand):
'-c:v', self.codec_video,
'-crf', str(self.constant_rate_factor),
'-g', str(self.keyframe_interval),
'-vf', 'pad=ceil(iw/2)*2:ceil(ih/2)*2',
'-y',
]
if self.max_b_frames is not None:
......
......@@ -67,6 +67,7 @@ class CreateVideoTest(AbstractCommandTest):
'-c:v', 'h264',
'-crf', '23',
'-g', '18',
'-vf', 'pad=ceil(iw/2)*2:ceil(ih/2)*2',
'-y',
'-bf', '0',
'/tmp/merged.mkv',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment