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
| 578 | # Combine FFMpeg options with pipe-based writing |
| 579 | @writers.register('ffmpeg') |
| 580 | class 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…