Compare commits

...

43 Commits

Author SHA1 Message Date
Reto Kromer
bd0ac73d78 uniform typography 2017-03-07 15:54:07 +01:00
Ashley
7e7da29093 Merge pull request #162 from amiaopensource/unify
typography
2017-03-07 09:31:17 -05:00
Reto Kromer
47acc400ce Update index.html 2017-03-07 12:49:09 +01:00
Reto Kromer
c117e18c0c Update index.html 2017-03-07 12:46:39 +01:00
Reto Kromer
0921bd68d5 Update index.html 2017-03-07 12:45:51 +01:00
Reto Kromer
d0e13f3eb6 resolve conflict 2017-03-07 12:42:36 +01:00
Reto Kromer
82a1cfeb8b Merge pull request #163 from kieranjol/patch-1
colorspace - typo
2017-03-07 10:45:12 +01:00
Kieran O'Leary
472fcfe833 colorspace - typo 2017-03-07 08:43:11 +00:00
Reto Kromer
0907590913 typography
- modify `'` --> `’` in text
- modify `" … "` --> `“ … ”` in text
- modify `http` --> `https` when possible
- unify newline after `<br>`
- add note `-vf is an alias of -filter:v` in the ffmpeg commands
2017-03-06 15:32:26 +01:00
Ashley
0ed5cfff65 Merge pull request #161 from amiaopensource/css
one `.btn`
2017-03-05 12:41:37 -05:00
Reto Kromer
e3deb3af4e add ;
for coherence
2017-03-05 06:49:49 +01:00
Reto Kromer
5869850d4b one .btn
- group into a single `.btn`
- add spaces for readability
2017-03-05 06:43:51 +01:00
Reto Kromer
a5a49e1f28 Merge pull request #160 from kfrn/gh-pages
Inverse telecine command
2017-03-04 20:40:37 +01:00
kfrn
cdd65fd765 Add example images; media queries 2017-03-05 08:34:16 +13:00
kfrn
c85d6c5874 Add inverse telecine command 2017-03-04 23:25:12 +13:00
Reto Kromer
63879e0e51 Merge pull request #159 from amiaopensource/ab/audio-testfile
adds audio testfile (sine wave)
2017-03-02 16:44:46 +01:00
Ashley
d02633b612 Lowercases sine wave (except when at start of sentence) 2017-03-02 10:43:53 -05:00
Reto Kromer
0d92454148 Merge pull request #158 from amiaopensource/ab/aac-mp4
adds wav-to-aac/mp4
2017-03-02 14:43:18 +01:00
Ashley Blewer
8ebf23f172 removes typos in sine wave 2017-03-02 08:38:24 -05:00
Ashley Blewer
43f228c930 adds unit for both 44100 and 44.1 2017-03-02 08:36:06 -05:00
Ashley Blewer
22958ed956 adds audio testfile (sine wave) 2017-03-01 22:21:50 -05:00
Ashley Blewer
16a4d3241e adds wav-to-aac/mp4 2017-03-01 20:56:07 -05:00
Reto Kromer
b85ab4d96e Merge pull request #157 from kfrn/gh-pages
Fix links
2017-02-28 17:26:24 +01:00
kfrn
6e861fbfb4 Actually fix links 2017-03-01 05:23:15 +13:00
kfrn
6dd751a122 Fix links 2017-03-01 05:15:27 +13:00
Reto Kromer
5ba4541ec1 fix link
my wrong, sorry
2017-02-28 16:52:40 +01:00
Reto Kromer
15bf0ba8df Merge pull request #155 from kfrn/gh-pages
Update deinterlace command and add convert colourspace script
2017-02-28 16:44:05 +01:00
kfrn
e020545022 Tidy up: links, spacing, <strong> -> <b>, <em> -> <i> 2017-03-01 04:39:08 +13:00
kfrn
df7eb5932f Update deinterlace command: alt yadif mode, list other deinterlacers 2017-03-01 03:58:29 +13:00
kfrn
6f07e80169 Add section on colourspace metadata 2017-03-01 03:40:16 +13:00
kfrn
33716ae540 Add convert colourspace script 2017-03-01 02:43:03 +13:00
Reto Kromer
2d8cc9638d Merge pull request #154 from amiaopensource/ab/code-cleanup
cleans up sidebar and adds link to license and cable bible
2017-02-28 07:24:00 +01:00
Ashley Blewer
4dba8880ea cleans up sidebar and adds link to license and cable bible 2017-02-27 21:06:58 -05:00
Ashley
ec2293f691 Merge pull request #153 from amiaopensource/not_YUV
modify YUV > Y'CbCr
2017-02-26 16:20:05 -05:00
Reto Kromer
bcca8d0fee modify YUV > Y'CbCr
Thanks for the hint, @krfn!
2017-02-26 22:09:14 +01:00
Reto Kromer
a3281a1e08 Merge pull request #152 from kfrn/gh-pages
Add example images for deinterlace recipe
2017-02-26 21:56:12 +01:00
kfrn
09185ca7bc Add example images for deinterlace recipe 2017-02-27 09:52:56 +13:00
Reto Kromer
0bc9d88837 Merge pull request #151 from kfrn/gh-pages
Add deinterlace recipe
2017-02-26 21:33:54 +01:00
kfrn
96bb20cf52 Add deinterlace recipe 2017-02-27 09:19:37 +13:00
Ashley
7e30039d63 Merge pull request #149 from kfrn/gh-pages
Update broken link
2017-02-25 18:38:37 -05:00
kfrn
b63d5b8f8a Update broken link 2017-02-26 12:14:36 +13:00
Ashley
58cdf9fb97 Merge pull request #148 from amiaopensource/hover-over
hover-over descriptions
2017-02-21 09:14:45 -05:00
Reto Kromer
0994d1a1b6 hover-over descriptions
- unify
- correct some typos
2017-02-21 13:58:20 +01:00
7 changed files with 272 additions and 66 deletions

View File

