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