Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit3bdea02

Browse files
author
Nathan Goldbaum
committed
don't attempt to use libav ffmpeg shim on ubuntu 12.04
1 parentb87772d commit3bdea02

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

‎.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ addons:
1313
packages:
1414
-inkscape
1515
-libav-tools
16-
-libavcodec-extra-53
1716
-gdb
1817
-mencoder
1918
-dvipng

‎lib/matplotlib/animation.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -400,16 +400,23 @@ def isAvailable(cls):
400400
ifnotbin_path:
401401
returnFalse
402402
try:
403-
p=subprocess.Popen(bin_path,
404-
shell=False,
405-
stdout=subprocess.PIPE,
406-
stderr=subprocess.PIPE,
407-
creationflags=subprocess_creation_flags)
408-
p.communicate()
403+
p=subprocess.Popen(
404+
bin_path,
405+
shell=False,
406+
stdout=subprocess.PIPE,
407+
stderr=subprocess.PIPE,
408+
creationflags=subprocess_creation_flags)
409+
ifnotcls._handle_subprocess(p):
410+
returnFalse
409411
returnTrue
410412
exceptOSError:
411413
returnFalse
412414

415+
@classmethod
416+
def_handle_subprocess(cls,process):
417+
process.communicate()
418+
returnTrue
419+
413420

414421
classFileMovieWriter(MovieWriter):
415422
'''`MovieWriter` for writing to individual files and stitching at the end.
@@ -584,10 +591,18 @@ def output_args(self):
584591

585592
returnargs+ ['-y',self.outfile]
586593

594+
@classmethod
595+
def_handle_subprocess(cls,process):
596+
_,err=process.communicate()
597+
# Ubuntu 12.04 ships a broken ffmpeg binary which we shouldn't use
598+
if'Libav'inerr.decode():
599+
returnFalse
600+
returnTrue
601+
587602

588603
# Combine FFMpeg options with pipe-based writing
589604
@writers.register('ffmpeg')
590-
classFFMpegWriter(MovieWriter,FFMpegBase):
605+
classFFMpegWriter(FFMpegBase,MovieWriter):
591606
'''Pipe-based ffmpeg writer.
592607
593608
Frames are streamed directly to ffmpeg via a pipe and written in a single
@@ -608,7 +623,7 @@ def _args(self):
608623

609624
# Combine FFMpeg options with temp file-based writing
610625
@writers.register('ffmpeg_file')
611-
classFFMpegFileWriter(FileMovieWriter,FFMpegBase):
626+
classFFMpegFileWriter(FFMpegBase,FileMovieWriter):
612627
'''File-based ffmpeg writer.
613628
614629
Frames are written to temporary files on disk and then stitched

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp