fluent-ffmpeg
Version:
A fluent API to FFMPEG (http://www.ffmpeg.org)
4,242 lines (1,112 loc) • 200 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: FfmpegCommand</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: FfmpegCommand</h1>
<section>
<header>
<h2>
FfmpegCommand
</h2>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name" id="FfmpegCommand"><span class="type-signature"></span>new FfmpegCommand<span class="signature">(<span class="optional">input</span>, <span class="optional">options</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Create an ffmpeg command</p>
<p>Can be called with or without the 'new' operator, and the 'input' parameter
may be specified as 'options.source' instead (or passed later with the
addInput method).</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>input</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">ReadableStream</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>input file path or readable stream</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>command options</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>logger</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
<no logging>
</td>
<td class="description last"><p>logger object with 'error', 'warning', 'info' and 'debug' methods</p></td>
</tr>
<tr>
<td class="name"><code>niceness</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
0
</td>
<td class="description last"><p>ffmpeg process niceness, ignored on Windows</p></td>
</tr>
<tr>
<td class="name"><code>priority</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
0
</td>
<td class="description last"><p>alias for <code>niceness</code></p></td>
</tr>
<tr>
<td class="name"><code>presets</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
"fluent-ffmpeg/lib/presets"
</td>
<td class="description last"><p>directory to load presets from</p></td>
</tr>
<tr>
<td class="name"><code>preset</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
"fluent-ffmpeg/lib/presets"
</td>
<td class="description last"><p>alias for <code>presets</code></p></td>
</tr>
<tr>
<td class="name"><code>stdoutLines</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
100
</td>
<td class="description last"><p>maximum lines of ffmpeg output to keep in memory, use 0 for unlimited</p></td>
</tr>
<tr>
<td class="name"><code>timeout</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
<no timeout>
</td>
<td class="description last"><p>ffmpeg processing timeout in seconds</p></td>
</tr>
<tr>
<td class="name"><code>source</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">ReadableStream</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
<no input>
</td>
<td class="description last"><p>alias for the <code>input</code> parameter</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluent-ffmpeg.js.html">fluent-ffmpeg.js</a>, <a href="fluent-ffmpeg.js.html#line31">line 31</a>
</li></ul></dd>
</dl>
</dd>
</div>
<h3 class="subsection-title"><a name="audio-methods"></a>Audio methods</h3>
<dl>
<dt>
<h4 class="name" id="audioBitrate"><span class="type-signature"></span>audioBitrate<span class="signature">(bitrate)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Specify audio bitrate</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>bitrate</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Number</span>
</td>
<td class="description last"><p>audio bitrate in kbps (with an optional 'k' suffix)</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="options_audio.js.html">options/audio.js</a>, <a href="options_audio.js.html#line48">line 48</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>FfmpegCommand</p>
</div>
<h5>Alias:</h5>
withAudioBitrate
</dd>
<dt>
<h4 class="name" id="audioChannels"><span class="type-signature"></span>audioChannels<span class="signature">(channels)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Specify audio channel count</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>channels</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>channel count</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="options_audio.js.html">options/audio.js</a>, <a href="options_audio.js.html#line65">line 65</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>FfmpegCommand</p>
</div>
<h5>Alias:</h5>
withAudioChannels
</dd>
<dt>
<h4 class="name" id="audioCodec"><span class="type-signature"></span>audioCodec<span class="signature">(codec)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Specify audio codec</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>codec</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>audio codec name</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="options_audio.js.html">options/audio.js</a>, <a href="options_audio.js.html#line30">line 30</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>FfmpegCommand</p>
</div>
<h5>Alias:</h5>
withAudioCodec
</dd>
<dt>
<h4 class="name" id="audioFilter"><span class="type-signature"></span>audioFilter<span class="signature">(filters)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#audioFilters">FfmpegCommand#audioFilters</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="audioFilters"><span class="type-signature"></span>audioFilters<span class="signature">(filters)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Specify custom audio filter(s)</p>
<p>Can be called both with one or many filters, or a filter array.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>filters</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Array.<String></span>
|
<span class="param-type">Array.<Object></span>
</td>
<td class="description last"><p>audio filter strings, string array or
filter specification array, each with the following properties:</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>filter</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>filter name</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Array.<String></span>
|
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>filter option string, array, or object</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="options_audio.js.html">options/audio.js</a>, <a href="options_audio.js.html#line116">line 116</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>FfmpegCommand</p>
</div>
<h5>Examples:</h5>
<pre class="prettyprint"><code>command.audioFilters('filter1');</code></pre>
<pre class="prettyprint"><code>command.audioFilters('filter1', 'filter2=param1=value1:param2=value2');</code></pre>
<pre class="prettyprint"><code>command.audioFilters(['filter1', 'filter2']);</code></pre>
<pre class="prettyprint"><code>command.audioFilters([
{
filter: 'filter1'
},
{
filter: 'filter2',
options: 'param=value:param=value'
}
]);</code></pre>
<pre class="prettyprint"><code>command.audioFilters(
{
filter: 'filter1',
options: ['value1', 'value2']
},
{
filter: 'filter2',
options: { param1: 'value1', param2: 'value2' }
}
);</code></pre>
<h5>Aliases:</h5>
<ul>
<li>withAudioFilter</li>
<li>withAudioFilters</li>
<li>audioFilter</li>
</ul>
</dd>
<dt>
<h4 class="name" id="audioFrequency"><span class="type-signature"></span>audioFrequency<span class="signature">(freq)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Specify audio frequency</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>freq</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>audio frequency in Hz</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="options_audio.js.html">options/audio.js</a>, <a href="options_audio.js.html#line82">line 82</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>FfmpegCommand</p>
</div>
<h5>Alias:</h5>
withAudioFrequency
</dd>
<dt>
<h4 class="name" id="audioQuality"><span class="type-signature"></span>audioQuality<span class="signature">(quality)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Specify audio quality</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>quality</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>audio quality factor</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="options_audio.js.html">options/audio.js</a>, <a href="options_audio.js.html#line99">line 99</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>FfmpegCommand</p>
</div>
<h5>Alias:</h5>
withAudioQuality
</dd>
<dt>
<h4 class="name" id="noAudio"><span class="type-signature"></span>noAudio<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Disable audio in the output</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="options_audio.js.html">options/audio.js</a>, <a href="options_audio.js.html#line12">line 12</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>FfmpegCommand</p>
</div>
<h5>Alias:</h5>
withNoAudio
</dd>
<dt>
<h4 class="name" id="withAudioBitrate"><span class="type-signature"></span>withAudioBitrate<span class="signature">(bitrate)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#audioBitrate">FfmpegCommand#audioBitrate</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="withAudioChannels"><span class="type-signature"></span>withAudioChannels<span class="signature">(channels)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#audioChannels">FfmpegCommand#audioChannels</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="withAudioCodec"><span class="type-signature"></span>withAudioCodec<span class="signature">(codec)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#audioCodec">FfmpegCommand#audioCodec</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="withAudioFilter"><span class="type-signature"></span>withAudioFilter<span class="signature">(filters)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#audioFilters">FfmpegCommand#audioFilters</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="withAudioFilters"><span class="type-signature"></span>withAudioFilters<span class="signature">(filters)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#audioFilters">FfmpegCommand#audioFilters</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="withAudioFrequency"><span class="type-signature"></span>withAudioFrequency<span class="signature">(freq)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#audioFrequency">FfmpegCommand#audioFrequency</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="withAudioQuality"><span class="type-signature"></span>withAudioQuality<span class="signature">(quality)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#audioQuality">FfmpegCommand#audioQuality</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="withNoAudio"><span class="type-signature"></span>withNoAudio<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#noAudio">FfmpegCommand#noAudio</a>
</div>
<dl class="details">
</dl>
</dd>
</dl>
<h3 class="subsection-title"><a name="capabilities-methods"></a>Capabilities methods</h3>
<dl>
<dt>
<h4 class="name" id="availableCodecs"><span class="type-signature"></span>availableCodecs<span class="signature">(callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Query ffmpeg for available codecs</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="FfmpegCommand.html#~codecCallback">FfmpegCommand~codecCallback</a></span>
</td>
<td class="description last"><p>callback function</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="capabilities.js.html">capabilities.js</a>, <a href="capabilities.js.html#line343">line 343</a>
</li></ul></dd>
</dl>
<h5>Alias:</h5>
getAvailableCodecs
</dd>
<dt>
<h4 class="name" id="availableEncoders"><span class="type-signature"></span>availableEncoders<span class="signature">(callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Query ffmpeg for available encoders</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="FfmpegCommand.html#~encodersCallback">FfmpegCommand~encodersCallback</a></span>
</td>
<td class="description last"><p>callback function</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="capabilities.js.html">capabilities.js</a>, <a href="capabilities.js.html#line445">line 445</a>
</li></ul></dd>
</dl>
<h5>Alias:</h5>
getAvailableEncoders
</dd>
<dt>
<h4 class="name" id="availableFilters"><span class="type-signature"></span>availableFilters<span class="signature">(callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Query ffmpeg for available filters</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="FfmpegCommand.html#~filterCallback">FfmpegCommand~filterCallback</a></span>
</td>
<td class="description last"><p>callback function</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="capabilities.js.html">capabilities.js</a>, <a href="capabilities.js.html#line287">line 287</a>
</li></ul></dd>
</dl>
<h5>Alias:</h5>
getAvailableFilters
</dd>
<dt>
<h4 class="name" id="availableFormats"><span class="type-signature"></span>availableFormats<span class="signature">(callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Query ffmpeg for available formats</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="FfmpegCommand.html#~formatCallback">FfmpegCommand~formatCallback</a></span>
</td>
<td class="description last"><p>callback function</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="capabilities.js.html">capabilities.js</a>, <a href="capabilities.js.html#line501">line 501</a>
</li></ul></dd>
</dl>
<h5>Alias:</h5>
getAvailableFormats
</dd>
<dt>
<h4 class="name" id="getAvailableCodecs"><span class="type-signature"></span>getAvailableCodecs<span class="signature">(callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#availableCodecs">FfmpegCommand#availableCodecs</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="getAvailableEncoders"><span class="type-signature"></span>getAvailableEncoders<span class="signature">(callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#availableEncoders">FfmpegCommand#availableEncoders</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="getAvailableFilters"><span class="type-signature"></span>getAvailableFilters<span class="signature">(callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#availableFilters">FfmpegCommand#availableFilters</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="getAvailableFormats"><span class="type-signature"></span>getAvailableFormats<span class="signature">(callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#availableFormats">FfmpegCommand#availableFormats</a>
</div>
<dl class="details">
</dl>
</dd>
</dl>
<h3 class="subsection-title"><a name="custom-options-methods"></a>Custom options methods</h3>
<dl>
<dt>
<h4 class="name" id="addInputOption"><span class="type-signature"></span>addInputOption<span class="signature">(options)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#inputOptions">FfmpegCommand#inputOptions</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="addInputOptions"><span class="type-signature"></span>addInputOptions<span class="signature">(options)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#inputOptions">FfmpegCommand#inputOptions</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="addOption"><span class="type-signature"></span>addOption<span class="signature">(options)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#outputOptions">FfmpegCommand#outputOptions</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="addOptions"><span class="type-signature"></span>addOptions<span class="signature">(options)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#outputOptions">FfmpegCommand#outputOptions</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="addOutputOption"><span class="type-signature"></span>addOutputOption<span class="signature">(options)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#outputOptions">FfmpegCommand#outputOptions</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="addOutputOptions"><span class="type-signature"></span>addOutputOptions<span class="signature">(options)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#outputOptions">FfmpegCommand#outputOptions</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="complexFilter"><span class="type-signature"></span>complexFilter<span class="signature">(spec, <span class="optional">map</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Specify a complex filtergraph</p>
<p>Calling this method will override any previously set filtergraph, but you can set
as many filters as needed in one call.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>spec</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Array</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>filtergraph string or array of filter specification
objects, each having the following properties:</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>filter</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>filter name</p></td>
</tr>
<tr>
<td class="name"><code>inputs</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Array</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>(array of) input stream specifier(s) for the filter,
defaults to ffmpeg automatically choosing the first unused matching streams</p></td>
</tr>
<tr>
<td class="name"><code>outputs</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Array</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>(array of) output stream specifier(s) for the filter,
defaults to ffmpeg automatically assigning the output to the output file</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
|
<span class="param-type">String</span>
|
<span class="param-type">Array</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>filter options, can be omitted to not set any options</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>map</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>(array of) stream specifier(s) from the graph to include in
ffmpeg output, defaults to ffmpeg automatically choosing the first matching streams.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="options_custom.js.html">options/custom.js</a>, <a href="options_custom.js.html#line127">line 127</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>FfmpegCommand</p>
</div>
<h5>Examples:</h5>
<p class="code-caption">Overlay an image over a video (using a filtergraph string)</p>
<pre class="prettyprint"><code> ffmpeg()
.input('video.avi')
.input('image.png')
.complexFilter('[0:v][1:v]overlay[out]', ['out']);</code></pre>
<p class="code-caption">Overlay an image over a video (using a filter array)</p>
<pre class="prettyprint"><code> ffmpeg()
.input('video.avi')
.input('image.png')
.complexFilter([{
filter: 'overlay',
inputs: ['0:v', '1:v'],
outputs: ['out']
}], ['out']);</code></pre>
<p class="code-caption">Split video into RGB channels and output a 3x1 video with channels side to side</p>
<pre class="prettyprint"><code> ffmpeg()
.input('video.avi')
.complexFilter([
// Duplicate video stream 3 times into streams a, b, and c
{ filter: 'split', options: '3', outputs: ['a', 'b', 'c'] },
// Create stream 'red' by cancelling green and blue channels from stream 'a'
{ filter: 'lutrgb', options: { g: 0, b: 0 }, inputs: 'a', outputs: 'red' },
// Create stream 'green' by cancelling red and blue channels from stream 'b'
{ filter: 'lutrgb', options: { r: 0, b: 0 }, inputs: 'b', outputs: 'green' },
// Create stream 'blue' by cancelling red and green channels from stream 'c'
{ filter: 'lutrgb', options: { r: 0, g: 0 }, inputs: 'c', outputs: 'blue' },
// Pad stream 'red' to 3x width, keeping the video on the left, and name output 'padded'
{ filter: 'pad', options: { w: 'iw*3', h: 'ih' }, inputs: 'red', outputs: 'padded' },
// Overlay 'green' onto 'padded', moving it to the center, and name output 'redgreen'
{ filter: 'overlay', options: { x: 'w', y: 0 }, inputs: ['padded', 'green'], outputs: 'redgreen'},
// Overlay 'blue' onto 'redgreen', moving it to the right
{ filter: 'overlay', options: { x: '2*w', y: 0 }, inputs: ['redgreen', 'blue']},
]);</code></pre>
<h5>Alias:</h5>
filterGraph
</dd>
<dt>
<h4 class="name" id="filterGraph"><span class="type-signature"></span>filterGraph<span class="signature">(spec, <span class="optional">map</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#complexFilter">FfmpegCommand#complexFilter</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="inputOption"><span class="type-signature"></span>inputOption<span class="signature">(options)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#inputOptions">FfmpegCommand#inputOptions</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="inputOptions"><span class="type-signature"></span>inputOptions<span class="signature">(options)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add custom input option(s)</p>
<p>When passing a single string or an array, each string containing two
words is split (eg. inputOptions('-option value') is supported) for
compatibility reasons. This is not the case when passing more than
one argument.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<repeatable><br>
</td>
<td class="description last"><p>option string(s) or string array</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="options_custom.js.html">options/custom.js</a>, <a href="options_custom.js.html#line12">line 12</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>FfmpegCommand</p>
</div>
<h5>Examples:</h5>
<pre class="prettyprint"><code>command.inputOptions('option1');</code></pre>
<pre class="prettyprint"><code>command.inputOptions('option1', 'option2');</code></pre>
<pre class="prettyprint"><code>command.inputOptions(['option1', 'option2']);</code></pre>
<h5>Aliases:</h5>
<ul>
<li>addInputOption</li>
<li>addInputOptions</li>
<li>withInputOption</li>
<li>withInputOptions</li>
<li>inputOption</li>
</ul>
</dd>
<dt>
<h4 class="name" id="outputOption"><span class="type-signature"></span>outputOption<span class="signature">(options)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Alias for <a href="#outputOptions">FfmpegCommand#outputOptions</a>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="outputOptions"><span class="type-signature"></span>outputOptions<span class="signature">(options)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add custom output option(s)</p>
</div>
<h5>Par