@@ -634,15 +634,23 @@ class FFMpegFileWriter(FFMpegBase, FileMovieWriter):
634
634
def _args (self ):
635
635
# Returns the command line parameters for subprocess to use
636
636
# ffmpeg to create a movie using a collection of temp images
637
- args = [self .bin_path (), '-r' , str (self .fps ),
638
- '-i' , self ._base_temp_name (),
639
- '-vframes' , str (self ._frame_counter )]
637
+ args = []
638
+ # For raw frames, we need to explicitly tell ffmpeg the metadata.
639
+ if self .frame_format in {'raw' , 'rgba' }:
640
+ args += [
641
+ '-f' , 'image2' , '-vcodec' , 'rawvideo' ,
642
+ '-video_size' , '%dx%d' % self .frame_size ,
643
+ '-pixel_format' , 'rgba' ,
644
+ '-framerate' , str (self .fps ),
645
+ ]
646
+ args += ['-r' , str (self .fps ), '-i' , self ._base_temp_name (),
647
+ '-vframes' , str (self ._frame_counter )]
640
648
# Logging is quieted because subprocess.PIPE has limited buffer size.
641
649
# If you have a lot of frames in your animation and set logging to
642
650
# DEBUG, you will have a buffer overrun.
643
651
if _log .getEffectiveLevel () > logging .DEBUG :
644
652
args += ['-loglevel' , 'error' ]
645
- return [* args , * self .output_args ]
653
+ return [self . bin_path (), * args , * self .output_args ]
646
654
647
655
648
656
# Base class of avconv information. AVConv has identical arguments to FFMpeg.
0 commit comments