@@ -306,11 +306,7 @@ def __init__(self, fps=5, codec=None, bitrate=None, extra_args=None,
306
306
super ().__init__ (fps = fps , metadata = metadata )
307
307
308
308
self .frame_format = 'rgba'
309
-
310
- if extra_args is None :
311
- self .extra_args = list (mpl .rcParams [self .args_key ])
312
- else :
313
- self .extra_args = extra_args
309
+ self .extra_args = extra_args
314
310
315
311
def _adjust_frame_size (self ):
316
312
if self .codec == 'h264' :
@@ -573,15 +569,17 @@ class FFMpegBase:
573
569
@property
574
570
def output_args (self ):
575
571
args = ['-vcodec' , self .codec ]
572
+ extra_args = (self .extra_args if self .extra_args is not None
573
+ else mpl .rcParams [self .args_key ])
576
574
# For h264, the default format is yuv444p, which is not compatible
577
575
# with quicktime (and others). Specifying yuv420p fixes playback on
578
576
# iOS, as well as HTML5 video in firefox and safari (on both Win and
579
577
# OSX). Also fixes internet explorer. This is as of 2015/10/29.
580
- if self .codec == 'h264' and '-pix_fmt' not in self . extra_args :
578
+ if self .codec == 'h264' and '-pix_fmt' not in extra_args :
581
579
args .extend (['-pix_fmt' , 'yuv420p' ])
582
580
if self .bitrate > 0 :
583
581
args .extend (['-b' , '%dk' % self .bitrate ]) # %dk: bitrate in kbps.
584
- args .extend (self . extra_args )
582
+ args .extend (extra_args )
585
583
for k , v in self .metadata .items ():
586
584
args .extend (['-metadata' , '%s=%s' % (k , v )])
587
585
@@ -693,7 +691,9 @@ def delay(self):
693
691
694
692
@property
695
693
def output_args (self ):
696
- return [* self .extra_args , self .outfile ]
694
+ extra_args = (self .extra_args if self .extra_args is not None
695
+ else mpl .rcParams [self .args_key ])
696
+ return [* extra_args , self .outfile ]
697
697
698
698
@classmethod
699
699
def bin_path (cls ):
0 commit comments