You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<h1>ffmpeg-python: Python bindings for FFmpeg<aclass="headerlink" href="#ffmpeg-python-python-bindings-for-ffmpeg" title="Permalink to this headline">¶</a></h1>
<p>Represents the outgoing edge of an upstream node; may be used to create more downstream nodes.</p>
<dlclass="method">
<dtid="ffmpeg.Stream.audio">
<emclass="property">property </em><codeclass="sig-name descname">audio</code><aclass="headerlink" href="#ffmpeg.Stream.audio" title="Permalink to this definition">¶</a></dt>
<dd><p>Select the audio-portion of a stream.</p>
<p>Some ffmpeg filters drop audio streams, and care must be taken
to preserve the audio in the final output. The <codeclass="docutils literal notranslate"><spanclass="pre">.audio</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">.video</span></code> operators can be used to reference the audio/video
portions of a stream so that they can be processed separately
and then re-combined later in the pipeline. This dilemma is
intrinsic to ffmpeg, and ffmpeg-python tries to stay out of the
way while users may refer to the official ffmpeg documentation
as to why certain filters drop audio.</p>
<p><codeclass="docutils literal notranslate"><spanclass="pre">stream.audio</span></code> is a shorthand for <codeclass="docutils literal notranslate"><spanclass="pre">stream['a']</span></code>.</p>
<pclass="rubric">Example</p>
<p>Process the audio and video portions of a stream independently:</p>
<emclass="property">property </em><codeclass="sig-name descname">video</code><aclass="headerlink" href="#ffmpeg.Stream.video" title="Permalink to this definition">¶</a></dt>
<dd><p>Select the video-portion of a stream.</p>
<p>Some ffmpeg filters drop audio streams, and care must be taken
to preserve the audio in the final output. The <codeclass="docutils literal notranslate"><spanclass="pre">.audio</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">.video</span></code> operators can be used to reference the audio/video
portions of a stream so that they can be processed separately
and then re-combined later in the pipeline. This dilemma is
intrinsic to ffmpeg, and ffmpeg-python tries to stay out of the
way while users may refer to the official ffmpeg documentation
as to why certain filters drop audio.</p>
<p><codeclass="docutils literal notranslate"><spanclass="pre">stream.video</span></code> is a shorthand for <codeclass="docutils literal notranslate"><spanclass="pre">stream['v']</span></code>.</p>
<pclass="rubric">Example</p>
<p>Process the audio and video portions of a stream independently:</p>
<codeclass="sig-name descname">view</code><spanclass="sig-paren">(</span><emclass="sig-param">detail=False</em>, <emclass="sig-param">filename=None</em>, <emclass="sig-param">pipe=False</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.Stream.view" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="function">
<dtid="ffmpeg.input">
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">input</code><spanclass="sig-paren">(</span><emclass="sig-param">filename</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.input" title="Permalink to this definition">¶</a></dt>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">merge_outputs</code><spanclass="sig-paren">(</span><emclass="sig-param">*streams</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.merge_outputs" title="Permalink to this definition">¶</a></dt>
<dd><p>Include all given outputs in one ffmpeg command line</p>
</dd></dl>
<dlclass="function">
<dtid="ffmpeg.output">
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">output</code><spanclass="sig-paren">(</span><emclass="sig-param">*streams_and_filename</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.output" title="Permalink to this definition">¶</a></dt>
etc.). Some keyword-arguments are handled specially, as shown below.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>video_bitrate</strong> – parameter for <codeclass="docutils literal notranslate"><spanclass="pre">-b:v</span></code>, e.g. <codeclass="docutils literal notranslate"><spanclass="pre">video_bitrate=1000</span></code>.</p></li>
<li><p><strong>audio_bitrate</strong> – parameter for <codeclass="docutils literal notranslate"><spanclass="pre">-b:a</span></code>, e.g. <codeclass="docutils literal notranslate"><spanclass="pre">audio_bitrate=200</span></code>.</p></li>
<li><p><strong>format</strong> – alias for <codeclass="docutils literal notranslate"><spanclass="pre">-f</span></code> parameter, e.g. <codeclass="docutils literal notranslate"><spanclass="pre">format='mp4'</span></code>
(equivalent to <codeclass="docutils literal notranslate"><spanclass="pre">f='mp4'</span></code>).</p></li>
</ul>
</dd>
</dl>
<p>If multiple streams are provided, they are mapped to the same
output.</p>
<p>To tell ffmpeg to write to stdout, use <codeclass="docutils literal notranslate"><spanclass="pre">pipe:</span></code> as the filename.</p>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">overwrite_output</code><spanclass="sig-paren">(</span><emclass="sig-param">stream</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.overwrite_output" title="Permalink to this definition">¶</a></dt>
<dd><p>Overwrite output files without asking (ffmpeg <codeclass="docutils literal notranslate"><spanclass="pre">-y</span></code> option)</p>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">probe</code><spanclass="sig-paren">(</span><emclass="sig-param">filename</em>, <emclass="sig-param">cmd='ffprobe'</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.probe" title="Permalink to this definition">¶</a></dt>
<dd><p>Run ffprobe on the specified file and return a JSON representation of the output.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal" href="#ffmpeg.Error" title="ffmpeg.Error"><strong>ffmpeg.Error</strong></a> – if ffprobe returns a non-zero exit code,
an <aclass="reference internal" href="#ffmpeg.Error" title="ffmpeg.Error"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Error</span></code></a> is returned with a generic error message.
The stderr output can be retrieved by accessing the
<codeclass="docutils literal notranslate"><spanclass="pre">stderr</span></code> property of the exception.</p>
</dd>
</dl>
</dd></dl>
<dlclass="function">
<dtid="ffmpeg.compile">
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">compile</code><spanclass="sig-paren">(</span><emclass="sig-param">stream_spec</em>, <emclass="sig-param">cmd='ffmpeg'</em>, <emclass="sig-param">overwrite_output=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.compile" title="Permalink to this definition">¶</a></dt>
<dd><p>Build command-line for invoking ffmpeg.</p>
<p>The <aclass="reference internal" href="#ffmpeg.run" title="ffmpeg.run"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">run()</span></code></a> function uses this to build the command line
arguments and should work in most cases, but calling this function
directly is useful for debugging or if you need to invoke ffmpeg
manually for whatever reason.</p>
<p>This is the same as calling <aclass="reference internal" href="#ffmpeg.get_args" title="ffmpeg.get_args"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">get_args()</span></code></a> except that it also
includes the <codeclass="docutils literal notranslate"><spanclass="pre">ffmpeg</span></code> command as the first argument.</p>
</dd></dl>
<dlclass="exception">
<dtid="ffmpeg.Error">
<emclass="property">exception </em><codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">Error</code><spanclass="sig-paren">(</span><emclass="sig-param">cmd</em>, <emclass="sig-param">stdout</em>, <emclass="sig-param">stderr</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.Error" title="Permalink to this definition">¶</a></dt>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">get_args</code><spanclass="sig-paren">(</span><emclass="sig-param">stream_spec</em>, <emclass="sig-param">overwrite_output=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.get_args" title="Permalink to this definition">¶</a></dt>
<dd><p>Build command-line arguments to be passed to ffmpeg.</p>
</dd></dl>
<dlclass="function">
<dtid="ffmpeg.run">
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">run</code><spanclass="sig-paren">(</span><emclass="sig-param">stream_spec</em>, <emclass="sig-param">cmd='ffmpeg'</em>, <emclass="sig-param">capture_stdout=False</em>, <emclass="sig-param">capture_stderr=False</em>, <emclass="sig-param">input=None</em>, <emclass="sig-param">quiet=False</em>, <emclass="sig-param">overwrite_output=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.run" title="Permalink to this definition">¶</a></dt>
<dd><p>Invoke ffmpeg for the supplied node graph.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>capture_stdout</strong> – if True, capture stdout (to be used with
<li><p><strong>capture_stderr</strong> – if True, capture stderr.</p></li>
<li><p><strong>quiet</strong> – shorthand for setting <codeclass="docutils literal notranslate"><spanclass="pre">capture_stdout</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">capture_stderr</span></code>.</p></li>
<li><p><strong>input</strong> – text to be sent to stdin (to be used with <codeclass="docutils literal notranslate"><spanclass="pre">pipe:</span></code>
ffmpeg inputs)</p></li>
<li><p><strong>**kwargs</strong> – keyword-arguments passed to <codeclass="docutils literal notranslate"><spanclass="pre">get_args()</span></code> (e.g.
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">view</code><spanclass="sig-paren">(</span><emclass="sig-param">stream_spec</em>, <emclass="sig-param">detail=False</em>, <emclass="sig-param">filename=None</em>, <emclass="sig-param">pipe=False</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.view" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="function">
<dtid="ffmpeg.colorchannelmixer">
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">colorchannelmixer</code><spanclass="sig-paren">(</span><emclass="sig-param">stream</em>, <emclass="sig-param">*args</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.colorchannelmixer" title="Permalink to this definition">¶</a></dt>
<dd><p>Adjust video input frames by re-mixing color channels.</p>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">concat</code><spanclass="sig-paren">(</span><emclass="sig-param">*streams</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.concat" title="Permalink to this definition">¶</a></dt>
<dd><p>Concatenate audio and video streams, joining them together one after the other.</p>
<p>The filter works on segments of synchronized video and audio streams. All segments must have the same number of
streams of each type, and that will also be the number of streams at output.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>unsafe</strong> – Activate unsafe mode: do not fail if segments have a different format.</p>
</dd>
</dl>
<p>Related streams do not always have exactly the same duration, for various reasons including codec frame size or
sloppy authoring. For that reason, related synchronized streams (e.g. a video and its audio track) should be
concatenated at once. The concat filter will use the duration of the longest stream in each segment (except the
last one), and if necessary pad shorter audio streams with silence.</p>
<p>For this filter to work correctly, all segments must start at timestamp 0.</p>
<p>All corresponding streams must have the same parameters in all segments; the filtering system will automatically
select a common pixel format for video streams, and a common sample format, sample rate and channel layout for
audio streams, but other settings, such as resolution, must be converted explicitly by the user.</p>
<p>Different frame rates are acceptable but will result in variable frame rate at output; be sure to configure the
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">drawtext</code><spanclass="sig-paren">(</span><emclass="sig-param">stream</em>, <emclass="sig-param">text=None</em>, <emclass="sig-param">x=0</em>, <emclass="sig-param">y=0</em>, <emclass="sig-param">escape_text=True</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.drawtext" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw a text string or text from a specified file on top of a video, using the libfreetype library.</p>
<p>To enable compilation of this filter, you need to configure FFmpeg with <codeclass="docutils literal notranslate"><spanclass="pre">--enable-libfreetype</span></code>. To enable default
font fallback and the font option you need to configure FFmpeg with <codeclass="docutils literal notranslate"><spanclass="pre">--enable-libfontconfig</span></code>. To enable the
text_shaping option, you need to configure FFmpeg with <codeclass="docutils literal notranslate"><spanclass="pre">--enable-libfribidi</span></code>.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>box</strong> – Used to draw a box around text using the background color. The value must be either 1 (enable) or 0
(disable). The default value of box is 0.</p></li>
<li><p><strong>boxborderw</strong> – Set the width of the border to be drawn around the box using boxcolor. The default value of
boxborderw is 0.</p></li>
<li><p><strong>boxcolor</strong> – The color to be used for drawing box around text. For the syntax of this option, check the “Color”
section in the ffmpeg-utils manual. The default value of boxcolor is “white”.</p></li>
<li><p><strong>line_spacing</strong> – Set the line spacing in pixels of the border to be drawn around the box using box. The default
value of line_spacing is 0.</p></li>
<li><p><strong>borderw</strong> – Set the width of the border to be drawn around the text using bordercolor. The default value of
borderw is 0.</p></li>
<li><p><strong>bordercolor</strong> – Set the color to be used for drawing border around text. For the syntax of this option, check the
“Color” section in the ffmpeg-utils manual. The default value of bordercolor is “black”.</p></li>
<li><p><strong>expansion</strong> – Select how the text is expanded. Can be either none, strftime (deprecated) or normal (default). See
the Text expansion section below for details.</p></li>
<li><p><strong>basetime</strong> – Set a start time for the count. Value is in microseconds. Only applied in the deprecated strftime
expansion mode. To emulate in normal expansion mode use the pts function, supplying the start time (in
seconds) as the second argument.</p></li>
<li><p><strong>fix_bounds</strong> – If true, check and fix text coords to avoid clipping.</p></li>
<li><p><strong>fontcolor</strong> – The color to be used for drawing fonts. For the syntax of this option, check the “Color” section in
the ffmpeg-utils manual. The default value of fontcolor is “black”.</p></li>
<li><p><strong>fontcolor_expr</strong> – String which is expanded the same way as text to obtain dynamic fontcolor value. By default
this option has empty value and is not processed. When this option is set, it overrides fontcolor option.</p></li>
<li><p><strong>font</strong> – The font family to be used for drawing text. By default Sans.</p></li>
<li><p><strong>fontfile</strong> – The font file to be used for drawing text. The path must be included. This parameter is mandatory if
the fontconfig support is disabled.</p></li>
<li><p><strong>alpha</strong> – Draw the text applying alpha blending. The value can be a number between 0.0 and 1.0. The expression
accepts the same variables x, y as well. The default value is 1. Please see fontcolor_expr.</p></li>
<li><p><strong>fontsize</strong> – The font size to be used for drawing text. The default value of fontsize is 16.</p></li>
<li><p><strong>text_shaping</strong> – If set to 1, attempt to shape the text (for example, reverse the order of right-to-left text and
join Arabic characters) before drawing it. Otherwise, just draw the text exactly as given. By default 1 (if
supported).</p></li>
<li><p><strong>ft_load_flags</strong> – <p>The flags to be used for loading the fonts. The flags map the corresponding flags supported by
libfreetype, and are a combination of the following values:</p>
<dt>The parameters for x and y are expressions containing the following constants and functions:</dt><dd><ulclass="simple">
<li><p>dar: input display aspect ratio, it is the same as <codeclass="docutils literal notranslate"><spanclass="pre">(w</span><spanclass="pre">/</span><spanclass="pre">h)</span><spanclass="pre">*</span><spanclass="pre">sar</span></code></p></li>
<li><p>hsub: horizontal chroma subsample values. For example for the pixel format “yuv422p” hsub is 2 and vsub
is 1.</p></li>
<li><p>vsub: vertical chroma subsample values. For example for the pixel format “yuv422p” hsub is 2 and vsub
is 1.</p></li>
<li><p>line_h: the height of each text line</p></li>
<li><p>lh: Alias for <codeclass="docutils literal notranslate"><spanclass="pre">line_h</span></code>.</p></li>
<li><p>main_h: the input height</p></li>
<li><p>h: Alias for <codeclass="docutils literal notranslate"><spanclass="pre">main_h</span></code>.</p></li>
<li><p>H: Alias for <codeclass="docutils literal notranslate"><spanclass="pre">main_h</span></code>.</p></li>
<li><p>main_w: the input width</p></li>
<li><p>w: Alias for <codeclass="docutils literal notranslate"><spanclass="pre">main_w</span></code>.</p></li>
<li><p>W: Alias for <codeclass="docutils literal notranslate"><spanclass="pre">main_w</span></code>.</p></li>
<li><p>ascent: the maximum distance from the baseline to the highest/upper grid coordinate used to place a glyph
outline point, for all the rendered glyphs. It is a positive value, due to the grid’s orientation with the Y
axis upwards.</p></li>
<li><p>max_glyph_a: Alias for <codeclass="docutils literal notranslate"><spanclass="pre">ascent</span></code>.</p></li>
<li><p>descent: the maximum distance from the baseline to the lowest grid coordinate used to place a glyph outline
point, for all the rendered glyphs. This is a negative value, due to the grid’s orientation, with the Y axis
upwards.</p></li>
<li><p>max_glyph_d: Alias for <codeclass="docutils literal notranslate"><spanclass="pre">descent</span></code>.</p></li>
<li><p>max_glyph_h: maximum glyph height, that is the maximum height for all the glyphs contained in the rendered
text, it is equivalent to ascent - descent.</p></li>
<li><p>max_glyph_w: maximum glyph width, that is the maximum width for all the glyphs contained in the rendered
text.</p></li>
<li><p>n: the number of input frame, starting from 0</p></li>
<li><p>rand(min, max): return a random number included between min and max</p></li>
<li><p>sar: The input sample aspect ratio.</p></li>
<li><p>t: timestamp expressed in seconds, NAN if the input timestamp is unknown</p></li>
<li><p>text_h: the height of the rendered text</p></li>
<li><p>th: Alias for <codeclass="docutils literal notranslate"><spanclass="pre">text_h</span></code>.</p></li>
<li><p>text_w: the width of the rendered text</p></li>
<li><p>tw: Alias for <codeclass="docutils literal notranslate"><spanclass="pre">text_w</span></code>.</p></li>
<li><p>x: the x offset coordinates where the text is drawn.</p></li>
<li><p>y: the y offset coordinates where the text is drawn.</p></li>
</ul>
</dd>
</dl>
<p>These parameters allow the x and y expressions to refer each other, so you can for example specify
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">filter</code><spanclass="sig-paren">(</span><emclass="sig-param">stream_spec</em>, <emclass="sig-param">filter_name</em>, <emclass="sig-param">*args</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.filter" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply custom filter.</p>
<p><codeclass="docutils literal notranslate"><spanclass="pre">filter_</span></code> is normally used by higher-level filter functions such as <codeclass="docutils literal notranslate"><spanclass="pre">hflip</span></code>, but if a filter implementation
is missing from <codeclass="docutils literal notranslate"><spanclass="pre">ffmpeg-python</span></code>, you can call <codeclass="docutils literal notranslate"><spanclass="pre">filter_</span></code> directly to have <codeclass="docutils literal notranslate"><spanclass="pre">ffmpeg-python</span></code> pass the filter name
and arguments to ffmpeg verbatim.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>stream_spec</strong> – a Stream, list of Streams, or label-to-Stream dictionary mapping</p></li>
<li><p><strong>filter_name</strong> – ffmpeg filter name, e.g. <cite>colorchannelmixer</cite></p></li>
<li><p><strong>*args</strong> – list of args to pass to ffmpeg verbatim</p></li>
<li><p><strong>**kwargs</strong> – list of keyword-args to pass to ffmpeg verbatim</p></li>
</ul>
</dd>
</dl>
<p>The function name is suffixed with <codeclass="docutils literal notranslate"><spanclass="pre">_</span></code> in order avoid confusion with the standard python <codeclass="docutils literal notranslate"><spanclass="pre">filter</span></code> function.</p>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">filter_multi_output</code><spanclass="sig-paren">(</span><emclass="sig-param">stream_spec</em>, <emclass="sig-param">filter_name</em>, <emclass="sig-param">*args</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.filter_multi_output" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply custom filter with one or more outputs.</p>
<p>This is the same as <codeclass="docutils literal notranslate"><spanclass="pre">filter</span></code> except that the filter can produce more than one output.</p>
<p>To reference an output stream, use either the <codeclass="docutils literal notranslate"><spanclass="pre">.stream</span></code> operator or bracket shorthand:</p>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">hflip</code><spanclass="sig-paren">(</span><emclass="sig-param">stream</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.hflip" title="Permalink to this definition">¶</a></dt>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">hue</code><spanclass="sig-paren">(</span><emclass="sig-param">stream</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.hue" title="Permalink to this definition">¶</a></dt>
<dd><p>Modify the hue and/or the saturation of the input.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>h</strong> – Specify the hue angle as a number of degrees. It accepts an expression, and defaults to “0”.</p></li>
<li><p><strong>s</strong> – Specify the saturation in the [-10,10] range. It accepts an expression and defaults to “1”.</p></li>
<li><p><strong>H</strong> – Specify the hue angle as a number of radians. It accepts an expression, and defaults to “0”.</p></li>
<li><p><strong>b</strong> – Specify the brightness in the [-10,10] range. It accepts an expression and defaults to “0”.</p></li>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">overlay</code><spanclass="sig-paren">(</span><emclass="sig-param">main_parent_node</em>, <emclass="sig-param">overlay_parent_node</em>, <emclass="sig-param">eof_action='repeat'</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.overlay" title="Permalink to this definition">¶</a></dt>
<dd><p>Overlay one video on top of another.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>x</strong> – Set the expression for the x coordinates of the overlaid video on the main video. Default value is 0. In
case the expression is invalid, it is set to a huge value (meaning that the overlay will not be displayed
within the output visible area).</p></li>
<li><p><strong>y</strong> – Set the expression for the y coordinates of the overlaid video on the main video. Default value is 0. In
case the expression is invalid, it is set to a huge value (meaning that the overlay will not be displayed
within the output visible area).</p></li>
<li><p><strong>eof_action</strong> – <p>The action to take when EOF is encountered on the secondary input; it accepts one of the following
values:</p>
<ul>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">repeat</span></code>: Repeat the last frame (the default).</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">endall</span></code>: End both streams.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">pass</span></code>: Pass the main input through.</p></li>
</ul>
</p></li>
<li><p><strong>eval</strong> – <p>Set when the expressions for x, and y are evaluated.
It accepts the following values:</p>
<ul>
<li><dlclass="simple">
<dt><codeclass="docutils literal notranslate"><spanclass="pre">init</span></code>: only evaluate expressions once during the filter initialization or when a command is</dt><dd><p>processed</p>
</dd>
</dl>
</li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">frame</span></code>: evaluate expressions for each incoming frame</p></li>
</ul>
<p>Default value is <codeclass="docutils literal notranslate"><spanclass="pre">frame</span></code>.</p>
</p></li>
<li><p><strong>shortest</strong> – If set to 1, force the output to terminate when the shortest input terminates. Default value is 0.</p></li>
<li><p><strong>format</strong> – <p>Set the format for the output video.
It accepts the following values:</p>
<ul>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">yuv420</span></code>: force YUV420 output</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">yuv422</span></code>: force YUV422 output</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">yuv444</span></code>: force YUV444 output</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">rgb</span></code>: force packed RGB output</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">gbrp</span></code>: force planar RGB output</p></li>
</ul>
<p>Default value is <codeclass="docutils literal notranslate"><spanclass="pre">yuv420</span></code>.</p>
</p></li>
<li><p><strong>rgb</strong> (<em>deprecated</em>) – If set to 1, force the filter to accept inputs in the RGB color space. Default value is 0.
This option is deprecated, use format instead.</p></li>
<li><p><strong>repeatlast</strong> – If set to 1, force the filter to draw the last overlay frame over the main input until the end of
the stream. A value of 0 disables this behavior. Default value is 1.</p></li>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">setpts</code><spanclass="sig-paren">(</span><emclass="sig-param">stream</em>, <emclass="sig-param">expr</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.setpts" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the PTS (presentation timestamp) of the input frames.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>expr</strong> – The expression which is evaluated for each frame to construct its timestamp.</p>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">trim</code><spanclass="sig-paren">(</span><emclass="sig-param">stream</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.trim" title="Permalink to this definition">¶</a></dt>
<dd><p>Trim the input so that the output contains one continuous subpart of the input.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>start</strong> – Specify the time of the start of the kept section, i.e. the frame with the timestamp start will be the
first frame in the output.</p></li>
<li><p><strong>end</strong> – Specify the time of the first frame that will be dropped, i.e. the frame immediately preceding the one
with the timestamp end will be the last frame in the output.</p></li>
<li><p><strong>start_pts</strong> – This is the same as start, except this option sets the start timestamp in timebase units instead of
seconds.</p></li>
<li><p><strong>end_pts</strong> – This is the same as end, except this option sets the end timestamp in timebase units instead of
seconds.</p></li>
<li><p><strong>duration</strong> – The maximum duration of the output in seconds.</p></li>
<li><p><strong>start_frame</strong> – The number of the first frame that should be passed to the output.</p></li>
<li><p><strong>end_frame</strong> – The number of the first frame that should be dropped.</p></li>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">vflip</code><spanclass="sig-paren">(</span><emclass="sig-param">stream</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.vflip" title="Permalink to this definition">¶</a></dt>
<codeclass="sig-prename descclassname">ffmpeg.</code><codeclass="sig-name descname">zoompan</code><spanclass="sig-paren">(</span><emclass="sig-param">stream</em>, <emclass="sig-param">**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#ffmpeg.zoompan" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply Zoom & Pan effect.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>zoom</strong> – Set the zoom expression. Default is 1.</p></li>
<li><p><strong>x</strong> – Set the x expression. Default is 0.</p></li>
<li><p><strong>y</strong> – Set the y expression. Default is 0.</p></li>
<li><p><strong>d</strong> – Set the duration expression in number of frames. This sets for how many number of frames effect will last
for single input image.</p></li>
<li><p><strong>s</strong> – Set the output image size, default is <codeclass="docutils literal notranslate"><spanclass="pre">hd720</span></code>.</p></li>
<li><p><strong>fps</strong> – Set the output frame rate, default is 25.</p></li>
<li><p><strong>z</strong> – Alias for <codeclass="docutils literal notranslate"><spanclass="pre">zoom</span></code>.</p></li>