@@ -307,11 +307,7 @@ def __init__(self, fps=5, codec=None, bitrate=None, extra_args=None,
307
307
super ().__init__ (fps = fps , metadata = metadata )
308
308
309
309
self .frame_format = 'rgba'
310
-
311
- if extra_args is None :
312
- self .extra_args = list (mpl .rcParams [self .args_key ])
313
- else :
314
- self .extra_args = extra_args
310
+ self .extra_args = extra_args
315
311
316
312
def _adjust_frame_size (self ):
317
313
if self .codec == 'h264' :
@@ -583,15 +579,17 @@ class FFMpegBase:
583
579
@property
584
580
def output_args (self ):
585
581
args = ['-vcodec' , self .codec ]
582
+ extra_args = (self .extra_args if self .extra_args is not None
583
+ else mpl .rcParams [self .args_key ])
586
584
# For h264, the default format is yuv444p, which is not compatible
587
585
# with quicktime (and others). Specifying yuv420p fixes playback on
588
586
# iOS, as well as HTML5 video in firefox and safari (on both Win and
589
587
# OSX). Also fixes internet explorer. This is as of 2015/10/29.
590
- if self .codec == 'h264' and '-pix_fmt' not in self . extra_args :
588
+ if self .codec == 'h264' and '-pix_fmt' not in extra_args :
591
589
args .extend (['-pix_fmt' , 'yuv420p' ])
592
590
if self .bitrate > 0 :
593
591
args .extend (['-b' , '%dk' % self .bitrate ]) # %dk: bitrate in kbps.
594
- args .extend (self . extra_args )
592
+ args .extend (extra_args )
595
593
for k , v in self .metadata .items ():
596
594
args .extend (['-metadata' , '%s=%s' % (k , v )])
597
595
@@ -707,7 +705,9 @@ def delay(self):
707
705
708
706
@property
709
707
def output_args (self ):
710
- return [* self .extra_args , self .outfile ]
708
+ extra_args = (self .extra_args if self .extra_args is not None
709
+ else mpl .rcParams [self .args_key ])
710
+ return [* extra_args , self .outfile ]
711
711
712
712
@classmethod
713
713
def bin_path (cls ):
0 commit comments