mirror of
https://github.com/amiaopensource/ffmprovisr.git
synced 2025-10-21 21:29:18 +02:00
Compare commits
54 Commits
v2017-04-1
...
v2017-06-0
Author | SHA1 | Date | |
---|---|---|---|
|
19d249a09b | ||
|
04abe26b53 | ||
|
ab3a8b25cf | ||
|
40e8f8c73c | ||
|
129540fbfc | ||
|
8578f01e1c | ||
|
0158a85a4b | ||
|
cc724200d1 | ||
|
0c03f57df6 | ||
|
659e920e0b | ||
|
2037ec922f | ||
|
c745152f8e | ||
|
e12bbb0c6d | ||
|
2c0e555dc1 | ||
|
ed81a16458 | ||
|
172657b1bb | ||
|
7af1a3de2c | ||
|
3f76abc053 | ||
|
e3d11b3e7c | ||
|
dbe9e1a049 | ||
|
0fe609a683 | ||
|
704a87f22c | ||
|
b1a5f14e8c | ||
|
55b34452f7 | ||
|
18e2c17ab4 | ||
|
e4309d6664 | ||
|
750810d392 | ||
|
b2a04d138f | ||
|
b53f6c9984 | ||
|
64a362314c | ||
|
2a71179776 | ||
|
77e346c067 | ||
|
b995fb05c5 | ||
|
d30741e378 | ||
|
e3b01e2aa8 | ||
|
750a763157 | ||
|
0a6e5a4a7a | ||
|
54a8ab6057 | ||
|
e762c7dc42 | ||
|
cb7f001444 | ||
|
89039f55b3 | ||
|
59e6c6d879 | ||
|
195bc5446e | ||
|
a1cc5a4428 | ||
|
58663a869f | ||
|
05d16367f0 | ||
|
9477bcfe0a | ||
|
ad439d3b78 | ||
|
736b01e426 | ||
|
57166fe61d | ||
|
ec26d2038a | ||
|
321d998b5a | ||
|
009670eed1 | ||
|
d3a941a725 |
@@ -7,7 +7,7 @@ code {
|
||||
}
|
||||
|
||||
dd {
|
||||
padding-left:24px;
|
||||
padding-left: 24px;
|
||||
}
|
||||
|
||||
dt {
|
||||
@@ -26,9 +26,9 @@ img {
|
||||
}
|
||||
|
||||
h1 {
|
||||
letter-spacing:8px;
|
||||
font-size:86px;
|
||||
line-height:120px;
|
||||
letter-spacing: 8px;
|
||||
font-size: 86px;
|
||||
line-height: 120px;
|
||||
}
|
||||
|
||||
div {
|
||||
|
BIN
img/16_32_abitscope.gif
Normal file
BIN
img/16_32_abitscope.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 450 KiB |
335
index.html
335
index.html
@@ -30,12 +30,12 @@
|
||||
<p>For instructions on how to install FFmpeg on Mac, Linux, and Windows, refer to Reto Kromer’s <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>
|
||||
<p><a href="https://creativecommons.org/licenses/by/4.0/" target="_blank"><img alt="Creative Commons License" src="https://i.creativecommons.org/l/by/4.0/88x31.png"></a><br>
|
||||
This work is licensed under a <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International License</a>.</p>
|
||||
<h5>Sister projects</h5>
|
||||
<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>
|
||||
<p><a href="http://dd388.github.io/crals/" target="_blank">Script Ahoy</a>: Community Resource for Archivists and Librarians Scripting</p>
|
||||
<p><a href="https://datapraxis.github.io/sourcecaster/" target="_blank">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 href="https://amiaopensource.github.io/cable-bible/" target="_blank">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">
|
||||
@@ -60,10 +60,10 @@
|
||||
<dt>ffmpeg</dt><dd>starts the command</dd>
|
||||
<dt>-i <i>input_file</i></dt><dd>path and name of the input file<br>
|
||||
The extension for the Matroska container is <code>.mkv</code>.</dd>
|
||||
<dt>-c:v copy</dt><dd>re-encodes using the same video codec</dd>
|
||||
<dt>-c:a aac</dt><dd>re-encodes using the AAC audio codec<br>
|
||||
<dt>-c:v copy</dt><dd>copies the video stream without re-encoding it</dd>
|
||||
<dt>-c:a aac</dt><dd>re-encodes the audio stream using the AAC audio codec<br>
|
||||
Note that sadly MP4 cannot contain sound encoded by a PCM (Pulse-Code Modulation) audio codec.<br>
|
||||
For silent videos you can replace <code>-c:a aac</code> by <code>-an</code>.</dd>
|
||||
For silent videos you can replace <code>-c:a aac</code> by <code>-an</code>, which means that there will be no audio track in the output file.</dd>
|
||||
<dt><i>output_file</i></dt><dd>path and name of the output file<br>
|
||||
The extension for the MP4 container is <code>.mp4</code>.</dd>
|
||||
</dl>
|
||||
@@ -75,8 +75,6 @@
|
||||
<!-- ends MKV to MP4 -->
|
||||
|
||||
</div>
|
||||
<!-- ends well -->
|
||||
|
||||
<div class="well">
|
||||
<h4>Change codec (transcode)</h4>
|
||||
|
||||
@@ -100,7 +98,7 @@
|
||||
<li>2 = ProRes 422 (Standard)</li>
|
||||
<li>3 = ProRes 422 (HQ)</li>
|
||||
</ul></dd>
|
||||
<dt>-vf yadif</dt><dd>Runs a deinterlacing video filter (yet another deinterlacing filter) on the new file</dd>
|
||||
<dt>-vf yadif</dt><dd>Runs a deinterlacing video filter (yet another deinterlacing filter) on the new file. <code>-vf</code> is an alias for <code>-filter:v</code>.</dd>
|
||||
<dt>-c:a pcm_s16le</dt><dd>Tells ffmpeg to encode the audio stream in 16-bit linear PCM</dd>
|
||||
<dt><i>output_file</i></dt><dd>path, name and extension of the output file<br>
|
||||
The extension for the QuickTime container is <code>.mov</code>.</dd>
|
||||
@@ -129,9 +127,9 @@
|
||||
<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 change the video codec of the file to H.264</dd>
|
||||
<dt>-c:v libx264</dt><dd>tells ffmpeg to encode the video stream as 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 Y′C<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 can’t 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>-c:a copy</dt><dd>tells ffmpeg to copy the audio stream without re-encoding it</dd>
|
||||
<dt><i>output_file</i></dt><dd>path, name and extension of the output file</dd>
|
||||
</dl>
|
||||
<p>In order to use the same basic command to make a higher quality file, you can add some of these presets:</p>
|
||||
@@ -158,11 +156,11 @@
|
||||
<div class="well">
|
||||
<h3>H.264 from DCP</h3>
|
||||
<p><code>ffmpeg -i <i>input_video_file</i>.mxf -i <i>input_audio_file</i>.mxf -c:v <i>libx264</i> -pix_fmt <i>yuv420p</i> -c:a <i>aac output_file.mp4</i></code></p>
|
||||
<p>This will transcode mxf wrapped video and audio files to an H.264 encoded .mp4 file. Please note this only works for unencrypted, single reel DCPs.</p>
|
||||
<p>This will transcode MXF wrapped video and audio files to an H.264 encoded MP4 file. Please note this only works for unencrypted, single reel DCPs.</p>
|
||||
<dl>
|
||||
<dt>ffmpeg</dt><dd>starts the command</dd>
|
||||
<dt>-i <i>input_video_file</i></dt><dd>path and name of the video input file. This extension must be .mxf</dd>
|
||||
<dt>-i <i>input_audio_file</i></dt><dd>path and name of the audio input file. This extension must be .mxf</dd>
|
||||
<dt>-i <i>input_video_file</i></dt><dd>path and name of the video input file. This extension must be <code>.mxf</code></dd>
|
||||
<dt>-i <i>input_audio_file</i></dt><dd>path and name of the audio input file. This extension must be <code>.mxf</code></dd>
|
||||
<dt>-c:v <i>libx264</i></dt><dd>transcodes video to H.264</dd>
|
||||
<dt>-pix_fmt <i>yuv420p</i></dt><dd>sets pixel format to yuv420p for greater compatibility with media players</dd>
|
||||
<dt>-c:a aac</dt><dd>re-encodes using the AAC audio codec<br>
|
||||
@@ -203,7 +201,7 @@
|
||||
<dt>-slices 16</dt><dd>Each frame is split into 16 slices. 16 is a good trade-off between filesize and encoding time. <a href="http://ndsr.nycdigital.org/diving-in-head-first/" target="_blank">[more]</a></dd>
|
||||
<dt>-c:a copy</dt><dd>copies all mapped audio streams.</dd>
|
||||
<dt><i>output_file</i>.mkv</dt><dd>path and name of the output file. Use the <code>.mkv</code> extension to save your file in a Matroska container. Optionally, choose a different extension if you want a different container, such as <code>.mov</code> or <code>.avi</code>.</dd>
|
||||
<dt>-f framemd5</dt><dd> Decodes video with the framemd5 muxer in order to generate md5 checksums for every frame of your input file. This allows you to verify losslessness when compared against the framemd5s of the output file.</dd>
|
||||
<dt>-f framemd5</dt><dd> Decodes video with the framemd5 muxer in order to generate MD5 checksums for every frame of your input file. This allows you to verify losslessness when compared against the framemd5s of the output file.</dd>
|
||||
<dt>-an</dt><dd>ignores the audio stream when creating framemd5 (audio no)</dd>
|
||||
<dt><i>framemd5_output_file</i></dt><dd>path, name and extension of the framemd5 file.</dd>
|
||||
</dl>
|
||||
@@ -230,7 +228,7 @@
|
||||
<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>
|
||||
<dt>-vf scale=250x250</dt><dd>filter the video to scale it to 250x250; -vf is an alias for -filter:v</dd>
|
||||
<dt>-vf scale=250x250</dt><dd>filter the video to scale it to 250x250; <code>-vf</code> is an alias for <code>-filter:v</code></dd>
|
||||
<dt><i>output_file.gif</i></dt><dd>path and name of the output file</dd>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
@@ -262,7 +260,7 @@
|
||||
<p>It’s 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" target="_blank">crf of 23</a>, considered medium quality; a smaller crf value produces a larger and higher quality video.</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 <b>-map</b> parameters:</p>
|
||||
@@ -366,8 +364,6 @@
|
||||
<!-- ends WAV to AAC/MP4 -->
|
||||
|
||||
</div>
|
||||
<!-- ends well -->
|
||||
|
||||
<div class="well">
|
||||
<h4>Change formats</h4>
|
||||
|
||||
@@ -599,15 +595,15 @@
|
||||
<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>
|
||||
<p>The inverse telecine procedure reverses the <a href="https://en.wikipedia.org/wiki/Three-two_pull_down" target="_blank">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>
|
||||
<a href="https://ffmpeg.org/ffmpeg-filters.html#fieldmatch" target="_blank">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" target="_blank">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" target="_blank">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>
|
||||
@@ -631,6 +627,32 @@
|
||||
<div class="well">
|
||||
<h4>Filters</h4>
|
||||
|
||||
<!-- abitscope -->
|
||||
<span data-toggle="modal" data-target="#abitscope"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Audio Bitscope">Audio Bitscope</button></span>
|
||||
<div id="abitscope" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="well">
|
||||
<h3>Creates a visualization of the bits in an audio stream</h3>
|
||||
<p><code>ffplay -f lavfi "amovie=<i>input_file</i>,asplit=2[out1][a],[a]abitscope=colors=purple|yellow[out0]"</code></p>
|
||||
<p>This filter allows visual analysis of the information held in various bit depths of an audio stream. This can aid with identifying when a file that is nominally of a higher bit depth actually has been 'padded' with null information. The provided GIF shows a 16 bit WAV file (left) and then the results of converting that same WAV to 32 bit (right). Note that in the 32 bit version, there is still only information in the first 16 bits.</p>
|
||||
<dl>
|
||||
<dt>ffplay -f lavfi</dt><dd>starts the command and tells ffplay that you will be using the lavfi virtual device to create the input</dd>
|
||||
<dt>amovie=<i>input_file</i></dt><dd>path, name and extension of the input file</dd>
|
||||
<dt>asplit=2[out1][a]</dt><dd>splits the audio stream in two. One of these [a] will be passed to the filter, and the other [out1] will be the audible stream.</dd>
|
||||
<dt>[a]abitscope=colors=purple|yellow[out0]</dt><dd>sends stream [a] into the abitscope filter, sets the colors for the channels to purple and yellow, and outputs the results to [out0]. This is what will be the visualization.</dd>
|
||||
</dl>
|
||||
<div class="sample-image">
|
||||
<h4>Comparison of mono 16 bit and mono 16 bit padded to 32 bit.</h4>
|
||||
<img src="img/16_32_abitscope.gif" alt="bit_scope_comparison">
|
||||
</div>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ends abitscope -->
|
||||
|
||||
<!-- astats -->
|
||||
<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">
|
||||
@@ -1010,7 +1032,7 @@
|
||||
<dt>-i <i>input_file</i></dt><dd>path, name and extension of the input file</dd>
|
||||
<dt>-aspect <i>4:3</i></dt><dd>declares the aspect ratio of the resulting video file. You can also use 16:9.</dd>
|
||||
<dt>-target <i>ntsc-dvd</i></dt><dd>specifies the region for your DVD. This could be also pal-dvd.</dd>
|
||||
<dt><i>output_file</i>.mpg</dt><dd>path and name of the output file. The extension must be .mpg</dd>
|
||||
<dt><i>output_file</i>.mpg</dt><dd>path and name of the output file. The extension must be <code>.mpg</code></dd>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
@@ -1067,10 +1089,10 @@
|
||||
<dt>[b]afifo[bb];</dt><dd>this buffers the stream "b" to help prevent dropped samples and renames stream to "bb"</dd>
|
||||
<dt>[1:a:0][bb]concat=n=2:v=0:a=1[concatout]</dt><dd><code>concat</code> is used to join files. <code>n=2</code> tells the filter there are two inputs. <code>v=0:a=1</code> Tells the filter there are 0 video outputs and 1 audio output. This command appends the audio from the second input to the beginning of stream "bb" and names the output "concatout"</dd>
|
||||
<dt>-map "[a]"</dt><dd>this maps the unmodified audio stream to the first output</dd>
|
||||
<dt>-codec:a libmp3lame -dither_method modified_e_weighted -qscale:a 2</dt><dd>sets up mp3 options (using constant quality)</dd>
|
||||
<dt>-codec:a libmp3lame -dither_method modified_e_weighted -qscale:a 2</dt><dd>sets up MP3 options (using constant quality)</dd>
|
||||
<dt><i>output_file</i></dt><dd>path, name and extension of the output file (unmodified)</dd>
|
||||
<dt>-map "[concatout]"</dt><dd>this maps the modified stream to the second output</dd>
|
||||
<dt>-codec:a libmp3lame -dither_method modified_e_weighted -qscale:a 2</dt><dd>sets up mp3 options (using constant quality)</dd>
|
||||
<dt>-codec:a libmp3lame -dither_method modified_e_weighted -qscale:a 2</dt><dd>sets up MP3 options (using constant quality)</dd>
|
||||
<dt><i>output_file_appended</i></dt><dd>path, name and extension of the output file (with appended notice)</dd>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
@@ -1080,6 +1102,111 @@
|
||||
</div>
|
||||
<!-- ends append notice to access mp3 -->
|
||||
|
||||
</div>
|
||||
<div class="well">
|
||||
<h4>Normalize/Equalize Audio</h4>
|
||||
|
||||
<!-- loudnorm metadata -->
|
||||
<span data-toggle="modal" data-target="#loudnorm_metadata"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Calculate Loudness Levels">Calculate Loudness Levels</button></span>
|
||||
<div id="loudnorm_metadata" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="well">
|
||||
<h3>Calculate Loudness Levels</h3>
|
||||
<p><code>ffmpeg -i <i>input_file</i> -af loudnorm=print_format=json -f null -</code></p>
|
||||
<p>This filter calculates and outputs loudness information in json about an input file (labeled input) as well as what the levels would be if loudnorm were applied in its one pass mode (labeled output). The values generated can be used as inputs for a 'second pass' of the loudnorm filter allowing more accurate loudness normalization than if it is used in a single pass.</p>
|
||||
<p>These instructions use the loudnorm defaults, which align well with PBS recommendations for target loudness. More information can be found at the <a href=https://ffmpeg.org/ffmpeg-filters.html#loudnorm>loudnorm documentation</a>.</p>
|
||||
<p>Information about PBS loudness standards can be found in the <a href=http://www-tc.pbs.org/capt/Producing/TOS-2012-Pt2-Distribution.pdf>PBS Technical Operating Specifications</a> document. Information about EBU loudness standards can be found in the <a href=https://tech.ebu.ch/docs/r/r128-2014.pdf>EBU R 128</a> recommendation document.</p>
|
||||
<dl>
|
||||
<dt>ffmpeg</dt><dd>starts the command</dd>
|
||||
<dt><i>input_file</i></dt><dd>path, name and extension of the input file</dd>
|
||||
<dt>-af loudnorm</dt><dd>activates the loudnorm filter</dd>
|
||||
<dt>print_format=json</dt><dd>sets the output format for loudness information to json. This format makes it easy to use in a second pass. For a more human readable output, this can be set to <code>print_format=summary</code></dd>
|
||||
<dt><i>-f null -</i></dt><dd>sets the file output to null (since we are only interested in the metadata generated)</dd>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ends loudnorm metadata -->
|
||||
|
||||
<!-- one pass loudnorm -->
|
||||
<span data-toggle="modal" data-target="#loudnorm_one_pass"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="One Pass Loudness Normalization">One Pass Loudness Normalization</button></span>
|
||||
<div id="loudnorm_one_pass" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="well">
|
||||
<h3>One Pass Loudness Normalization</h3>
|
||||
<p><code>ffmpeg -i <i>input_file</i> -af loudnorm=dual_mono=true <i>output_file</i></code></p>
|
||||
<p>This will normalize the loudness of an input using one pass, which is quicker but less accurate than using two passes. This command uses the loudnorm filter defaults for target loudness. These defaults align well with PBS recommendations, but loudnorm does allow targeting of specific loudness levels. More information can be found at the <a href=https://ffmpeg.org/ffmpeg-filters.html#loudnorm>loudnorm documentation</a>.</p>
|
||||
<p>Information about PBS loudness standards can be found in the <a href=http://www-tc.pbs.org/capt/Producing/TOS-2012-Pt2-Distribution.pdf>PBS Technical Operating Specifications</a> document. Information about EBU loudness standards can be found in the <a href=https://tech.ebu.ch/docs/r/r128-2014.pdf>EBU R 128</a> recommendation document.</p>
|
||||
<dl>
|
||||
<dt>ffmpeg</dt><dd>starts the command</dd>
|
||||
<dt><i>input_file</i></dt><dd>path, name and extension of the input file</dd>
|
||||
<dt>-af loudnorm</dt><dd>activates the loudnorm filter with default settings</dd>
|
||||
<dt>dual_mono=true</dt><dd>(optional) Use this for mono files meant to be played back on stereo systems for correct loudness. Not necessary for multi-track inputs.</dd>
|
||||
<dt><i>output_file</i></dt><dd>path, name and extension for output file</dd>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ends one pass loudnorm -->
|
||||
|
||||
<!-- two pass loudnorm -->
|
||||
<span data-toggle="modal" data-target="#loudnorm_two_pass"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Two Pass Loudness Normalization">Two Pass Loudness Normalization</button></span>
|
||||
<div id="loudnorm_two_pass" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="well">
|
||||
<h3>Two Pass Loudness Normalization</h3>
|
||||
<p><code>ffmpeg -i <i>input_file</i> -af loudnorm=dual_mono=true:measured_I=<i>input_i</i>:measured_TP=<i>input_tp</i>:measured_LRA=<i>input_lra</i>:measured_thresh=<i>input_thresh</i>:offset=<i>target_offset</i>:linear=true <i>output_file</i></code></p>
|
||||
<p>This command allows using the levels calculated using a <a href=#loudnorm_metadata>first pass of the loudnorm filter</a> to more accurately normalize loudness. This command uses the loudnorm filter defaults for target loudness. These defaults align well with PBS recommendations, but loudnorm does allow targeting of specific loudness levels. More information can be found at the <a href=https://ffmpeg.org/ffmpeg-filters.html#loudnorm>loudnorm documentation</a>.</p>
|
||||
<p>Information about PBS loudness standards can be found in the <a href=http://www-tc.pbs.org/capt/Producing/TOS-2012-Pt2-Distribution.pdf>PBS Technical Operating Specifications</a> document. Information about EBU loudness standards can be found in the <a href=https://tech.ebu.ch/docs/r/r128-2014.pdf>EBU R 128</a> recommendation document.</p>
|
||||
<dl>
|
||||
<dt>ffmpeg</dt><dd>starts the command</dd>
|
||||
<dt><i>input_file</i></dt><dd>path, name and extension of the input file</dd>
|
||||
<dt>-af loudnorm</dt><dd>activates the loudnorm filter with default settings</dd>
|
||||
<dt>dual_mono=true</dt><dd>(optional) use this for mono files meant to be played back on stereo systems for correct loudness. Not necessary for multi-track inputs.</dd>
|
||||
<dt>measured_I=<i>input_i</i></dt><dd>use the 'input_i' value (integrated loudness) from the first pass in place of input_i</dd>
|
||||
<dt>measured_TP=<i>input_tp</i></dt><dd>use the 'input_tp' value (true peak) from the first pass in place of input_tp</dd>
|
||||
<dt>measured_LRA=<i>input_lra</i></dt><dd>use the 'input_lra' value (loudness range) from the first pass in place of input_lra</dd>
|
||||
<dt>measured_LRA=<i>input_thresh</i></dt><dd>use the 'input_thresh' value (threshold) from the first pass in place of input_thresh</dd>
|
||||
<dt>offset=<i>target_offset</i></dt><dd>use the 'target_offset' value (offset) from the first pass in place of target_offset</dd>
|
||||
<dt>linear=true</dt><dd>tells loudnorm to use linear normalization</dd>
|
||||
<dt><i>output_file</i></dt><dd>path, name and extension for output file</dd>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ends two pass loudnorm -->
|
||||
|
||||
<!-- RIAA equalization -->
|
||||
<span data-toggle="modal" data-target="#riaa_eq"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="RIAA Equalization">RIAA Equalization</button></span>
|
||||
<div id="riaa_eq" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="well">
|
||||
<h3>RIAA Equalization</h3>
|
||||
<p><code>ffmpeg -i <i>input_file</i> -af aemphasis=type=riaa <i>output_file</i></code></p>
|
||||
<p>This will apply RIAA equalization to an input file allowing correct listening of audio transferred 'flat' (without EQ) from records that used this EQ curve. For more information about RIAA equalization see the <a href=https://en.wikipedia.org/wiki/RIAA_equalization>Wikipedia page</a> on the subject.</p>
|
||||
<dl>
|
||||
<dt>ffmpeg</dt><dd>starts the command</dd>
|
||||
<dt><i>input_file</i></dt><dd>path, name and extension of the input file</dd>
|
||||
<dt>-af aemphasis=type=riaa</dt><dd>activates the aemphasis filter and sets it to use RIAA equalization</dd>
|
||||
<dt><i>output_file</i></dt><dd>path and name of output file</dd>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ends RIAA equalization -->
|
||||
|
||||
</div>
|
||||
<div class="well">
|
||||
<h4>Preservation</h4>
|
||||
@@ -1172,7 +1299,7 @@ foreach ($file in $inputfiles) {
|
||||
<dt>-an</dt><dd>ignores the audio stream (audio no)</dd>
|
||||
<dt><i>output_file</i></dt><dd>path, name and extension of the output file</dd>
|
||||
</dl>
|
||||
<p>You may verify an MD5 checksum file created this way by using a <a href="check_framemd5.sh" target="_blank">Bash script</a>.</p>
|
||||
<p>You may verify an MD5 checksum file created this way by using a <a href="scripts/check_video_framemd5.sh" target="_blank">Bash script</a>.</p>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1187,13 +1314,15 @@ foreach ($file in $inputfiles) {
|
||||
<div class="modal-content">
|
||||
<div class="well">
|
||||
<h3>Create MD5 checksums (audio samples)</h3>
|
||||
<p><code>ffmpeg -i <i>input_file</i> -filter_complex "asetnsamples=<i>n=48000</i>" -f framemd5 -vn <i>output_file</i></code></p>
|
||||
<p>This will create an MD5 checksum for each group of 48000 audio samples.<br> The number of samples per group can be set arbitrarily, but it's good practice to match the samplerate of the media file (so you will get one checksum per second).</p>
|
||||
<p><code>ffmpeg -i <i>input_file</i> -af "asetnsamples=<i>n=48000</i>" -f framemd5 -vn <i>output_file</i></code></p>
|
||||
<p>This will create an MD5 checksum for each group of 48000 audio samples.<br>
|
||||
The number of samples per group can be set arbitrarily, but it's good practice to match the samplerate of the media file (so you will get one checksum per second).</p>
|
||||
<p>Examples for other samplerates:</p>
|
||||
<ul>
|
||||
<li>44.1 kHz: "asetnsamples=n=44100"</li>
|
||||
<li>96 kHz: "asetnsamples=n=96000"</li>
|
||||
</ul>
|
||||
<p>Note: This filter trandscodes audio to 16 bit PCM by default. The generated framemd5s will represent this value. Validating these framemd5s will require using the same default settings.</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>
|
||||
@@ -1201,7 +1330,7 @@ foreach ($file in $inputfiles) {
|
||||
<dt>-vn</dt><dd>ignores the video stream (video no)</dd>
|
||||
<dt><i>output_file</i></dt><dd>path, name and extension of the output file</dd>
|
||||
</dl>
|
||||
<p>You may verify an MD5 checksum file created this way by using a <a href="check_framemd5.sh" target="_blank">Bash script</a>.</p>
|
||||
<p>You may verify an MD5 checksum file created this way by using a <a href="scripts/check_audio_framemd5.sh" target="_blank">Bash script</a>.</p>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1468,7 +1597,7 @@ foreach ($file in $inputfiles) {
|
||||
<dl>
|
||||
<dt>ffmpeg</dt><dd>starts the command</dd>
|
||||
<dt>-i <i>input_file</i></dt><dd>takes in a normal file</dd>
|
||||
<dt>-bsf noise=1</dt><dd>sets bitstream filters for all to 'noise'. Filters can be set on specific filters using syntax such as <code>-bsf:v</code> for video, <code>-bsf:a</code> for audio, etc. The <a target="_blank" href="https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#noise">noise filter</a> intentionally damages the contents of packets without damaging the container. This sets the noise level to 1 but it could be left blank or any number above 0.</dd>
|
||||
<dt>-bsf noise=1</dt><dd>sets bitstream filters for all to 'noise'. Filters can be set on specific filters using syntax such as <code>-bsf:v</code> for video, <code>-bsf:a</code> for audio, etc. The <a href="https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#noise" target="_blank">noise filter</a> intentionally damages the contents of packets without damaging the container. This sets the noise level to 1 but it could be left blank or any number above 0.</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>
|
||||
@@ -1519,7 +1648,7 @@ foreach ($file in $inputfiles) {
|
||||
<dt>-i "sine=frequency=1000:sample_rate=48000"</dt><dd>Sets the signal to 1000 Hz, sampling at 48 kHz.</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>-t 10</dt><dd>specifies recording time of 10 seconds</dd>
|
||||
<dt>-c:v <i>ffv1</i></dt><dd>Encodes to <a href="https://en.wikipedia.org/wiki/FFV1">FFV1</a>. Alter this setting to set your desired codec.</dd>
|
||||
<dt>-c:v <i>ffv1</i></dt><dd>Encodes to <a href="https://en.wikipedia.org/wiki/FFV1" target="_blank">FFV1</a>. Alter this setting to set your desired codec.</dd>
|
||||
<dt><i>output_file</i>.wav</dt><dd>path, name and extension of the output file</dd>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
@@ -1529,6 +1658,33 @@ foreach ($file in $inputfiles) {
|
||||
</div>
|
||||
<!-- ends SMPTE bars + Sine wave -->
|
||||
|
||||
</div>
|
||||
<div class="well">
|
||||
<h4>Repair</h4>
|
||||
|
||||
<!-- Fix A/V async 1 -->
|
||||
<span data-toggle="modal" data-target="#avsync_aresample"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Fix A/V sync issues by resampling audio">Fix AV Sync: Resample audio</button></span>
|
||||
<div id="avsync_aresample" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="well">
|
||||
<h3>Fix AV Sync: Resample audio</h3>
|
||||
<p><code>ffmpeg -i <i>input_file</i> -c:v copy -c:a pcm_s16le -af "aresample=async=1000" <i>output_file</i></code></p>
|
||||
<dl>
|
||||
<dt>ffmpeg</dt><dd>starts the command</dd>
|
||||
<dt><i>input_file</i></dt><dd>path, name and extension of the input file</dd>
|
||||
<dt>-c:v copy</dt><dd>Copy all mapped video streams.</dd>
|
||||
<dt>-c:a pcm_s16le</dt><dd>Tells ffmpeg to encode the audio stream in 16-bit linear PCM (<a href="https://en.wikipedia.org/wiki/Endianness#Little-endian" target="_blank">little endian</a>)</dd>
|
||||
<dt>-af "aresample=async=1000"</dt><dd>Stretch/squeezes samples to given timestamps, with maximum of 1000 samples per second compensation <a href="https://ffmpeg.org/ffmpeg-filters.html#aresample-1" target="_blank">[more]</a></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>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ends Fix A/V async 1 -->
|
||||
|
||||
</div>
|
||||
<div class="well">
|
||||
<h4>Other</h4>
|
||||
@@ -1565,6 +1721,42 @@ e.g.: <code>ffmpeg -f concat -safe 0 -i mylist.txt -c copy <i>output_file</i></c
|
||||
</div>
|
||||
<!-- ends Join files together -->
|
||||
|
||||
<!-- Split file into segments -->
|
||||
<span data-toggle="modal" data-target="#segment_file"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Split one file into several smaller segments">Split file into segments</button></span>
|
||||
<div id="segment_file" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="well">
|
||||
<h3>Split file into segments</h3>
|
||||
<p><code>ffmpeg -i <i>input_file</i> -c copy -map 0 -f segment -segment_time 60 -reset_timestamps 1 <i>output_file-%03d.mkv</i></code></p>
|
||||
<dl>
|
||||
<dt>ffmpeg</dt><dd>Starts the command.</dd>
|
||||
<dt>-i <i>input_file</i></dt><dd>Takes in a normal file.</dd>
|
||||
<dt>-c copy</dt><dd>Use stream copy mode to re-mux instead of re-encode.</dd>
|
||||
<dt>-map 0</dt><dd>Tells ffmpeg to map all streams of the input to the output.</dd>
|
||||
<dt>-f segment</dt><dd>Use <a href="http://www.ffmpeg.org/ffmpeg-formats.html#toc-segment_002c-stream_005fsegment_002c-ssegment">segment muxer</a> for generating the output.</dd>
|
||||
<dt>-segment_time 60</dt><dd>Set duration of each segment (in seconds). This example creates segments with max. duration of 60s each.</dd>
|
||||
<dt>-reset_timestamps 1</dt><dd>Reset timestamps of each segment to 0. Meant to ease the playback of the generated segments.</dd>
|
||||
<dt><i>output_file-%03d.mkv</i></dt>
|
||||
<dd>
|
||||
<p>Path, name and extension of the output file.<br>
|
||||
In order to have an incrementing number in each segment filename, FFmpeg supports <a href="http://www.cplusplus.com/reference/cstdio/printf/">printf-style</a> syntax for a counter.</p>
|
||||
<p>In this example, '%03d' means: 3-digits, zero-padded<br>
|
||||
Examples:</p>
|
||||
<ul>
|
||||
<li><code>%03d</code>: 000, 001, 002, ... 999</li>
|
||||
<li><code>%05d</code>: 00000, 00001, 00002, ... 99999</li>
|
||||
<li><code>%d</code>: 0, 1, 2, 3, 4, ... 23, 24, etc. </li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ends Split file into segments -->
|
||||
|
||||
<!-- Play image sequence -->
|
||||
<span data-toggle="modal" data-target="#play_im_seq"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Play an image sequence directly as moving images">Play an image sequence</button></span>
|
||||
<div id="play_im_seq" class="modal fade" tabindex="-1" role="dialog">
|
||||
@@ -1946,34 +2138,75 @@ e.g.: <code>ffmpeg -f concat -safe 0 -i mylist.txt -c copy <i>output_file</i></c
|
||||
</div>
|
||||
<!-- ends View Format info -->
|
||||
|
||||
</div><!-- closes the well -->
|
||||
|
||||
<div class="well">
|
||||
<h4>Repair</h4>
|
||||
|
||||
<!-- Fix A/V async 1 -->
|
||||
<span data-toggle="modal" data-target="#avsync_aresample"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Fix A/V sync issues by resampling audio">Fix AV Sync: Resample audio</button></span>
|
||||
<div id="avsync_aresample" class="modal fade" tabindex="-1" role="dialog">
|
||||
<!-- Compare Video Fingerprints -->
|
||||
<span data-toggle="modal" data-target="#compare_video_fingerprints"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Compare Video Fingerprints">Compare Video Fingerprints</button></span>
|
||||
<div id="compare_video_fingerprints" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="well">
|
||||
<h3>Fix AV Sync: Resample audio</h3>
|
||||
<p><code>ffmpeg -i <i>input_file</i> -c:v copy -c:a pcm_s16le -af "aresample=async=1000" <i>output_file</i></code></p>
|
||||
<h3>Compare two video files for content similarity using perceptual hashing</h3>
|
||||
<p><code>ffmpeg -i <i>input_one</i> -i <i>input_two</i> -filter_complex signature=detectmode=full:nb_inputs=2 -f null -</code></p>
|
||||
<dl>
|
||||
<dt>ffmpeg</dt><dd>starts the command</dd>
|
||||
<dt><i>input_file</i></dt><dd>path, name and extension of the input file</dd>
|
||||
<dt>-c:v copy</dt><dd>Copy all mapped video streams.</dd>
|
||||
<dt>-c:a pcm_s16le</dt><dd>Tells ffmpeg to encode the audio stream in 16-bit linear PCM (<a href="https://en.wikipedia.org/wiki/Endianness#Little-endian">little endian</a>)</dd>
|
||||
<dt>-af "aresample=async=1000"</dt><dd>Stretch/squeezes samples to given timestamps, with maximum of 1000 samples per second compensation <a href="https://ffmpeg.org/ffmpeg-filters.html#aresample-1" target="_blank">[more]</a></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>
|
||||
<dt>-i <i>input_one</i> -i <i>input_two</i></dt><dd>assigns the input files</dd>
|
||||
<dt>-filter_complex</dt><dd>enables using more than one input file to the filter</dd>
|
||||
<dt>signature=detectmode=full</dt><dd>Applies the signature filter to the inputs in 'full' mode. The other option is 'fast'.</dd>
|
||||
<dt>nb_inputs=2</dt><dd>tells the filter to expect two input files</dd>
|
||||
<dt>-f null -</dt><dd>Sets the output of ffmpeg to a null stream (since we are not creating a transcoded file, just viewing metadata).</dd>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ends Fix A/V async 1 -->
|
||||
</div><!-- closes the well -->
|
||||
<!-- ends Compare Video Fingerprints -->
|
||||
|
||||
<!-- Generate Video Fingerprint -->
|
||||
<span data-toggle="modal" data-target="#generate_video_fingerprint"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Generate Video Fingerprint">Generate Video Fingerprint</button></span>
|
||||
<div id="generate_video_fingerprint" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="well">
|
||||
<h3>Generate a perceptual hash for an input video file</h3>
|
||||
<p><code>ffmpeg -i <i>input</i> -vf signature=format=xml:filename="output.xml" -an -f null -</code></p>
|
||||
<dl>
|
||||
<dt>ffmpeg -i <i>input</i></dt><dd>starts the command using your input file</dd>
|
||||
<dt>-vf signature=format=xml</dt><dd>applies the signature filter to the input file and sets the output format for the fingerprint to xml</dd>
|
||||
<dt>filename="output.xml"</dt><dd>sets the output for the signature filter</dd>
|
||||
<dt>-an</dt><dd>tells ffmpeg to ignore the audio stream of the input file</dd>
|
||||
<dt>-f null -</dt><dd>Sets the ffmpeg output to a null stream (since we are only interested in the output generated by the filter).</dd>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ends Generate Video Fingerprint -->
|
||||
|
||||
<!-- Strip metadata -->
|
||||
<span data-toggle="modal" data-target="#strip_metadata"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Strip metadata">Strip metadata</button></span>
|
||||
<div id="strip_metadata" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="well">
|
||||
<h3>Strips metadata from video file</h3>
|
||||
<p><code>ffmpeg -i <i>input_file</i> -map_metadata -1 -c:v copy -c:a copy <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>-map_metadata -1</dt><dd>sets metadata copying to -1, which copies nothing</dd>
|
||||
<dt>-vcodec copy</dt><dd>copies video track</dd>
|
||||
<dt>-acodec copy</dt><dd>copies audio track</dd>
|
||||
<dt><i>output_file</i></dt><dd>Makes copy of original file and names output file</dd>
|
||||
</dl>
|
||||
<p class="link"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ends Strip metadata -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- sample example -->
|
||||
|
67
readme.md
67
readme.md
@@ -1,37 +1,55 @@
|
||||
# [ffmprovisr](http://amiaopensource.github.io/ffmprovisr)
|
||||
|
||||
Repository of useful FFmpeg command lines for archivists! [AMIA hackday](http://wiki.curatecamp.org/index.php/Association_of_Moving_Image_Archivists_%26_Digital_Library_Federation_Hack_Day_2015) edition.
|
||||
Repository of useful FFmpeg command lines for archivists!
|
||||
|
||||
## What is this?
|
||||
|
||||
Project Objective: To facilitate better understanding of FFmpeg through collaborative sharing of useful scripts and detailed flag-level description of how each script works so archivists can copy-paste and produce their own scripts but also understand how and why they work.
|
||||
#### Project Objective
|
||||
|
||||
To facilitate better understanding of FFmpeg through collaborative sharing of useful scripts and detailed flag-level description of how each script works, so archivists can copy-paste and produce their own scripts, but also understand how and why they work.
|
||||
|
||||
## How do I see it?
|
||||
|
||||
Code stuff in the gh-pages branch (the default primary branch). Readme is right here. The site is live and lives on github pages. You can see it [here](http://amiaopensource.github.io/ffmprovisr), or you can download a [release](https://github.com/amiaopensource/ffmprovisr/releases) and use it locally.
|
||||
The code is found in the gh-pages branch (the default primary branch). Readme is right here. You can see the site live on [GitHub pages](http://amiaopensource.github.io/ffmprovisr).
|
||||
|
||||
You can also install the latest [release](https://github.com/amiaopensource/ffmprovisr/releases) on your computer with the command:
|
||||
```
|
||||
brew install amiaopensource/amiaos/ffmprovisr
|
||||
```
|
||||
and then call it locally with the command:
|
||||
```
|
||||
ffmprovisr
|
||||
```
|
||||
This works currently under macOS, Linux and the Linux subsystem on Windows. On classic Windows you can install the last [release](https://github.com/amiaopensource/ffmprovisr/releases) manually and the open `index.html` in a browser.
|
||||
|
||||
## How do I contribute?
|
||||
|
||||
You are welcome to edit the codebase yourself or just supply the information and ask it to be added to the site.
|
||||
You are welcome to edit the codebase yourself, or just supply the information and ask it to be added to the site.
|
||||
|
||||
To contribute to this project directly (and more quickly), clone this repository and create a new branch (`git checkout -b your-branch-name`) and add or modify a new block in index.html. Then submit a pull request and someone can review and integrate your code. There is a commented-out sample available at the bottom of index.html that can be used to build your own block.
|
||||
#### Edit codebase
|
||||
|
||||
If you are having trouble with the coding it yourself or with github, feel free to [submit an issue](https://github.com/amiaopensource/ffmprovisr/issues) with the kind of command you would like to see added to the site.
|
||||
To contribute to this project directly (and more quickly), clone this repository and create a new branch (`git checkout -b your-branch-name`) and add or modify a new block in `index.html`. Then [submit a pull request](https://github.com/amiaopensource/ffmprovisr/pulls) and the maintainers will review and integrate your code. There is a commented-out sample block available at the bottom of `index.html` that can be as a guideline for your command.
|
||||
|
||||
#### Make a request
|
||||
|
||||
If you are having trouble with coding it yourself or with github, feel free to [submit an issue](https://github.com/amiaopensource/ffmprovisr/issues) with the kind of command you would like to see added to the site.
|
||||
|
||||
#### General help
|
||||
|
||||
If you want to help but don't have a new script to add, you can help us by testing out the scripts available, by refining or clarifying the documentation, or [creating an issue](https://github.com/amiaopensource/ffmprovisr/issues) for anything that sounds confusing and requires clarification.
|
||||
|
||||
## License
|
||||
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br />This <span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/InteractiveResource" rel="dct:type">work</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://amiaopensource.github.io/ffmprovisr/" property="cc:attributionName" rel="cc:attributionURL">ffmprovisr</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.<br />Based on a work at <a xmlns:dct="http://purl.org/dc/terms/" href="https://github.com/amiaopensource/ffmprovisr" rel="dct:source">https://github.com/amiaopensource/ffmprovisr</a>.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
You can read our contributor code of conduct [here](https://github.com/amiaopensource/ffmprovisr/blob/gh-pages/code_of_conduct.md).
|
||||
|
||||
## Maintainers
|
||||
|
||||
[Ashley Blewer](https://github.com/ablwr), [Katherine Frances Nagels](https://github.com/kfrn), [Kieran O'Leary](https://github.com/kieranjol) and [Reto Kromer](https://github.com/retokromer)
|
||||
|
||||
## Contributors
|
||||
* Gathered using [octohatrack](https://github.com/LABHR/octohatrack)
|
||||
|
||||
GitHub Contributors:
|
||||
*GitHub Contributors*:
|
||||
ablwr (Ashley)
|
||||
dericed (Dave Rice)
|
||||
edsu (Ed Summers)
|
||||
@@ -40,39 +58,50 @@ kfrn (Katherine Frances Nagels)
|
||||
kgrons (Kathryn Gronsbell)
|
||||
kieranjol (Kieran O'Leary)
|
||||
llogan (Lou)
|
||||
pjotrek-b (Peter B.)
|
||||
privatezero (Andrew Weaver)
|
||||
retokromer (Reto Kromer)
|
||||
rfraimow
|
||||
|
||||
All Contributors:
|
||||
|
||||
*All Contributors*:
|
||||
ablwr (Ashley)
|
||||
audiovisualopen
|
||||
brainwane (Sumana Harihareswara)
|
||||
bturkus
|
||||
dericed (Dave Rice)
|
||||
edsu (Ed Summers)
|
||||
Fizz24
|
||||
jamessam (Jim)
|
||||
jamessam (Jim Sam)
|
||||
jfarbowitz (Jonathan Farbowitz)
|
||||
jronallo (Jason Ronallo)
|
||||
kellyhaydon (metacynic)
|
||||
kfrn (Katherine Frances Nagels)
|
||||
kgrons (Kathryn Gronsbell)
|
||||
kieranjol (Kieran O'Leary)
|
||||
llogan (Lou)
|
||||
mulvya
|
||||
pjotrek-b (Peter B.)
|
||||
privatezero (Andrew Weaver)
|
||||
retokromer (Reto Kromer)
|
||||
rfraimow
|
||||
richardpl (Paul B Mahol)
|
||||
todrobbins (Tod Robbins)
|
||||
|
||||
|
||||
Repo: amiaopensource/ffmprovisr
|
||||
GitHub Contributors: 11
|
||||
All Contributors: 18
|
||||
GitHub Contributors: 12
|
||||
All Contributors: 22
|
||||
|
||||
## AVHack Team:
|
||||
## AVHack Team
|
||||
|
||||
[Ashley Blewer](https://github.com/ablwr), Eddy Colloton, Rebecca Dillmeier, [Jonathan Farbowitz](https://github.com/jfarbowitz), Rebecca Fraimow, Samuel Gutterman, Kelly Haydon, [Reto Kromer](https://github.com/retokromer), Nicole Martin, [Katherine Frances Nagels](https://github.com/kfrn), [Kieran O'Leary](https://github.com/kieranjol), Catriona Schlosser, Ben Turkus
|
||||
[Association of Moving Image Archivists & Digital Library Federation Hack Day 2015](http://wiki.curatecamp.org/index.php/Association_of_Moving_Image_Archivists_%26_Digital_Library_Federation_Hack_Day_2015)
|
||||
|
||||
[Ashley Blewer](https://github.com/ablwr), [Eddy Colloton](https://github.com/eddycolloton), Rebecca Dillmeier, [Jonathan Farbowitz](https://github.com/jfarbowitz), [Rebecca Fraimow](https://github.com/rfraimow), Samuel Gutterman, [Kelly Haydon](https://github.com/kellyhaydon), [Reto Kromer](https://github.com/retokromer), Nicole Martin, [Katherine Frances Nagels](https://github.com/kfrn), [Kieran O'Leary](https://github.com/kieranjol), Catriona Schlosser, [Ben Turkus](https://github.com/bturkus)
|
||||
|
||||
## Sister projects
|
||||
|
||||
[Script Ahoy](http://dd388.github.io/crals/): Community Resource for Archivists and Librarians Scripting
|
||||
[sourcecaster](https://datapraxis.github.io/sourcecaster/): helps you use the command line to work through common challenges that come up when working with digital primary sources.
|
||||
|
||||
## License
|
||||
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br />This <span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/InteractiveResource" rel="dct:type">work</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://amiaopensource.github.io/ffmprovisr/" property="cc:attributionName" rel="cc:attributionURL">ffmprovisr</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.<br />Based on a work at <a xmlns:dct="http://purl.org/dc/terms/" href="https://github.com/amiaopensource/ffmprovisr" rel="dct:source">https://github.com/amiaopensource/ffmprovisr</a>.
|
||||
|
23
check_framemd5.sh → scripts/check_audio_framemd5.sh
Normal file → Executable file
23
check_framemd5.sh → scripts/check_audio_framemd5.sh
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
SCRIPT=$(basename "${0}")
|
||||
VERSION='2016-12-31'
|
||||
VERSION='2017-04-17'
|
||||
AUTHOR='ffmprovisr'
|
||||
RED='\033[1;31m'
|
||||
BLUE='\033[1;34m'
|
||||
@@ -13,7 +13,7 @@ fi
|
||||
|
||||
_output_prompt(){
|
||||
cat <<EOF
|
||||
Usage: ${SCRIPT} [-h] | [ -i <av_file> -m <md5_file> ]
|
||||
Usage: ${SCRIPT} -h | -i <av_file> -m <md5_file>
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
@@ -32,7 +32,7 @@ Dependency:
|
||||
ffmpeg
|
||||
About:
|
||||
Version: ${VERSION}
|
||||
Website: https://github.com/amiaopensource/ffmprovisr/blob/gh-pages/check_framemd5.sh
|
||||
Website: https://github.com/amiaopensource/ffmprovisr/blob/gh-pages/scripts/check_audio_framemd5.sh
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
@@ -54,21 +54,24 @@ done
|
||||
echo -e "${BLUE}Please wait...${NC}"
|
||||
unset md5_tmp
|
||||
if [[ $OSTYPE = "cygwin" ]]; then
|
||||
md5_tmp=""${USERPROFILE}/$(basename ${input_hash}).tmp""
|
||||
md5_tmp="${USERPROFILE}/$(basename "${input_hash}").tmp"
|
||||
else
|
||||
md5_tmp="${HOME}/$(basename ${input_hash}).tmp"
|
||||
md5_tmp="${HOME}/$(basename "${input_hash}").tmp"
|
||||
fi
|
||||
$(ffmpeg -i ${input_file} -loglevel 0 -f framemd5 -an ${md5_tmp})
|
||||
# Find audio frame size for hash calculation
|
||||
sample_rate=$(grep -v '^#' "${input_hash}" | head -n 1 | tr -d ' ' | cut -d',' -f4)
|
||||
ffmpeg -i "${input_file}" -loglevel 0 -af "asetnsamples=n='$sample_rate'" -f framemd5 -vn "${md5_tmp}"
|
||||
[[ ! -f ${md5_tmp} ]] && { echo -e "${RED}Error: '${input_file}' is not a valid audio-visual file.${NC}" ; _output_prompt ; }
|
||||
unset old_file
|
||||
unset tmp_file
|
||||
old_file=$(grep -v '^#' ${input_hash})
|
||||
tmp_file=$(grep -v '^#' ${md5_tmp})
|
||||
unset sample_rate
|
||||
old_file=$(grep -v '^#' "${input_hash}")
|
||||
tmp_file=$(grep -v '^#' "${md5_tmp}")
|
||||
if [[ "${old_file}" = "${tmp_file}" ]]; then
|
||||
echo -e "${BLUE}'$(basename ${input_file})' matches '$(basename ${input_hash})'${NC}"
|
||||
echo -e "${BLUE}'$(basename "${input_file}")' matches '$(basename "${input_hash}")'${NC}"
|
||||
rm "${md5_tmp}"
|
||||
else
|
||||
echo -e "${RED}The following differences were detected between '$(basename ${input_file})' and '$(basename ${input_hash})':${NC}"
|
||||
echo -e "${RED}The following differences were detected between '$(basename "${input_file}")' and '$(basename "${input_hash}")':${NC}"
|
||||
diff "${input_hash}" "${md5_tmp}"
|
||||
rm "${md5_tmp}"
|
||||
fi
|
74
scripts/check_video_framemd5.sh
Normal file
74
scripts/check_video_framemd5.sh
Normal file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
SCRIPT=$(basename "${0}")
|
||||
VERSION='2017-04-17'
|
||||
AUTHOR='ffmprovisr'
|
||||
RED='\033[1;31m'
|
||||
BLUE='\033[1;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
if [[ ${OSTYPE} = "cygwin" ]] || [ ! $(which diff) ]; then
|
||||
echo -e "${RED}Error: 'diff' is not installed by default. Please install 'diffutils' from Cygwin.${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
_output_prompt(){
|
||||
cat <<EOF
|
||||
Usage: ${SCRIPT} -h | -i <av_file> -m <md5_file>
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
_output_help(){
|
||||
cat <<EOF
|
||||
Syntax:
|
||||
${SCRIPT}
|
||||
Prompts a short help message.
|
||||
${SCRIPT} -h
|
||||
This help.
|
||||
${SCRIPT} -i <av_file> -m <md5_file>
|
||||
Pass to the script the audio-visual file and the corresponding MD5
|
||||
file to check.
|
||||
Dependency:
|
||||
ffmpeg
|
||||
About:
|
||||
Version: ${VERSION}
|
||||
Website: https://github.com/amiaopensource/ffmprovisr/blob/gh-pages/scripts/check_video_framemd5.sh
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
|
||||
unset input_file
|
||||
unset input_hash
|
||||
|
||||
while getopts ":hi:m:" opt; do
|
||||
case "${opt}" in
|
||||
h) _output_help ;;
|
||||
i) input_file=$OPTARG ;;
|
||||
m) input_hash=$OPTARG ;;
|
||||
:) echo -e "${RED}Error: option -${OPTARG} requires an argument${NC}" ; _output_prompt ;;
|
||||
*) echo -e "${RED}Error: bad option -${OPTARG}${NC}" ; _output_prompt ;;
|
||||
esac
|
||||
done
|
||||
|
||||
[[ -z "${#}" || ! ${input_file} || ! ${input_hash} ]] && _output_prompt
|
||||
echo -e "${BLUE}Please wait...${NC}"
|
||||
unset md5_tmp
|
||||
if [[ $OSTYPE = "cygwin" ]]; then
|
||||
md5_tmp="${USERPROFILE}/$(basename "${input_hash}").tmp"
|
||||
else
|
||||
md5_tmp="${HOME}/$(basename "${input_hash}").tmp"
|
||||
fi
|
||||
ffmpeg -i "${input_file}" -loglevel 0 -f framemd5 -an "${md5_tmp}"
|
||||
[[ ! -f "${md5_tmp}" ]] && { echo -e "${RED}Error: '${input_file}' is not a valid audio-visual file.${NC}" ; _output_prompt ; }
|
||||
unset old_file
|
||||
unset tmp_file
|
||||
old_file=$(grep -v '^#' "${input_hash}")
|
||||
tmp_file=$(grep -v '^#' "${md5_tmp}")
|
||||
if [[ "${old_file}" = "${tmp_file}" ]]; then
|
||||
echo -e "${BLUE}'$(basename "${input_file}")' matches '$(basename "${input_hash}")'${NC}"
|
||||
rm "${md5_tmp}"
|
||||
else
|
||||
echo -e "${RED}The following differences were detected between '$(basename "${input_file}")' and '$(basename "${input_hash}")':${NC}"
|
||||
diff "${input_hash}" "${md5_tmp}"
|
||||
rm "${md5_tmp}"
|
||||
fi
|
26
scripts/ffmprovisr
Executable file
26
scripts/ffmprovisr
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This allows to open ffmprovisr locally from the terminal.
|
||||
|
||||
if [[ ${OSTYPE} = "darwin"* ]] ; then
|
||||
default_browser=$(plutil -convert json ~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist -r -o - | grep https -b1 | tail -n1 | cut -d'"' -f4)
|
||||
if [ -d /usr/local/Cellar/ffmprovisr ] ; then
|
||||
ffmprovisr_path=$(find /usr/local/Cellar/ffmprovisr -iname 'index.html' | sort -M | tail -n1)
|
||||
fi
|
||||
if [ -z "${ffmprovisr_path}" ] ; then
|
||||
ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/'
|
||||
fi
|
||||
if [ -n "${default_browser}" ] ; then
|
||||
open -b "${default_browser}" "${ffmprovisr_path}"
|
||||
else
|
||||
open "${ffmprovisr_path}"
|
||||
fi
|
||||
elif [[ ${OSTYPE} = "linux-gnu" ]] ; then
|
||||
if [ -d ~/.linuxbrew/Cellar/ffmprovisr ] ; then
|
||||
ffmprovisr_path=$(find ~/.linuxbrew/Cellar/ffmprovisr -iname 'index.html' | sort -M | tail -n1)
|
||||
fi
|
||||
if [ -z "${ffmprovisr_path}" ] ; then
|
||||
ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/'
|
||||
fi
|
||||
xdg-open "${ffmprovisr_path}"
|
||||
fi
|
Reference in New Issue
Block a user