diff --git a/flamenco_worker/commands.py b/flamenco_worker/commands.py
index 4e05797f61f0c74e35c565124b10a23f93b9de0b..e859e383668818b05eb5d68c21cf7fe14f3ab147 100644
--- a/flamenco_worker/commands.py
+++ b/flamenco_worker/commands.py
@@ -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:
diff --git a/tests/test_commands_create_video.py b/tests/test_commands_create_video.py
index 8668c8abcca4d66612e3faeb1346bb123c0ae448..f5c02e1976c727eff60cbc215c25c8ec9b0c30a9 100644
--- a/tests/test_commands_create_video.py
+++ b/tests/test_commands_create_video.py
@@ -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',