mirror of
https://github.com/amiaopensource/ffmprovisr.git
synced 2025-10-18 11:50:06 +02:00
Compare commits
7 Commits
v2019-08-0
...
v2019-09-2
Author | SHA1 | Date | |
---|---|---|---|
|
782b1a992a | ||
|
9f6e6846e0 | ||
|
c4bd6a9191 | ||
|
8b48abf751 | ||
|
54aab85937 | ||
|
51ca7a4200 | ||
|
76c3fe1f88 |
@@ -105,7 +105,7 @@ h2 {
|
||||
margin: 6px 0px 12px 0px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
h3, h5 {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
|
14
index.html
14
index.html
@@ -72,7 +72,7 @@
|
||||
<label class="recipe" for="basic-structure">Basic structure of an FFmpeg command</label>
|
||||
<input type="checkbox" id="basic-structure">
|
||||
<div class="hiding">
|
||||
<h3>Basic structure of an FFmpeg command</h3>
|
||||
<h5>Basic structure of an FFmpeg command</h5>
|
||||
<p>At its basis, an FFmpeg command is relatively simple. After you have installed FFmpeg (see instructions <a href="https://avpres.net/FFmpeg/#ch1" target="_blank">here</a>), the program is invoked simply by typing <code>ffmpeg</code> at the command prompt.</p>
|
||||
<p>Subsequently, each instruction that you supply to FFmpeg is actually a pair: a flag, which designates the <em>type</em> of action you want to carry out; and then the specifics of that action. Flags are always prepended with a hyphen.</p>
|
||||
<p>For example, in the instruction <code>-i <em>input_file.ext</em></code>, the <code>-i</code> flag tells FFmpeg that you are supplying an input file, and <code>input_file.ext</code> states which file it is.</p>
|
||||
@@ -111,7 +111,7 @@
|
||||
<label class="recipe" for="codec-defaults">Codec defaults</label>
|
||||
<input type="checkbox" id="codec-defaults">
|
||||
<div class="hiding">
|
||||
<h3>Codec Defaults</h3>
|
||||
<h5>Codec Defaults</h5>
|
||||
<p>Unless specified, FFmpeg will automatically set codec choices and codec parameters based off of internal defaults. These defaults are applied based on the file type used in the output (for example <code>.mov</code> or <code>.wav</code>).</p>
|
||||
<p>When creating or transcoding files with FFmpeg, it is important to consider codec settings for both audio and video, as the default options may not be desirable in your particular context. The following is a brief list of codec defaults for some common file types:</p>
|
||||
<ul>
|
||||
@@ -161,7 +161,7 @@
|
||||
<label class="recipe" for="stream-mapping">Stream mapping</label>
|
||||
<input type="checkbox" id="stream-mapping">
|
||||
<div class="hiding">
|
||||
<h3>Stream mapping</h3>
|
||||
<h5>Stream mapping</h5>
|
||||
<p>Stream mapping is the practice of defining which of the streams (e.g., video or audio tracks) present in an input file will be present in the output file. FFmpeg recognizes five stream types:</p>
|
||||
<ul>
|
||||
<li><code>a</code> - audio</li>
|
||||
@@ -178,8 +178,12 @@
|
||||
<li><code>-map 0:0 -map 0:2</code> means ‘take the first and third streams from the first input file’.</li>
|
||||
<li><code>-map 0:1 -map 1:0</code> means ‘take the second stream from the first input file and the first stream from the second input file’.</li>
|
||||
</ul>
|
||||
<p>To map <em>all</em> streams in the input file to the output file, use <code>-map 0</code>. However, note that not all container formats can include all stream types: for example, .mp4 cannot contain timecode.</p>
|
||||
<p>When no mapping is specified in an ffmpeg command, the default for video files is to take just one video and one audio stream for the output: other stream types, such as timecode or subtitles, will not be copied to the output file by default. If multiple video or audio streams are present, the best quality one is automatically selected by FFmpeg.</p>
|
||||
<p>To map <em>all</em> streams in the input file to the output file, use <code>-map 0</code>. However, note that not all container formats can include all stream types: for example, .mp4 cannot contain timecode.</p>
|
||||
<h4>Mapping with a failsafe</h4>
|
||||
<p>To safely process files that may or may not contain given a type of stream, you can add a trailing <code>?</code> to your map commands: for example, <code>-map 0:a?</code> instead of <code>-map 0:a</code>.</p>
|
||||
<p>This makes the map optional: audio streams will be mapped over if they are present in the file—but if the file contains no audio streams, the transcode will precede as usual, minus the audio stream mapping. Without adding the trailing <code>?</code>, FFmpeg will exit with an error on that file.</p>
|
||||
<p>This is especially recommended when batch processing video files: it ensures that all files in your batch will be transcoded, whether or not they contain audio streams.</p>
|
||||
<p>For more information, check out the FFmpeg wiki <a href="https://trac.ffmpeg.org/wiki/Map" target="_blank">Map</a> page, and the official FFmpeg <a href="https://ffmpeg.org/ffmpeg.html#Advanced-options" target="_blank">documentation on <code>-map</code></a>.</p>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
@@ -767,7 +771,7 @@
|
||||
</dl>
|
||||
<p>It's also possible to specify the crop position by adding the x and y coordinates representing the top left of your cropped area to your crop filter, as such:</p>
|
||||
<p><code>ffmpeg -i <em>input_file</em> -vf "crop=<em>width</em>:<em>height</em>[:<em>x_position</em>:<em>y_position</em>]" <em>output_file</em></code></p>
|
||||
<h3>Examples</h3>
|
||||
<h5>Examples</h5>
|
||||
<p>The original frame, a screenshot of the SMPTE colorbars:</p>
|
||||
<img class="sample-image" src="img/crop_example_orig.png" alt="VLC screenshot of Maggie Cheung">
|
||||
<p>Result of the command <code>ffmpeg -i <em>smpte_colorsbars.mov</em> -vf "crop=500:500" <em>output_file</em></code>:</p>
|
||||
|
Reference in New Issue
Block a user