@@ -674,8 +674,10 @@ def ffmpeg(dst, frame_path, framerate=24, codec='mpeg4'):
674
674
Path to the source frames (with a frame number field like '%04d').
675
675
framerate : float
676
676
Framerate of the movie (frames per second, default 24).
677
- codec : str
678
- Codec to use (default 'mpeg4').
677
+ codec : str | None
678
+ Codec to use (default 'mpeg4'). If None, the codec argument is not
679
+ forwarded to ffmpeg, which preserves compatibility with very old
680
+ versions of ffmpeg
679
681
680
682
Notes
681
683
-----
@@ -701,7 +703,10 @@ def ffmpeg(dst, frame_path, framerate=24, codec='mpeg4'):
701
703
frame_dir , frame_fmt = os .path .split (frame_path )
702
704
703
705
# make the movie
704
- cmd = ['ffmpeg' , '-i' , frame_fmt , '-r' , str (framerate ), '-c' , codec , dst ]
706
+ if codec is None :
707
+ cmd = ['ffmpeg' , '-i' , frame_fmt , '-r' , str (framerate ), dst ]
708
+ else :
709
+ cmd = ['ffmpeg' , '-i' , frame_fmt , '-r' , str (framerate ), '-c' , codec , dst ]
705
710
logger .info ("Running FFmpeg with command: %s" , ' ' .join (cmd ))
706
711
sp = subprocess .Popen (cmd , cwd = frame_dir , stdout = subprocess .PIPE ,
707
712
stderr = subprocess .PIPE )
0 commit comments