MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / FFMpegWriter

Class FFMpegWriter

lib/matplotlib/animation.py:580–603  ·  view source on GitHub ↗

Pipe-based ffmpeg writer. Frames are streamed directly to ffmpeg via a pipe and written in a single pass. This effectively works as a slideshow input to ffmpeg with the fps passed as ``-framerate``, so see also `their notes on frame rates`_ for further details. .. _their note

Source from the content-addressed store, hash-verified

578# Combine FFMpeg options with pipe-based writing
579@writers.register('ffmpeg')
580class FFMpegWriter(FFMpegBase, MovieWriter):
581 """
582 Pipe-based ffmpeg writer.
583
584 Frames are streamed directly to ffmpeg via a pipe and written in a single pass.
585
586 This effectively works as a slideshow input to ffmpeg with the fps passed as
587 ``-framerate``, so see also `their notes on frame rates`_ for further details.
588
589 .. _their notes on frame rates: https://trac.ffmpeg.org/wiki/Slideshow#Framerates
590 """
591 def _args(self):
592 # Returns the command line parameters for subprocess to use
593 # ffmpeg to create a movie using a pipe.
594 args = [self.bin_path(), '-f', 'rawvideo', '-vcodec', 'rawvideo',
595 '-s', '%dx%d' % self.frame_size, '-pix_fmt', self.frame_format,
596 '-framerate', str(self.fps)]
597 # Logging is quieted because subprocess.PIPE has limited buffer size.
598 # If you have a lot of frames in your animation and set logging to
599 # DEBUG, you will have a buffer overrun.
600 if _log.getEffectiveLevel() > logging.DEBUG:
601 args += ['-loglevel', 'error']
602 args += ['-i', 'pipe:'] + self.output_args
603 return args
604
605
606# Combine FFMpeg options with temp file-based writing

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…