Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 102fac3

Browse filesBrowse files
committed
Fix video codecs for some formats with ffmpeg
ffmpeg seems to pick the best encoder based on the file extension for these, and using the default of `h264` just fails.
1 parent e8654e1 commit 102fac3
Copy full SHA for 102fac3

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed

‎lib/matplotlib/animation.py

Copy file name to clipboardExpand all lines: lib/matplotlib/animation.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,9 @@ class FFMpegBase:
506506
@property
507507
def output_args(self):
508508
args = []
509-
if Path(self.outfile).suffix == '.gif':
510-
self.codec = 'gif'
509+
suffix = Path(self.outfile).suffix
510+
if suffix in {'.apng', '.avif', '.gif', '.webm', '.webp'}:
511+
self.codec = suffix[1:]
511512
else:
512513
args.extend(['-vcodec', self.codec])
513514
extra_args = (self.extra_args if self.extra_args is not None

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.