@@ -1,4 +1,4 @@
h1,h2,h3,h4,h5,h6 {
h1, h2, h3, h4, h5, h6 {
font-family: 'Montserrat', sans-serif;
}
@@ -11,13 +11,14 @@ dd {
}
dt {
font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
width: 100%;
}
.sample-image {
@@ -37,9 +38,6 @@ div {
.btn {
margin: 8px;
}
.btn {
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
@@ -53,6 +51,7 @@ div {
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.btn:before {
content: "💫";
position: absolute;
@@ -67,6 +66,7 @@ div {
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.btn:hover:before, .btn:focus:before, .btn:active:before {
-webkit-transform: scale(1.3) translateZ(0);
transform: scale(1.3) translateZ(0);
@@ -78,5 +78,25 @@ div {
font-size: 90%;
color: #c7254e;
background-color: #f9f2f4;
border-radius: 4px
border-radius: 4px;
}
.beware {
font-size: 150%;
}
.footnote {
font-size: 90%;
}
@media only screen and (min-width: 576px) {
img {
max-width: 60%;
}
}
@media only screen and (min-width: 992px) {
img {
width: 100%;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
img/deinterlaced_video.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

BIN
img/interlaced_video.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 KiB

BIN
img/ivtc_originalvideo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
img/ivtc_result.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@@ -3,12 +3,9 @@
<head>
<title>ffmprovisr</title>
<meta charset="utf-8">
<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Merriweather:400,700' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/css?family=Montserrat|Merriweather" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/css.css">
<script src="js/jquery.min.js"></script>
<script src="js/js.js"></script>
<script src="js/bootstrap.min.js"></script>
@@ -28,12 +25,17 @@
<h5>Making FFmpeg Easier</h5>
<p>FFmpeg is a powerful tool for manipulating audiovisual files. Unfortunately, it also has a steep learning curve, especially for users unfamiliar with a command line interface. This app helps users through the command generation process so that more people can reap the benefits of FFmpeg.</p>
<p>Each button displays helpful information about how to perform a wide variety of tasks using FFmpeg. To use this site, click on the task you would like to perform. A new window will open up with a sample command and a description of how that command works. You can copy this command and understand how the command works with a breakdown of each of the flags.</p>
<h5>Tutorials</h5>
<p>For FFmpeg basics, check out the programs <a href="https://www.ffmpeg.org/" target="_blank">official website</a>.</p>
<p>For instructions on how to install FFmpeg on Mac, Linux, and Windows, refer to Reto Kromers <a href="https://avpres.net/FFmpeg/#ch1">installation instructions</a>.</p>
<p>For instructions on how to install FFmpeg on Mac, Linux, and Windows, refer to Reto Kromers <a href="https://avpres.net/FFmpeg/#ch1" target="_blank">installation instructions</a>.</p>
<p>For Bash and command line basics, try the <a href="https://learnpythonthehardway.org/book/appendixa.html" target="_blank">Command Line Crash Course</a>. For a little more context presented in an ffmprovisr style, try <a href="http://explainshell.com/" target="_blank">explainshell.com</a>!</p>
<h5>License</h5>
<p><a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png"></a><br>
This work is licensed under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.</p>
<h5>Sister projects</h5>
<p><a href="http://dd388.github.io/crals/">Script Ahoy</a>: Community Resource for Archivists and Librarians Scripting</p>
<p><a href="https://datapraxis.github.io/sourcecaster/">The Sourcecaster</a>: an app that helps you use the command line to work through common challenges that come up when working with digital primary sources.</p>
<p><a target="_blank" href="http://dd388.github.io/crals/">Script Ahoy</a>: Community Resource for Archivists and Librarians Scripting</p>
<p><a target="_blank" href="https://datapraxis.github.io/sourcecaster/">The Sourcecaster</a>: an app that helps you use the command line to work through common challenges that come up when working with digital primary sources.</p>
<p><a target="_blank" href="https://amiaopensource.github.io/cable-bible/">Cable Bible</a>: A Guide to Cables and Connectors Used for Audiovisual Tech</p>
</div>
<div class="well col-md-8 col-md-offset-0">
@@ -44,7 +46,7 @@
<div class="well"><h4>Change formats</h4>
<!-- WAV to MP3 -->
<span data-toggle="modal" data-target="#wav_to_mp3"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Converts WAV to MP3">WAV to MP3</button></span>
<span data-toggle="modal" data-target="#wav_to_mp3"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Convert WAV to MP3">WAV to MP3</button></span>
<div id="wav_to_mp3" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -69,8 +71,33 @@
</div>
<!-- ends WAV to MP3 -->
<!-- WAV to AAC/MP4 -->
<span data-toggle="modal" data-target="#wav_to_mp4"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Convert WAV to AAC/MP4">WAV to AAC/MP4</button></span>
<div id="wav_to_mp4" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="well">
<h3>WAV to AAC/MP4</h3>
<p><code>ffmpeg -i <i>input_file</i>.wav -c:a aac -b:a 128k -dither_method modified_e_weighted -ar 44100 <i>output_file</i>.mp4</code></p>
<p>This will convert your WAV file to AAC/MP4.</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input_file</i></dt><dd>path and name of the input file</dd>
<dt>-c:a aac</dt><dd>sets the audio codec to AAC</dd>
<dt>-b:a 128k</dt><dd>sets the bitrate of the audio to 128k</dd>
<dt>-dither_method modified_e_weighted</dt><dd>Dither makes sure you dont unnecessarily truncate the dynamic range of your audio.</dd>
<dt>-ar 44100</dt><dd>sets the audio sampling frequency to 44100 Hz, or 44.1 kHz, or “CD quality”</dd>
<dt><i>output_file</i></dt><dd>path and name of the output file</dd>
</dl>
<p class="link"></p>
</div>
</div>
</div>
</div>
<!-- ends WAV to AAC/MP4 -->
<!-- Transcode to ProRes -->
<span data-toggle="modal" data-target="#to_prores"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="This will transcode to deinterlaced Apple ProRes LT">Transcode to ProRes</button></span>
<span data-toggle="modal" data-target="#to_prores"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Transcode to deinterlaced Apple ProRes LT">Transcode to ProRes</button></span>
<div id="to_prores" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -119,7 +146,7 @@
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input_file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-c:v libx264</dt><dd>tells ffmpeg to change the video codec of the file to H.264</dd>
<dt>-pix_fmt yuv420p</dt><dd> libx264 will use a chroma subsampling scheme that is the closest match to that of the input. This can result in YUV 4:2:0, 4:2:2, or 4:4:4 chroma subsampling. QuickTime and most other non-FFmpeg based players cant decode H.264 files that are not 4:2:0. In order to allow the video to play in all players, you can specify 4:2:0 chroma subsampling.</dd>
<dt>-pix_fmt yuv420p</dt><dd> libx264 will use a chroma subsampling scheme that is the closest match to that of the input. This can result in YC<sub>B</sub>C<sub>R</sub> 4:2:0, 4:2:2, or 4:4:4 chroma subsampling. QuickTime and most other non-FFmpeg based players cant decode H.264 files that are not 4:2:0. In order to allow the video to play in all players, you can specify 4:2:0 chroma subsampling.</dd>
<dt>-c:a copy</dt><dd>tells ffmpeg not to change the audio codec</dd>
<dt><i>output_file</i></dt><dd>path, name and extension of the output file</dd>
</dl>
@@ -169,7 +196,7 @@
<!-- ends H.264 from DCP -->
<!-- NTSC to H.264 -->
<span data-toggle="modal" data-target="#ntsc_to_h264"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Upscaled, Pillar-boxed HD H.264 Access Files from SD NTSC source">NTSC to H.264</button></span>
<span data-toggle="modal" data-target="#ntsc_to_h264"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Upscaled, pillar-boxed HD H.264 access files from SD NTSC source">NTSC to H.264</button></span>
<div id="ntsc_to_h264" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -243,7 +270,7 @@
</div>
<!-- ends SD to HD -->
<!-- 16:9 to 4:3 -->
<!-- 16:9 to 4:3 -->
<span data-toggle="modal" data-target="#HD_SD"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Transform 16:9 aspect ratio video into 4:3 with letterbox">16:9 to 4:3</button></span>
<div id="HD_SD" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
@@ -255,7 +282,8 @@
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input_file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-filter:v "pad=iw:iw*3/4:(ow-iw)/2:(oh-ih)/2"</dt><dd>video padding<br>This resolution independent formula is actually padding any aspect ratio into 4:3 by letterboxing, because the video filter uses relative values for input width (iw), input height (ih), output width (ow) and output height (oh).</dd>
<dt>-filter:v "pad=iw:iw*3/4:(ow-iw)/2:(oh-ih)/2"</dt><dd>video padding<br>
This resolution independent formula is actually padding any aspect ratio into 4:3 by letterboxing, because the video filter uses relative values for input width (iw), input height (ih), output width (ow) and output height (oh).</dd>
<dt>-c:a copy</dt><dd>re-encodes using the same audio codec<br>
For silent videos you can replace <code>-c:a copy</code> by <code>-an</code>.</dd>
<dt><i>output_file</i></dt><dd>path, name and extension of the output file</dd>
@@ -268,7 +296,7 @@
<!-- ends 16:9 to 4:3 -->
<!-- Transcode to FFV1.mkv -->
<span data-toggle="modal" data-target="#create_FFV1_mkv"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Transcode your file with the FFV1 Version 3 Codec in a matroska container">Create FFV1.mkv</button></span>
<span data-toggle="modal" data-target="#create_FFV1_mkv"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Transcode your file with the FFV1 Version 3 Codec in a Matroska container">Create FFV1.mkv</button></span>
<div id="create_FFV1_mkv" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -300,7 +328,7 @@
<!-- ends Transcode to FFV1.mkv-->
<!-- Change display aspect ratio without re-encoding video-->
<span data-toggle="modal" data-target="#change_DAR"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Change Display Aspect Ratio without re-encoding">Change Display Aspect Ratio</button></span>
<span data-toggle="modal" data-target="#change_DAR"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Change display aspect ratio without re-encoding">Change Display Aspect Ratio</button></span>
<div id="change_DAR" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -321,8 +349,8 @@
</div>
<!-- ends Change display aspect ratio without re-encoding video -->
<!-- MKV to MP4 -->
<span data-toggle="modal" data-target="#mkv_to_mp4"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Converts Matroska (MKV) to MP4">MKV to MP4</button></span>
<!-- MKV to MP4 -->
<span data-toggle="modal" data-target="#mkv_to_mp4"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Convert Matroska (MKV) to MP4">MKV to MP4</button></span>
<div id="mkv_to_mp4" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -348,7 +376,7 @@
</div>
<!-- ends MKV to MP4 -->
<!-- Images to GIF -->
<!-- Images to GIF -->
<span data-toggle="modal" data-target="#img_to_gif"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Converts images to GIF">Images to GIF</button></span>
<div id="img_to_gif" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
@@ -361,9 +389,9 @@
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-f image2</dt><dd>forces input or output file format. <code>image2</code> specifies the image file demuxer.</dd>
<dt>-framerate 9</dt><dd>sets framerate to 9 frames per second</dd>
<dt>-pattern_type glob</dt><dd>tells ffmpeg that the following mapping should "interpret like a <a href="https://en.wikipedia.org/wiki/Glob_%28programming%29">glob</a>" (a "global command" function that relies on the * as a wildcard and finds everything that matches)</dd>
<dt>-pattern_type glob</dt><dd>tells ffmpeg that the following mapping should "interpret like a <a href="https://en.wikipedia.org/wiki/Glob_%28programming%29" target="_blank">glob</a>" (a "global command" function that relies on the * as a wildcard and finds everything that matches)</dd>
<dt>-i <i>"input_image_*.jpg"</i></dt><dd>maps all files in the directory that start with input_image_, for example input_image_001.jpg, input_image_002.jpg, input_image_003.jpg... etc.<br>
(The quotation marks are necessary for the above "glob" pattern!)</dd>
(The quotation marks are necessary for the above glob pattern!)</dd>
<dt>-vf scale=250x250</dt><dd>filter the video to scale it to 250x250; -vf is an alias for -filter:v</dd>
<dt><i>output_file.gif</i></dt><dd>path and name of the output file</dd>
</dl>
@@ -388,18 +416,18 @@
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i concat:<i>input files</i></dt><dd>lists the input VOB files and directs ffmpeg to concatenate them. Each input file should be separated by a backslash and a pipe, like so:<br>
<code>-i concat:VTS_01_1.VOB\|VTS_01_2.VOB\|VTS_01_3.VOB</code><br>
The backslash is simply an escape character for the pipe (<strong>|</strong>).</dd>
The backslash is simply an escape character for the pipe (<b>|</b>).</dd>
<dt>-c:v libx264</dt><dd>sets the video codec as H.264</dd>
<dt>-c:a copy</dt><dd>audio remains as-is (no re-encode)</dd>
<dt><i>output_file.mp4</i></dt><dd>path and name of the output file</dd>
</dl>
<p>Its also possible to adjust the quality of your output by setting the <strong>-crf</strong> and <strong>-preset</strong> values:</p>
<p>Its also possible to adjust the quality of your output by setting the <b>-crf</b> and <b>-preset</b> values:</p>
<p><code>ffmpeg -i concat:<i>input_file1</i>\|<i>input_file2</i>\|<i>input_file3</i> -c:v libx264 -crf 18 -preset veryslow -c:a copy <i>output_file</i>.mp4</code></p>
<dl>
<dt>-crf 18</dt><dd>sets the constant rate factor to a visually lossless value. Libx264 defaults to a <a href="https://trac.ffmpeg.org/wiki/Encode/H.264#crf">crf of 23</a>, considered medium quality; a smaller crf value produces a larger and higher quality video.</dd>
<dt>-preset veryslow</dt><dd>A slower preset will result in better compression and therefore a higher-quality file. The default is <strong>medium</strong>; slower presets are <strong>slow</strong>, <strong>slower</strong>, and <strong>veryslow</strong>.</dd>
<dt>-crf 18</dt><dd>sets the constant rate factor to a visually lossless value. Libx264 defaults to a <a href="https://trac.ffmpeg.org/wiki/Encode/H.264#crf" target="_blank">crf of 23</a>, considered medium quality; a smaller crf value produces a larger and higher quality video.</dd>
<dt>-preset veryslow</dt><dd>A slower preset will result in better compression and therefore a higher-quality file. The default is <b>medium</b>; slower presets are <b>slow</b>, <b>slower</b>, and <b>veryslow</b>.</dd>
</dl>
<p>Bear in mind that by default, libx264 will only encode a single video stream and a single audio stream, picking the best of the options available. To preserve all video and audio streams, add <strong>-map</strong> parameters:</p>
<p>Bear in mind that by default, libx264 will only encode a single video stream and a single audio stream, picking the best of the options available. To preserve all video and audio streams, add <b>-map</b> parameters:</p>
<p><code>ffmpeg -i concat:<i>input_file1</i>\|<i>input_file2</i> -map 0:v -map 0:a -c:v libx264 -c:a copy <i>output_file</i>.mp4</code></p>
<dl>
<dt>-map 0:v</dt><dd>encodes all video streams</dd>
@@ -413,7 +441,7 @@
<!-- ends rip DVD -->
<!-- Transcode to H.265 -->
<span data-toggle="modal" data-target="#transcode_h265"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Transcode to an H.265 MP4">Transcode to H.265/HEVC</button></span>
<span data-toggle="modal" data-target="#transcode_h265"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Transcode to an H.265/HEVC MP4">Transcode to H.265/HEVC</button></span>
<div id="transcode_h265" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -421,7 +449,7 @@
<h3>Transcode to H.265/HEVC</h3>
<p><code>ffmpeg -i <i>input_file</i> -c:v libx265 -pix_fmt yuv420p -c:a copy <i>output_file</i></code></p>
<p>This command takes an input file and transcodes it to H.265/HEVC in an .mp4 wrapper, keeping the audio codec the same as in the original file.</p>
<p><strong>Note</strong>: ffmpeg must be compiled with libx265, the library of the H.265 codec, for this script to work. (Add the flag <code>--with-x265</code> if using <code>brew install ffmpeg</code> method).</p>
<p><b>Note</b>: ffmpeg must be compiled with libx265, the library of the H.265 codec, for this script to work. (Add the flag <code>--with-x265</code> if using <code>brew install ffmpeg</code> method).</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input file</i></dt><dd>path, name and extension of the input file</dd>
@@ -431,7 +459,7 @@
<dt><i>output file</i></dt><dd>path, name and extension of the output file</dd>
</dl>
<p>The libx265 encoding library defaults to a medium preset for compression quality and a CRF of 28. CRF stands for constant rate factor and determines the quality and file size of the resulting H.265 video. The CRF scale ranges from 0 (best quality [lossless]; largest file size) to 51 (worst quality; smallest file size).</p>
<p>A CRF of 28 for H.265 can be considered a medium setting, <a href="https://trac.ffmpeg.org/wiki/Encode/H.265#ConstantRateFactorCRF">corresponding</a> to a CRF of 23 in <a href="https://amiaopensource.github.io/ffmprovisr/#transcode_h264">encoding H.264</a>, but should result in about half the file size.</p>
<p>A CRF of 28 for H.265 can be considered a medium setting, <a href="https://trac.ffmpeg.org/wiki/Encode/H.265#ConstantRateFactorCRF" target="_blank">corresponding</a> to a CRF of 23 in <a href="./index.html#transcode_h264">encoding H.264</a>, but should result in about half the file size.</p>
<p>To create a higher quality file, you can add these presets:</p>
<p><code>ffmpeg -i <i>input_file</i> -c:v libx265 -pix_fmt yuv420p -preset veryslow -crf 18 -c:a copy <i>output_file</i></code></p>
<dl>
@@ -445,12 +473,146 @@
</div>
<!-- ends Transcode to H.265 -->
<!-- Deinterlace video -->
<span data-toggle="modal" data-target="#deinterlace"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Deinterlace video">Deinterlace video</button></span>
<div id="deinterlace" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="well">
<h3>Deinterlace a video</h3>
<p> <code>ffmpeg -i <i>input_file</i> -c:v libx264 -vf "yadif,format=yuv420p" <i>output_file</i></code> </p>
<p>This command takes an interlaced input file and outputs a deinterlaced H.264 MP4.</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-c:v libx264</dt><dd>tells ffmpeg to encode the video stream as H.264</dd>
<dt>-vf</dt><dd>video filtering will be used (<code>-vf</code> is an alias of <code>-filter:v</code>)</dd>
<dt><i>"</i></dt><dd>start of filtergraph (see below)</dd>
<dt><i>yadif</i></dt><dd>deinterlacing filter (yet another deinterlacing filter)<br>
By default, <a href="https://ffmpeg.org/ffmpeg-filters.html#yadif-1" target="_blank">yadif</a> will output one frame for each frame. Outputting one frame for each <i>field</i> (thereby doubling the frame rate) with <code>yadif=1</code> may produce visually better results.</dd>
<dt><i>,</i></dt><dd>separates filters</dd>
<dt><i>format=yuv420p</i></dt><dd>chroma subsampling set to 4:2:0<br>
By default, <code>libx264</code> will use a chroma subsampling scheme that is the closest match to that of the input. This can result in YC<sub>B</sub>C<sub>R</sub> 4:2:0, 4:2:2, or 4:4:4 chroma subsampling. QuickTime and most other non-FFmpeg based players cant decode H.264 files that are not 4:2:0, therefore its advisable to specify 4:2:0 chroma subsampling.</dd>
<dt><i>"</i></dt><dd>end of filtergraph</dd>
<dt><i>output file</i></dt><dd>path, name and extension of the output file</dd>
</dl>
<p> <code>"yadif,format=yuv420p"</code> is an ffmpeg <a href="https://trac.ffmpeg.org/wiki/FilteringGuide#FiltergraphChainFilterrelationship" target="_blank">filtergraph</a>. Here the filtergraph is made up of one filter chain, which is itself made up of the two filters (separated by the comma).<br>
The enclosing quote marks are necessary when you use spaces within the filtergraph, e.g. <code>-vf "yadif, format=yuv420p"</code>, and are included above as an example of good practice.</p>
<p><b>Note</b>: ffmpeg includes several deinterlacers apart from <a href="https://ffmpeg.org/ffmpeg-filters.html#yadif-1" target="_blank">yadif</a>: <a href="https://ffmpeg.org/ffmpeg-filters.html#bwdif" target="_blank">bwdif</a>, <a href="https://ffmpeg.org/ffmpeg-filters.html#w3fdif" target="_blank">w3fdif</a>, <a href="https://ffmpeg.org/ffmpeg-filters.html#kerndeint" target="_blank">kerndeint</a>, and <a href="https://ffmpeg.org/ffmpeg-filters.html#nnedi" target="_blank">nnedi</a>.</p>
<p>For more H.264 encoding options, see the latter section of the <a href="./index.html#transcode_h264">encode H.264 command</a>.</p>
<div class="sample-image">
<h4>Example</h4>
<p>Before and after deinterlacing:</p>
<img src="img/interlaced_video.png" alt="VLC screenshot of original interlaced video">
<img src="img/deinterlaced_video.png" alt="VLC screenshot of deinterlaced video">
</div>
<p class="link"></p>
</div>
</div>
</div>
</div>
<!-- ends Deinterlace video -->
<!-- Convert colourspace -->
<span data-toggle="modal" data-target="#convert-colourspace"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Convert colourspace of video">Convert colourspace</button></span>
<div id="convert-colourspace" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="well">
<h3>Transcode video to a different colourspace</h3>
<p>This command uses a filter to convert the video to a different colour space.</p>
<p> <code>ffmpeg -i <i>input_file</i> -c:v libx264 -vf colormatrix=src:dst <i>output_file</i></code> </p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-c:v libx264</dt><dd>tells ffmpeg to encode the video stream as H.264</dd>
<dt>-vf colormatrix=<i>src</i>:<i>dst</i></dt><dd>the video filter <b>colormatrix</b> will be applied, with the given source and destination colourspaces.<br>
Accepted values include <code>bt601</code> (Rec.601), <code>smpte170m</code> (Rec.601, 525-line/<a href="https://en.wikipedia.org/wiki/NTSC#NTSC-M" target="_blank">NTSC</a> version), <code>bt470bg</code> (Rec.601, 625-line/<a href="https://en.wikipedia.org/wiki/PAL#PAL-B.2FG.2FD.2FK.2FI" target="_blank">PAL</a> version), <code>bt709</code> (Rec.709), and <code>bt2020</code> (Rec.2020).<br>
For example, to convert from Rec.601 to Rec.709, you would use <code>-vf colormatrix=bt601:bt709</code>.</dd>
<dt><i>output file</i></dt><dd>path, name and extension of the output file</dd>
</dl>
<p><b>Note</b>: Converting between colourspaces with ffmpeg can be done via either the <b>colormatrix</b> or <b>colorspace</b> filters, with colorspace allowing finer control (individual setting of colourspace, transfer characteristics, primaries, range, pixel format, etc). See <a href="https://trac.ffmpeg.org/wiki/colorspace" target="_blank">this</a> entry on the ffmpeg wiki, and the ffmpeg documentation for <a href="http://ffmpeg.org/ffmpeg-filters.html#colormatrix" target="_blank">colormatrix</a> and <a href="http://ffmpeg.org/ffmpeg-filters.html#colorspace" target="_blank">colorspace</a>.</p>
<hr>
<h4>Convert colourspace and embed colourspace metadata</h4>
<p> <code>ffmpeg -i <i>input_file</i> -c:v libx264 -vf colormatrix=src:dst -color_primaries <i>val</i> -color_trc <i>val</i> -colorspace <i>val</i> <i>output_file</i></code> </p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-c:v libx264</dt><dd>encode video as H.264</dd>
<dt>-vf colormatrix=<i>src</i>:<i>dst</i></dt><dd>the video filter <b>colormatrix</b> will be applied, with the given source and destination colourspaces.</dd>
<dt>-color_primaries <i>val</i></dt><dd>tags video with the given colour primaries.<br>
Accepted values include <code>smpte170m</code> (Rec.601, 525-line/NTSC version), <code>bt470bg</code> (Rec.601, 625-line/PAL version), <code>bt709</code> (Rec.709), and <code>bt2020</code> (Rec.2020).
<dt>-color_trc <i>val</i></dt><dd>tags video with the given transfer characteristics (gamma).<br>
Accepted values include <code>smpte170m</code> (Rec.601, 525-line/NTSC version), <code>gamma28</code> (Rec.601, 625-line/PAL version)<sup><a href="#fn1" id="ref1">1</a></sup>, <code>bt709</code> (Rec.709), <code>bt2020_10</code> (Rec.2020 10-bit), and <code>bt2020_12</code> (Rec.2020 12-bit).</dd>
<dt>-colorspace <i>val</i></dt><dd>tags video as being in the given colourspace.<br>
Accepted values include <code>smpte170m</code> (Rec.601, 525-line/NTSC version), <code>bt470bg</code> (Rec.601, 625-line/PAL version), <code>bt709</code> (Rec.709), <code>bt2020_cl</code> (Rec.2020 constant luminance), and <code>bt2020_ncl</code> (Rec.2020 non-constant luminance).</dd>
<dt><i>output file</i></dt><dd>path, name and extension of the output file</dd>
</dl>
<h5>Examples</h5>
<p>To Rec.601 (525-line/NTSC):</p>
<p> <code>ffmpeg -i <i>input_file</i> -c:v libx264 -vf colormatrix=bt709:smpte170m -color_primaries smpte170m -color_trc smpte170m -colorspace smpte170m <i>output_file</i></code> </p>
<p>To Rec.601 (625-line/PAL):</p>
<p> <code>ffmpeg -i <i>input_file</i> -c:v libx264 -vf colormatrix=bt709:bt470bg -color_primaries bt470bg -color_trc gamma28 -colorspace bt470bg <i>output_file</i></code> </p>
<p>To Rec.709:</p>
<p> <code>ffmpeg -i <i>input_file</i> -c:v libx264 -vf colormatrix=bt601:bt709 -color_primaries bt709 -color_trc bt709 -colorspace bt709 <i>output_file</i></code> </p>
<p>MediaInfo output examples:</p>
<img src="./img/colourspace_metadata_mediainfo.png" alt="MediaInfo screenshots of colourspace metadata"><br>
<p><span class="beware"></span> Using this command it is possible to add Rec.709 tags to a file that is actually Rec.601 (etc), so apply with caution!</p>
<p>These commands are relevant for H.264 and H.265 videos, encoded with <code>libx264</code> and <code>libx265</code> respectively.</p>
<p><b>Note</b>: If you wish to embed colourspace metadata <i>without</i> changing to another colourspace, omit <code>-vf colormatrix=src:dst</code>. However, since it is <code>libx264</code>/<code>libx265</code> that writes the metadata, its not possible to add these tags without reencoding the video stream.</p>
<p>For all possible values for <code>-color_primaries</code>, <code>-color_trc</code>, and <code>-colorspace</code>, see the ffmpeg documentation on <a href="./index.html#Codec-Options" target="_blank">codec options</a>.</p>
<hr>
<p id="fn1" class="footnote">1. Out of step with the regular pattern, <code>-color_trc</code> doesnt accept <code>bt470bg</code>; it is instead here referred to directly as gamma.<br>
In the Rec.601 standard, 525-line/NTSC and 625-line/PAL video have assumed gammas of 2.2 and 2.8 respectively. <a href="#ref1" title="Jump back."></a></p>
<p class="link"></p>
</div>
</div>
</div>
</div>
<!-- ends Convert colourspace -->
<!-- Inverse telecine -->
<span data-toggle="modal" data-target="#inverse-telecine"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Inverse telecine video">Inverse telecine</button></span>
<div id="inverse-telecine" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="well">
<h3>Inverse telecine a video file</h3>
<p><code>ffmpeg -i <i>input_file</i> -c:v libx264 -vf "fieldmatch,yadif,decimate" <i>output_file</i></code></p>
<p>The inverse telecine procedure reverses the <a href="https://en.wikipedia.org/wiki/Three-two_pull_down">3:2 pull down</a> process, restoring 29.97fps interlaced video to the 24fps frame rate of the original film source.</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-c:v libx264</dt><dd>encode video as H.264</dd>
<dt>-vf "fieldmatch,yadif,decimate"</dt><dd>applies these three video filters to the input video.<br>
<a href="https://ffmpeg.org/ffmpeg-filters.html#fieldmatch">Fieldmatch</a> is a field matching filter for inverse telecine - it reconstructs the progressive frames from a telecined stream.<br>
<a href="https://ffmpeg.org/ffmpeg-filters.html#yadif-1">Yadif</a> (yet another deinterlacing filter) deinterlaces the video. (Note that ffmpeg also includes several other deinterlacers).<br>
<a href="https://ffmpeg.org/ffmpeg-filters.html#decimate-1">Decimate</a> deletes duplicated frames.</dd>
<dt><i>output file</i></dt><dd>path, name and extension of the output file</dd>
</dl>
<p> <code>"fieldmatch,yadif,decimate"</code> is an ffmpeg <a href="https://trac.ffmpeg.org/wiki/FilteringGuide#FiltergraphChainFilterrelationship" target="_blank">filtergraph</a>. Here the filtergraph is made up of one filter chain, which is itself made up of the three filters (separated by commas).<br>
The enclosing quote marks are necessary when you use spaces within the filtergraph, e.g. <code>-vf "fieldmatch, yadif, decimate"</code>, and are included above as an example of good practice.</p>
<p>Note that if applying an inverse telecine procedure to a 29.97i file, the output framerate will actually be 23.976fps.</p>
<p>This command can also be used to restore other framerates.</p>
<div class="sample-image">
<h4>Example</h4>
<p>Before and after inverse telecine:</p>
<img src="img/ivtc_originalvideo.gif" alt="GIF of original video">
<img src="img/ivtc_result.gif" alt="GIF of video after inverse telecine">
</div>
<p class="link"></p>
</div>
</div>
</div>
</div>
<!-- ends Inverse telecine -->
</div>
<div class="well">
<h4>Filters</h4>
<!-- astats -->
<span data-toggle="modal" data-target="#astats"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Plays a graphical output showing decibel levels of an input file">Graphic for audio</button></span>
<span data-toggle="modal" data-target="#astats"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Play a graphical output showing decibel levels of an input file">Graphic for audio</button></span>
<div id="astats" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -484,7 +646,7 @@
<!-- ends astats -->
<!-- BRNG -->
<span data-toggle="modal" data-target="#brng"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Identifies pixels out of broadcast range">Broadcast Range</button></span>
<span data-toggle="modal" data-target="#brng"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Identify pixels out of broadcast range">Broadcast Range</button></span>
<div id="brng" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -514,7 +676,7 @@
<!-- ends BRNG -->
<!-- ocr -->
<span data-toggle="modal" data-target="#ocr_on_top"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Plays video with OCR on top">Shows OCR</button></span>
<span data-toggle="modal" data-target="#ocr_on_top"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Play video with OCR on top">Shows OCR</button></span>
<div id="ocr_on_top" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -547,7 +709,7 @@
<!-- ends ocr -->
<!-- Exports OCR -->
<span data-toggle="modal" data-target="#ffprobe_ocr"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Exports OCR from video to screen">Exports OCR</button></span>
<span data-toggle="modal" data-target="#ffprobe_ocr"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Export OCR from video to screen">Exports OCR</button></span>
<div id="ffprobe_ocr" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -601,7 +763,7 @@
<!-- ends Vectorscope -->
<!--Side by Side Videos/Temporal Difference Filter-->
<span data-toggle="modal" data-target="#tempdif"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Plays two videos side by side while applying the temporal difference filter to both">Side by Side Videos/Temporal Difference Filter</button></span>
<span data-toggle="modal" data-target="#tempdif"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Play two videos side by side while applying the temporal difference filter to both">Side by Side Videos/Temporal Difference Filter</button></span>
<div id="tempdif" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -903,7 +1065,7 @@
<h4>Preservation</h4>
<!-- batch processing (Mac/Linux) -->
<span data-toggle="modal" data-target="#batch_processing_bash"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="FFMPEG batch processing on Mac/Linux">Batch processing (Mac/Linux)</button></span>
<span data-toggle="modal" data-target="#batch_processing_bash"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="FFmpeg batch processing on Mac/Linux">Batch processing (Mac/Linux)</button></span>
<div id="batch_processing_bash" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -916,13 +1078,13 @@
<dt>for file in *.MXF</dt><dd>starts the loop, and states what the input files will be. Here, the ffmpeg command within the loop will be applied to all files with an extension of .MXF.<br>
The word file is an arbitrary variable which will represent each .MXF file in turn as it is looped over.</dd>
<dt>do ffmpeg -i "$file"</dt><dd>carry out the following ffmpeg command for each input file.<br>
Per Bash syntax, within the command the variable is referred to by <strong>“$file”</strong>. The dollar sign is used to reference the variable file, and the enclosing quotation marks prevents reinterpretation of any special characters that may occur within the filename, ensuring that the original filename is retained.</dd>
Per Bash syntax, within the command the variable is referred to by <b>“$file”</b>. The dollar sign is used to reference the variable file, and the enclosing quotation marks prevents reinterpretation of any special characters that may occur within the filename, ensuring that the original filename is retained.</dd>
<dt>-map 0</dt><dd>retain all streams</dd>
<dt>-c copy</dt><dd>enable stream copy (no re-encode)</dd>
<dt>"${file%.MXF}.mov";</dt><dd>retaining the original file name, set the output file wrapper as .mov</dd>
<dt>done</dt><dd>complete; all items have been processed.</dd>
</dl>
<p><strong>Note</strong>: the shell script (.sh file) and all .MXF files to be processed must be contained within the same directory, and the script must be run from that directory.<br>
<p><b>Note</b>: the shell script (.sh file) and all .MXF files to be processed must be contained within the same directory, and the script must be run from that directory.<br>
Execute the .sh file with the command <code>sh Rewrap-MXF.sh</code>.</p>
<p>Modify the script as needed to perform different transcodes, or to use with ffprobe. :)</p>
<p>The basic pattern will look similar to this:<br>
@@ -936,14 +1098,14 @@
<!-- ends batch processing (Mac/Linux) -->
<!-- batch processing (Windows) -->
<span data-toggle="modal" data-target="#batch_processing_win"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="FFMPEG batch processing on Windows">Batch processing (Windows)</button></span>
<span data-toggle="modal" data-target="#batch_processing_win"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="FFmpeg batch processing on Windows">Batch processing (Windows)</button></span>
<div id="batch_processing_win" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="well">
<h3>Create PowerShell script to batch process with ffmpeg</h3>
<p>As of Windows 10, it is possible to run Bash via <a href="https://msdn.microsoft.com/en-us/commandline/wsl/about">Bash on Ubuntu on Windows</a>, allowing you to use <a href="http://amiaopensource.github.io/ffmprovisr/#batch_processing_bash">bash scripting</a>. To enable Bash on Windows, see <a href="https://msdn.microsoft.com/en-us/commandline/wsl/install_guide">these instructions</a>.</p>
<p>On Windows, the primary native command line programme is <strong>PowerShell</strong>. PowerShell scripts are plain text files saved with a .ps1 extension. This entry explains how they work with the example of a PowerShell script named “rewrap-mp4.ps1”, which rewraps .mp4 files in a given directory to .mkv files.</p>
<p>As of Windows 10, it is possible to run Bash via <a href="https://msdn.microsoft.com/en-us/commandline/wsl/about" target="_blank">Bash on Ubuntu on Windows</a>, allowing you to use <a href="index.html#batch_processing_bash">bash scripting</a>. To enable Bash on Windows, see <a href="https://msdn.microsoft.com/en-us/commandline/wsl/install_guide" target="_blank">these instructions</a>.</p>
<p>On Windows, the primary native command line programme is <b>PowerShell</b>. PowerShell scripts are plain text files saved with a .ps1 extension. This entry explains how they work with the example of a PowerShell script named “rewrap-mp4.ps1”, which rewraps .mp4 files in a given directory to .mkv files.</p>
<p>“rewrap-mp4.ps1” contains the following text:</p>
<pre class="codeblock"><code>$inputfiles = ls *.mp4
foreach ($file in $inputfiles) {
@@ -958,13 +1120,13 @@ foreach ($file in $inputfiles) {
<dt>{</dt><dd>Opens the code block.</dd>
<dt>$output = [io.path]::ChangeExtension($file, '.mkv')</dt><dd>Sets up the output file: it will be located in the current folder and keep the same filename, but will have an .mkv extension instead of .mp4.</dd>
<dt>ffmpeg -i $file</dt><dd>Carry out the following ffmpeg command for each input file.<br>
<strong>Note</strong>: To call ffmpeg here as just ffmpeg (rather than entering the full path to ffmpeg.exe), you must make sure that its correctly configured. See <a href="http://adaptivesamples.com/how-to-install-ffmpeg-on-windows/">this article</a>, especially the section Add to Path.</dd>
<b>Note</b>: To call ffmpeg here as just ffmpeg (rather than entering the full path to ffmpeg.exe), you must make sure that its correctly configured. See <a href="http://adaptivesamples.com/how-to-install-ffmpeg-on-windows/" target="_blank">this article</a>, especially the section Add to Path.</dd>
<dt>-map 0</dt><dd>retain all streams</dd>
<dt>-c copy</dt><dd>enable stream copy (no re-encode)</dd>
<dt>$output</dt><dd>The output file is set to the value of the <code>$output</code> variable declared above: i.e., the current file name with an .mkv extension.</dd>
<dt>}</dt><dd>Closes the code block.</dd>
</dl>
<p><strong>Note</strong>: the PowerShell script (.ps1 file) and all .mp4 files to be rewrapped must be contained within the same directory, and the script must be run from that directory.<p>
<p><b>Note</b>: the PowerShell script (.ps1 file) and all .mp4 files to be rewrapped must be contained within the same directory, and the script must be run from that directory.<p>
<p>Execute the .ps1 file by typing <code>.\rewrap-mp4.ps1</code> in PowerShell.</p>
<p>Modify the script as needed to perform different transcodes, or to use with ffprobe. :)</p>
<p class="link"></p>
@@ -975,7 +1137,7 @@ foreach ($file in $inputfiles) {
<!-- ends batch processing (Windows) -->
<!-- Create frame md5s -->
<span data-toggle="modal" data-target="#create_frame_md5s"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="This will create an MD5 checksum per video frame">Create MD5 checksums</button></span>
<span data-toggle="modal" data-target="#create_frame_md5s"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Create an MD5 checksum per video frame">Create MD5 checksums</button></span>
<div id="create_frame_md5s" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -1024,14 +1186,14 @@ foreach ($file in $inputfiles) {
<!-- ends Pull specs -->
<!-- Check FFV1 fixity -->
<span data-toggle="modal" data-target="#check_FFV1_fixity"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="This decodes your video and verifies the internal crc checksums">Check FFV1 fixity</button></span>
<span data-toggle="modal" data-target="#check_FFV1_fixity"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Decode your video and verify the internal CRC checksums">Check FFV1 fixity</button></span>
<div id="check_FFV1_fixity" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="well">
<h3>Check FFV1 Version 3 fixity</h3>
<p><code>ffmpeg -report -i <i>input_file</i> -f null -</code></p>
<p>This decodes your video and displays any crc checksum mismatches. These errors will display in your terminal like this: <code>[ffv1 @ 0x1b04660] CRC mismatch 350FBD8A!at 0.272000 seconds</code></p>
<p>This decodes your video and displays any CRC checksum mismatches. These errors will display in your terminal like this: <code>[ffv1 @ 0x1b04660] CRC mismatch 350FBD8A!at 0.272000 seconds</code></p>
<p>Frame crcs are enabled by default in FFV1 Version 3.</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
@@ -1048,7 +1210,7 @@ foreach ($file in $inputfiles) {
<!-- ends Check FFV1 Fixity -->
<!-- Check interlacement -->
<span data-toggle="modal" data-target="#check_interlacement"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="This identifies interlacement patterns in a video file">Check interlacement </button></span>
<span data-toggle="modal" data-target="#check_interlacement"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Identify interlacement patterns in a video file">Check interlacement </button></span>
<div id="check_interlacement" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@@ -1059,7 +1221,7 @@ foreach ($file in $inputfiles) {
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input_file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-filter:v idet</dt><dd>This calls the <a href="https://ffmpeg.org/ffmpeg-filters.html#idet">idet (detect video interlacing type) filter</a>.</dd>
<dt>-filter:v idet</dt><dd>This calls the <a href="https://ffmpeg.org/ffmpeg-filters.html#idet" target="_blank">idet (detect video interlacing type) filter</a>.</dd>
<dt>-f null</dt><dd>Video is decoded with the <code>null</code> muxer. This allows video decoding without creating an output file.</dd>
<dt>-</dt><dd>FFmpeg syntax requires a specified output, and <code>-</code> is just a place holder. No file is actually created. </dd>
</dl>
@@ -1071,14 +1233,14 @@ foreach ($file in $inputfiles) {
<!-- ends Check interlacement -->
<!-- QCTools Report -->
<span data-toggle="modal" data-target="#qctools"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="This will create q QCTools report for a video file with audio track">QCTools report (with audio)</button></span>
<span data-toggle="modal" data-target="#qctools"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Create a QCTools report for a video file with audio track">QCTools report (with audio)</button></span>
<div id="qctools" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="well">
<h3>Creates a QCTools report</h3>
<p><code>ffprobe -f lavfi -i "movie=<i>input_file</i>:s=v+a[in0][in1],[in0]signalstats=stat=tout+vrep+brng,cropdetect=reset=1:round=1,idet=half_life=1,split[a][b];[a]field=top[a1];[b]field=bottom,split[b1][b2];[a1][b1]psnr[c1];[c1][b2]ssim[out0];[in1]ebur128=metadata=1,astats=metadata=1:reset=1:length=0.4[out1]" -show_frames -show_versions -of xml=x=1:q=1 -noprivate | gzip > <i>input_file</i>.qctools.xml.gz</code></p>
<p>This will create an XML report for use in <a href="https://github.com/bavc/qctools">QCTools</a> for a video file with one video track and one audio track. See also the <a href="https://github.com/bavc/qctools/blob/master/docs/data_format.md#creating-a-qctools-document" target="_blank">QCTools documentation</a>.</p>
<p>This will create an XML report for use in <a href="https://github.com/bavc/qctools" target="_blank">QCTools</a> for a video file with one video track and one audio track. See also the <a href="https://github.com/bavc/qctools/blob/master/docs/data_format.md#creating-a-qctools-document" target="_blank">QCTools documentation</a>.</p>
<dl>
<dt>ffprobe</dt><dd>starts the command</dd>
<dt>-f lavfi</dt><dd>tells ffprobe to use the Libavfilter input virtual device <a href="http://ffmpeg.org/ffmpeg-devices.html#lavfi" target="_blank">[more]</a></dd>
@@ -1101,14 +1263,14 @@ foreach ($file in $inputfiles) {
<!-- ends QCTools Report -->
<!-- QCTools Report (no audio) -->
<span data-toggle="modal" data-target="#qctools_no_audio"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="This will create q QCTools report for a video file with no audio track">QCTools report (no audio)</button></span>
<span data-toggle="modal" data-target="#qctools_no_audio"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Create a QCTools report for a video file with no audio track">QCTools report (no audio)</button></span>
<div id="qctools_no_audio" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="well">
<h3>Creates a QCTools report</h3>
<p><code>ffprobe -f lavfi -i "movie=<i>input_file</i>,signalstats=stat=tout+vrep+brng,cropdetect=reset=1:round=1,idet=half_life=1,split[a][b];[a]field=top[a1];[b]field=bottom,split[b1][b2];[a1][b1]psnr[c1];[c1][b2]ssim" -show_frames -show_versions -of xml=x=1:q=1 -noprivate | gzip > <i>input_file</i>.qctools.xml.gz</code></p>
<p>This will create an XML report for use in <a href="https://github.com/bavc/qctools">QCTools</a> for a video file with one video track and NO audio track. See also the <a href="https://github.com/bavc/qctools/blob/master/docs/data_format.md#creating-a-qctools-document" target="_blank">QCTools documentation</a>.</p>
<p>This will create an XML report for use in <a href="https://github.com/bavc/qctools" target="_blank">QCTools</a> for a video file with one video track and NO audio track. See also the <a href="https://github.com/bavc/qctools/blob/master/docs/data_format.md#creating-a-qctools-document" target="_blank">QCTools documentation</a>.</p>
<dl>
<dt>ffprobe</dt><dd>starts the command</dd>
<dt>-f lavfi</dt><dd>tells ffprobe to use the Libavfilter input virtual device <a href="http://ffmpeg.org/ffmpeg-devices.html#lavfi" target="_blank">[more]</a></dd>
@@ -1132,7 +1294,7 @@ foreach ($file in $inputfiles) {
</div>
<div class="well">
<h4>Test videos</h4>
<h4>Test files</h4>
<!-- Mandelbrot -->
<span data-toggle="modal" data-target="#mandelbrot"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Make a mandelbrot test pattern video">Mandelbrot</button></span>
@@ -1190,8 +1352,9 @@ foreach ($file in $inputfiles) {
<p><code>ffmpeg -f lavfi -i testsrc=size=720x576:rate=25 -c:v v210 -t 10 <i>output_file</i></code></p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-f lavfi</dt><dd>tells ffmpeg to use the libavfilter input virtual device <a href="http://ffmpeg.org/ffmpeg-devices.html#lavfi" target="_blank">[more]</a></dd>
<dt>-i testsrc=size=720x576:rate=25</dt><dd>asks for the testsrc filter pattern as input. Adjusting the <code>size</code> and <code>rate</code> options allow you to choose a specific frame size and framerate. <a href="https://ffmpeg.org/ffmpeg-filters.html#allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc" target="_blank">[more]</a></dd>
<dt>-f lavfi</dt><dd>tells ffmpeg to use the <a href="http://ffmpeg.org/ffmpeg-devices.html#lavfi" target="_blank">libavfilter</a> input virtual device</dd>
<dt>-i testsrc=size=720x576:rate=25</dt><dd>asks for the testsrc filter pattern as input. Adjusting the <code>size</code> and <code>rate</code> options allow you to choose a specific frame size and framerate. <br>
The different test patterns that can be generated are listed <a href="https://ffmpeg.org/ffmpeg-filters.html#allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" target="_blank">here</a>.</dd>
<dt>-c:v <i>v210</i></dt><dd>transcodes video from rawvideo to 10-bit Uncompressed YUV 4:2:2. Alter this setting to set your desired codec.</dd>
<dt>-t 10</dt><dd>specifies recording time of 10 seconds</dd>
<dt><i>output_file</i></dt><dd>path, name and extension of the output file. Try different file extensions such as mkv, mov, mp4, or avi.</dd>
@@ -1245,6 +1408,29 @@ foreach ($file in $inputfiles) {
</div>
<!-- ends Play VGA SMPTE bars -->
<!-- Sine wave -->
<span data-toggle="modal" data-target="#sine_wave"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Generate a test audio file playing a sine wave">Sine wave</button></span>
<div id="sine_wave" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="well">
<h3>Sine wave</h3>
<p>Generate a test audio file playing a sine wave.</p>
<p><code>ffmpeg -f lavfi -i "sine=frequency=1000:sample_rate=48000:duration=5" -c:a pcm_s16le <i>output_file</i>.wav</code></p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-f lavfi</dt><dd>tells ffmpeg to use the libavfilter input virtual device <a href="http://ffmpeg.org/ffmpeg-devices.html#lavfi" target="_blank">[more]</a></dd>
<dt>-i "sine=frequency=1000:sample_rate=48000:duration=5"</dt><dd>Sets the signal to 1000 Hz, sampling at 48 kHz, and for 5 seconds</dd>
<dt>-c:a pcm_s16le</dt><dd>encodes the audio codec in <code>pcm_s16le</code> (the default encoding for wav files). pcm represents pulse-code modulation format (raw bytes), <code>16</code> means 16 bits per sample, and <code>le</code> means "little endian"</dd>
<dt><i>output_file</i>.wav</dt><dd>path, name and extension of the output file</dd>
</dl>
<p class="link"></p>
</div>
</div>
</div>
</div>
<!-- ends Sine wave -->
</div>
<div class="well">
<h4>Other</h4>
@@ -1261,19 +1447,19 @@ foreach ($file in $inputfiles) {
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-f concat</dt><dd>forces ffmpeg to concatenate the files and to keep the same file format</dd>
<dt>-i <i>mylist.txt</i></dt><dd>path, name and extension of the input file. Per the <a href="https://www.ffmpeg.org/ffmpeg-formats.html#Options">ffmpeg documentation</a>, it is preferable to specify relative rather than absolute file paths, as allowing absolute file paths may pose a security risk.<br>
<dt>-i <i>mylist.txt</i></dt><dd>path, name and extension of the input file. Per the <a href="https://www.ffmpeg.org/ffmpeg-formats.html#Options" target="_blank">ffmpeg documentation</a>, it is preferable to specify relative rather than absolute file paths, as allowing absolute file paths may pose a security risk.<br>
This text file contains the list of files to be concatenated and should be formatted as follows:
<pre>file '<i>./first_file.ext</i>'
file '<i>./second_file.ext</i>'
. . .
file '<i>./last_file.ext</i>'</pre>
In the above, <strong>file</strong> is simply the word "file". Straight apostrophes ('like this') rather than curved quotation marks (like this) must be used to enclose the file paths.<br>
In the above, <b>file</b> is simply the word "file". Straight apostrophes ('like this') rather than curved quotation marks (like this) must be used to enclose the file paths.<br>
<i>Note</i>: If specifying absolute file paths in the .txt file, add <code>-safe 0</code> before the input file.<br>
e.g.: <code>ffmpeg -f concat -safe 0 -i mylist.txt -c copy <i>output_file</i></code></dd>
<dt>-c copy</dt><dd>use stream copy mode to re-mux instead of re-encode</dd>
<dt><i>output_file</i></dt><dd>path, name and extension of the output file</dd>
</dl>
<p>For more information, see the <a href="https://trac.ffmpeg.org/wiki/Concatenate">ffmpeg wiki page on concatenating files</a>.</p>
<p>For more information, see the <a href="https://trac.ffmpeg.org/wiki/Concatenate" target="_blank">ffmpeg wiki page on concatenating files</a>.</p>
<p class="link"></p>
</div>
</div>
@@ -1476,7 +1662,7 @@ e.g.: <code>ffmpeg -f concat -safe 0 -i mylist.txt -c copy <i>output_file</i></c
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input_video_file</i></dt><dd>path, name and extension of the input video file</dd>
<dt>-i <i>input_image_file</i></dt><dd>path, name and extension of the image file</dd>
<dt>-filter_complex overlay=main_w-overlay_w-5:5</dt><dd>This calls the overlay filter and sets x and y coordinates for the position of the watermark on the video. Instead of hardcoding specific x and y coordinates, <code>main_w-overlay_w-5:5</code> uses relative coordinates to place the watermark in the upper right hand corner, based on the width of your input files. Please see the <a href="https://www.ffmpeg.org/ffmpeg-all.html#toc-Examples-102">ffmpeg documentation for more examples.</a></dd>
<dt>-filter_complex overlay=main_w-overlay_w-5:5</dt><dd>This calls the overlay filter and sets x and y coordinates for the position of the watermark on the video. Instead of hardcoding specific x and y coordinates, <code>main_w-overlay_w-5:5</code> uses relative coordinates to place the watermark in the upper right hand corner, based on the width of your input files. Please see the <a href="https://www.ffmpeg.org/ffmpeg-all.html#toc-Examples-102" target="_blank">ffmpeg documentation for more examples.</a></dd>
<dt><i>output_file</i></dt><dd>path, name and extension of the output file</dd>
</dl>
<p class="link"></p>
@@ -1622,9 +1808,9 @@ e.g.: <code>ffmpeg -f concat -safe 0 -i mylist.txt -c copy <i>output_file</i></c
<h4>Adding other stream properties.</h4>
<p>Other properties may be clarified in a similar way. Replace <i>-aspect</i> and its value with other properties such as shown in the options below. Note that setting color values in QuickTime requires that <i>-movflags write_colr</i> is set.</p>
<dl>
<dt>-color_primary <i>VALUE</i> -movflags write_colr</dt><dd>Set a new color_primary value. The vocabulary for values is at <a href="http://ffmpeg.org/ffmpeg-all.html">ffmpeg</a>.</dd>
<dt>-color_trc <i>VALUE</i> -movflags write_colr</dt><dd>Set a new color_transfer value. The vocabulary for values is at <a href="http://ffmpeg.org/ffmpeg-all.html">ffmpeg</a>.</dd>
<dt>-field_order <i>VALUE</i></dt><dd>Set interlacement values. The vocabulary for values is at <a href="http://ffmpeg.org/ffmpeg-all.html">ffmpeg</a>.</dd>
<dt>-color_primary <i>VALUE</i> -movflags write_colr</dt><dd>Set a new color_primary value. The vocabulary for values is at <a href="http://ffmpeg.org/ffmpeg-all.html" target="_blank">ffmpeg</a>.</dd>
<dt>-color_trc <i>VALUE</i> -movflags write_colr</dt><dd>Set a new color_transfer value. The vocabulary for values is at <a href="http://ffmpeg.org/ffmpeg-all.html" target="_blank">ffmpeg</a>.</dd>
<dt>-field_order <i>VALUE</i></dt><dd>Set interlacement values. The vocabulary for values is at <a href="http://ffmpeg.org/ffmpeg-all.html" target="_blank">ffmpeg</a>.</dd>
</dl>
<p class="link"></p>
</div>