<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>
<p>This is all about info! This is all about info! This is all about info! This is all about info! This is all about info! This is all about info! This is all about info! This is all about info! This is all about info! This is all about info! This is all about info! This is all about info! This is all about info! This is all about info!</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>
<spandata-toggle="modal"data-target=".create_gif"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Create a GIF from a video">Create GIF</button></span>
<dt>-i <i>input file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-ss <i>HH:MM:SS</i></dt><dd>starting point of the gif</dd>
<dt>-t <i>3</i></dt><dd>number of seconds after the starting point repeated in the gif (here 3; can be specified also with a full timestamp, i.e. here 00:00:03)</dd>
<dt><i>output file</i></dt><dd>path, name and extension of the output file</dd>
<spandata-toggle="modal"data-target=".wav_to_mp3"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Converts WAV to MP3">WAV to MP3</button></span>
<dt>-i <i>input file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-sample_fmt <i>s16p</i></dt><dd>sample format. This will give you 16 bit audio (To see a list of supported sample formats, type: <code>ffmpeg -sample_fmts</code>)</dd>
<dt>-ar <i>44100</i></dt><dd>Sets the audio sampling frequency to 44.1 kHz (CD quality).</dd>
<dt><i>output file</i></dt><dd>path, name and extension of the output file</dd>
<spandata-toggle="modal"data-target=".batch_processing"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="FFMPEG batch processing within a single folder">Batch processing</button></span>
<p>Re-wrap .MFX files in a specified directory to .mov files by using this code within a .sh file. The shell script (.sh file) and all MXF files must be contained in the same directory, and the script must be run from the directory itself (cd ~/Desktop/MXF_file_directory). Execute .sh file with the command <code>sh Rewrap-MXF.sh</code></p>
<spandata-toggle="modal"data-target=".create_frame_md5s"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="This will create an md5 checksum per frame">Create frame md5s</button></span>
<spandata-toggle="modal"data-target=".to_prores"><buttontype="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>
<p>This command transcodes an input file (input.mov) into a deinterlaced Apple ProRes LT .mov file with 16-bit linear PCM encoded audio. The file is deinterlaced using the yadif (Yet Another De-Interlacing Filter) command.</p>
<spandata-toggle="modal"data-target=".one_thumbnail"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Export one thumbnail per video file">One thumbnail</button></span>
<spandata-toggle="modal"data-target=".multi_thumbnail"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Export many thumbnails per video file">Many thumbnails</button></span>
<dt>-i <i>input file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-ss <i>00:00:20</i></dt><dd>seeks video file to 20 seconds into the video</dd>
<dt>-f image2</dt><dd>Forces the file format. image2 is an image file demuxer.</dd>
<dt>-vf fps=fps=1/60</dt><dd>-vf is an alias for -filter:v, which creates a filtergraph to use for the streams. The rest of the command identifies filtering by frames per second, and sets the frames per second at 1/60 (which is one per minute).</dd>
<dt><i>output file</i></dt><dd>path, name and extension of the output file. In the example out%d.png where %d is a regular expression that adds a number (d is for digit) and increments with each frame (out1.png, out2.png, out3.png…).</dd>
<spandata-toggle="modal"data-target=".thumbnails"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Generate thumbnails from a video at regular intervals">Generate thumbnails</button></span>
<spandata-toggle="modal"data-target=".pull_specs"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Pull specs from video file">Pull specs</button></span>
<p>ffmpeg documentation on ffprobe (full list of flags, commands, <ahref="https://www.ffmpeg.org/ffprobe.html"target="_blank">www.ffmpeg.org/ffprobe.html</a>) </p>
<dl>
<dt>ffprobe</dt><dd>starts the command</dd>
<dt>-i <i>input_file</i></dt><dd>path, name and extension of the input file</dd>
<spandata-toggle="modal"data-target=".join_files"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Join (concatenate) two or more files into a single file">Join files together</button></span>
<p>This command takes two or more files of the same file type and joins them together to make a single file. All that the program needs is a text file with a list specifying the files that should be joined. However, it only works properly if the files to be combined have the exact same codec and technical specifications. Be careful, ffmpeg may appear to have successfully joined two video files with different codecs, but may only bring over the audio from the second file or have other weird behaviors. Don’t use this command for joining files with different codecs and technical specs and always preview your resulting video file!</p>
<p>ffmpeg documentation on concatenating files (full list of flags, commands, <ahref="https://trac.ffmpeg.org/wiki/Concatenate">https://trac.ffmpeg.org/wiki/Concatenate</a>) </p>
<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. This text file contains the list of files to be concatenated and should be formatted as follows:
<spandata-toggle="modal"data-target=".excerpt_from_start"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Create an excerpt, starting from the beginning of the file">Excerpt from beginning</button></span>
<p>This command captures a certain portion of a video file, starting from the beginning and continuing for the amount of time (in seconds) specified in the script. This can be used to create a preview file, or to remove unwanted content from the end of the file. To be more specific, use timecode, such as 00:00:05.</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>-t <i>5</i></dt><dd>Tells ffmpeg to stop copying from the input file after a certain time, and specifies the number of seconds after which to stop copying. In this case, 5 seconds is specified.</dd>
<dt>-c:a copy</dt><dd>the audio codec is copied</dd>
<dt>-c:v copy</dt><dd>the video codec is copied</dd>
<dt><i>output_file</i></dt><dd>path, name and extension of the output file</dd>
<spandata-toggle="modal"data-target=".excerpt_from_middle"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Capture five seconds from the middle of a video file">Excerpt from middle</button></span>
<p>This command captures a certain portion of a video file, starting from a designated point in the file and taking an excerpt as long as the amount of time (in seconds) specified in the script. This can be used to create a preview or clip out a desired segment. To be more specific, use timecode, such as 00:00:05.</p>
<dt>-i <i>input_file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-ss <i>5</i></dt><dd>Tells ffmpeg what timecode in the file to look for to start copying, and specifies the number of seconds into the video that ffmpeg should start copying. To be more specific, you can use timecode such as 00:00:05.</dd>
<dt>-t <i>10</i></dt><dd>Tells ffmpeg to stop copying from the input file after a certain time, and specifies the number of seconds after which to stop copying. In this case, 10 seconds is specified.</dd>
<dt>-c:a copy</dt><dd>the audio codec is copied</dd>
<dt>-c:v copy</dt><dd>the video codec is copied</dd>
<dt><i>output_file</i></dt><dd>path, name and extension of the output file</dd>
<spandata-toggle="modal"data-target=".excerpt_to_end"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Create a new video file with the first five seconds trimmed off the original">Excerpt to end</button></span>
<p>This command copies a video file starting from a specified time, removing the first few seconds from the output. This can be used to create an excerpt, or remove unwanted content from the beginning of a video file.</p>
<dt>-i <i>input_file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-ss <i>5</i></dt><dd>Tells ffmpeg what timecode in the file to look for to start copying, and specifies the number of seconds into the video that ffmpeg should start copying. To be more specific, you can use timecode such as 00:00:05.</dd>
<dt>-c:a copy</dt><dd>the audio codec is copied</dd>
<dt>-c:v copy</dt><dd>the video codec is copied</dd>
<dt><i>output_file</i></dt><dd>path, name and extension of the output file</dd>
<spandata-toggle="modal"data-target=".split_audio_video"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Create separate audio and video tracks from an audiovisual file">Split audio and video tracks</button></span>
<p>This command splits the original input file into a video and audio stream. The -map command identifies which streams are mapped to which file. To ensure that you’re mapping the right streams to the right file, run ffprobe before writing the script to identify which stream is 0:0 and which is 0:1.</p>
<spandata-toggle="modal"data-target=".transcode_h264"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Transcode to an H.264 access file">Transcode to H.264</button></span>
<p>This command takes an input file and transcodes it to H.264 with an .mp4 wrapper, keeping the audio the same codec as the original. The libx264 codec defaults to a “medium” preset for compression quality and a CRF of 23. CRF stands for constant rate factor and determines the quality and file size of the resulting H.264 video. A low CRF means high quality and large file size; a high CRF means the opposite.</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 change the video codec of the file to H.264</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>
<dt>-crf <i>18</i></dt><dd>Specifying a lower CRF will make a larger file with better visual quality. 18 is often considered a “visually lossless” compression.</dd>
<p>libx264 also defaults to 4:2:2 chroma subsampling. Some versions of QuickTime can’t read H.264 files in 4:2:2. In order to allow the video to play in all QuickTime players, you can specify 4:2:0 chroma subsampling instead:</p>
<spandata-toggle="modal"data-target=".dcp_to_h264"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Transcode from DCP to an H.264 access file">H.264 from DCP</button></span>
<spandata-toggle="modal"data-target=".create_iso"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Create ISO files for DVD access">Create ISO</button></span>
<p>Create an ISO file that can be used to burn a DVD. Please note, you will have to install dvdauthor. To install dvd author using Homebrew run: <code>brew install dvdauthor</code></p>
<spandata-toggle="modal"data-target=".ntsc_to_h264"><buttontype="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>
<dt>-filter:v</dt><dd>calls an option to apply a filter to the video stream. scale=1440:1080, pad=1920:1080:240:0": does the math! resizes the video frame then pads the area around the 4:3 aspect to complete 16:9. The very same scaling filter also downscales a bigger image size into HD.</dd>
<spandata-toggle="modal"data-target=".SD_HD"><buttontype="button"class="btn btn-default"data-toggle="tooltip"data-placement="bottom"title="Transform 4:3 aspect ratio into 16:9 with pillarbox">4:3 to 16:9</button></span>
<dt>-filter:v "pad=ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"</dt><dd>video padding<br/>This resolution independent formula is actually padding any aspect ratio into 16:9 by pillarboxing, because the video filter uses relative values for input width (iw), input height (ih), output width (ow) and output height (oh).</dd>
<spandata-toggle="modal"data-target=".HD_SD"><buttontype="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>
<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>
<p>Made with ♥ at <ahref="http://wiki.curatecamp.org/index.php/Association_of_Moving_Image_Archivists_%26_Digital_Library_Federation_Hack_Day_2015">AMIA #AVhack15</a>! Contribute to the project via <ahref="https://github.com/amiaopensource/ffmprovisr">our Github page</a>!</p>