From 46fad11207308fc91a767b11b572238fd9df33a7 Mon Sep 17 00:00:00 2001 From: Anushka Raj Date: Thu, 3 Oct 2019 11:22:39 +0530 Subject: [PATCH 1/2] Update index.html --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 85227a8..b809586 100644 --- a/index.html +++ b/index.html @@ -93,7 +93,7 @@
-

Streaming vs. Saving

+
Streaming vs. Saving

FFplay allows you to stream created video and FFmpeg allows you to save video.

The following command creates and saves a 10-second video of SMPTE bars:

ffmpeg -f lavfi -i smptebars=size=640x480 -t 5 output_file

@@ -130,7 +130,7 @@
-

Filtergraphs

+
Filtergraphs

Many FFmpeg commands use filters that manipulate the video or audio stream in some way: for example, hflip to horizontally flip a video, or amerge to merge two or more audio tracks into a single stream.

The use of a filter is signaled by the flag -vf (video filter) or -af (audio filter), followed by the name and options of the filter itself. For example, take the convert colorspace command:

ffmpeg -i input_file -c:v libx264 -vf colormatrix=src:dst output_file @@ -197,7 +197,7 @@

-

Rewrap a file

+
Rewrap a file

ffmpeg -i input_file.ext -c copy -map 0 output_file.ext

This script will rewrap a video file. It will create a new video video file where the inner content (the video, audio, and subtitle data) of the original file is unchanged, but these streams are rehoused within a different container format.

Note: rewrapping is also known as remuxing, short for re-multiplexing.

@@ -221,7 +221,7 @@
-

Rewrap DV video to .dv file

+
Rewrap DV video to .dv file

ffmpeg -i input_file -f rawvideo -c:v copy output_file.dv

This script will take a video that is encoded in the DV Codec but wrapped in a different container (such as MOV) and rewrap it into a raw DV file (with the .dv extension). Since DV files potentially contain a great deal of provenance metadata within the DV stream, it is necessary to rewrap files in this method to avoid unintentional stripping of this metadata.

From 5a1aee1cf2e132d2b5192873619ba73ff10b7ed2 Mon Sep 17 00:00:00 2001 From: Anushka Raj Date: Thu, 3 Oct 2019 11:43:42 +0530 Subject: [PATCH 2/2] Update index.html --- index.html | 204 ++++++++++++++++++++++++++--------------------------- 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/index.html b/index.html index b809586..fdb71ce 100644 --- a/index.html +++ b/index.html @@ -243,7 +243,7 @@
-

Transcode into a deinterlaced Apple ProRes LT

+
Transcode into a deinterlaced Apple ProRes LT

ffmpeg -i input_file -c:v prores -profile:v 1 -vf yadif -c:a pcm_s16le output_file.mov

This command transcodes an input file into a deinterlaced Apple ProRes 422 LT file with 16-bit linear PCM encoded audio. The file is deinterlaced using the yadif filter (Yet Another De-Interlacing Filter).

@@ -275,7 +275,7 @@
-

Transcode to H.264

+
Transcode to H.264

ffmpeg -i input_file -c:v libx264 -pix_fmt yuv420p -c:a aac output_file

This command takes an input file and transcodes it to H.264 with an .mp4 wrapper, audio is transcoded to AAC. 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.

@@ -309,7 +309,7 @@
-

H.264 from DCP

+
H.264 from DCP

ffmpeg -i input_video_file.mxf -i input_audio_file.mxf -c:v libx264 -pix_fmt yuv420p -c:a aac output_file.mp4

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.

@@ -336,7 +336,7 @@
-

Create FFV1 Version 3 video in a Matroska container with framemd5 of input

+
Create FFV1 Version 3 video in a Matroska container with framemd5 of input

ffmpeg -i input_file -map 0 -dn -c:v ffv1 -level 3 -g 1 -slicecrc 1 -slices 16 -c:a copy output_file.mkv -f framemd5 -an framemd5_output_file

This will losslessly transcode your video with the FFV1 Version 3 codec in a Matroska container. In order to verify losslessness, a framemd5 of the source video is also generated. For more information on FFV1 encoding, try the FFmpeg wiki.

@@ -363,7 +363,7 @@
-

Convert DVD to H.264

+
Convert DVD to H.264

ffmpeg -i concat:input_file_1\|input_file_2\|input_file_3 -c:v libx264 -c:a aac output_file.mp4

This command allows you to create an H.264 file from a DVD source that is not copy-protected.

Before encoding, you’ll need to establish which of the .VOB files on the DVD or .iso contain the content that you wish to encode. Inside the VIDEO_TS directory, you will see a series of files with names like VTS_01_0.VOB, VTS_01_1.VOB, etc. Some of the .VOB files will contain menus, special features, etc, so locate the ones that contain target content by playing them back in VLC.

@@ -397,7 +397,7 @@
-

Transcode to H.265/HEVC

+
Transcode to H.265/HEVC

ffmpeg -i input_file -c:v libx265 -pix_fmt yuv420p -c:a copy output_file

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.

Note: FFmpeg must be compiled with libx265, the library of the H.265 codec, for this script to work. (Add the flag --with-x265 if using the brew install ffmpeg method).

@@ -425,7 +425,7 @@
-

Transcode to Ogg/Theora

+
Transcode to Ogg/Theora

ffmpeg -i input_file -acodec libvorbis -b:v 690k output_file

This command takes an input file and transcodes it to Ogg/Theora in an .ogv wrapper with 690k video bitrate.

Note: FFmpeg must be installed with support for Ogg Theora. If you are using Homebrew, you can check with brew info ffmpeg and then update it with brew upgrade ffmpeg --with-theora --with-libvorbis if necessary.

@@ -448,7 +448,7 @@
-

WAV to MP3

+
WAV to MP3

ffmpeg -i input_file.wav -write_id3v1 1 -id3v2_version 3 -dither_method rectangular -out_sample_rate 48k -qscale:a 1 output_file.mp3

This will convert your WAV files to MP3s.

@@ -474,7 +474,7 @@
-

Generate two access MP3s from input. One with appended audio (such as a copyright notice) and one unmodified.

+
Generate two access MP3s from input. One with appended audio (such as a copyright notice) and one unmodified.

ffmpeg -i input_file -i input_file_to_append -filter_complex "[0:a:0]asplit=2[a][b];[b]afifo[bb];[1:a:0][bb]concat=n=2:v=0:a=1[concatout]" -map "[a]" -codec:a libmp3lame -dither_method modified_e_weighted -qscale:a 2 output_file.mp3 -map "[concatout]" -codec:a libmp3lame -dither_method modified_e_weighted -qscale:a 2 output_file_appended.mp3

This script allows you to generate two derivative audio files from a master while appending audio from a separate file (for example a copyright or institutional notice) to one of them.

@@ -500,7 +500,7 @@
-

WAV to AAC/MP4

+
WAV to AAC/MP4

ffmpeg -i input_file.wav -c:a aac -b:a 128k -dither_method rectangular -ar 44100 output_file.mp4

This will convert your WAV file to AAC/MP4.

@@ -525,7 +525,7 @@
-

Transform 4:3 aspect ratio into 16:9 with pillarbox

+
Transform 4:3 aspect ratio into 16:9 with pillarbox

Transform a video file with 4:3 aspect ratio into a video file with 16:9 aspect ratio by correct pillarboxing.

ffmpeg -i input_file -filter:v "pad=ih*16/9:ih:(ow-iw)/2:(oh-ih)/2" -c:a copy output_file

@@ -544,7 +544,7 @@
-

Transform 16:9 aspect ratio video into 4:3 with letterbox

+
Transform 16:9 aspect ratio video into 4:3 with letterbox

Transform a video file with 16:9 aspect ratio into a video file with 4:3 aspect ratio by correct letterboxing.

ffmpeg -i input_file -filter:v "pad=iw:iw*3/4:(ow-iw)/2:(oh-ih)/2" -c:a copy output_file

@@ -564,7 +564,7 @@
-

Flip the video image horizontally and/or vertically

+
Flip the video image horizontally and/or vertically

ffmpeg -i input_file -filter:v "hflip,vflip" -c:a copy output_file

ffmpeg
starts the command
@@ -582,7 +582,7 @@
-

Transform SD into HD with pillarbox

+
Transform SD into HD with pillarbox

Transform a SD video file with 4:3 aspect ratio into an HD video file with 16:9 aspect ratio by correct pillarboxing.

ffmpeg -i input_file -filter:v "colormatrix=bt601:bt709, scale=1440:1080:flags=lanczos, pad=1920:1080:240:0" -c:a copy output_file

@@ -606,7 +606,7 @@
-

Change Display Aspect Ratio without re-encoding video

+
Change Display Aspect Ratio without re-encoding video

ffmpeg -i input_file -c:v copy -aspect 4:3 output_file

ffmpeg
starts the command
@@ -623,7 +623,7 @@
-

Transcode video to a different colorspace

+
Transcode video to a different colorspace

This command uses a filter to convert the video to a different colorspace.

ffmpeg -i input_file -c:v libx264 -vf colormatrix=src:dst output_file

@@ -676,7 +676,7 @@
-

Modify image and sound speed

+
Modify image and sound speed

E.g. for converting 24fps to 25fps with audio pitch compensation for PAL access copies. (Thanks @kieranjol!)

ffmpeg -i input_file -r output_fps -filter_complex "[0:v]setpts=input_fps/output_fps*PTS[v]; [0:a]atempo=output_fps/input_fps[a]" -map "[v]" -map "[a]" output_file

@@ -701,7 +701,7 @@
-

Synchronize video and audio streams

+
Synchronize video and audio streams

ffmpeg -i input_file -itsoffset 0.125 -i input_file -map 1:v -map 0:a -c copy output_file

A command to slip the video channel approximate 2 frames (0.125 for a 25fps timeline) to align video and audio drift, if generated during video tape capture for example.

@@ -721,7 +721,7 @@
-

Set stream properties

+
Set stream properties

Find undetermined or unknown stream properties

These examples use QuickTime inputs and outputs. The strategy will vary or may not be possible in other file formats. In the case of these examples it is the intention to make a lossless copy while clarifying an unknown characteristic of the stream.

ffprobe input_file -show_streams

@@ -758,7 +758,7 @@
-

Crop video

+
Crop video

ffmpeg -i input_file -vf "crop=width:height" output_file

This command crops the input video to the dimensions defined

@@ -788,7 +788,7 @@
-

Change video color to black and white

+
Change video color to black and white

ffmpeg -i input_file -filter_complex hue=s=0 -c:a copy output_file

A basic command to alter color hue to black and white using filter_complex (credit @FFMPEG via Twitter).

@@ -821,7 +821,7 @@
-

Extract audio from an AV file

+
Extract audio from an AV file

ffmpeg -i input_file -c:a copy -vn output_file

This command extracts the audio stream without loss from an audiovisual file.

@@ -839,7 +839,7 @@
-

Combine audio tracks into one in a video file

+
Combine audio tracks into one in a video file

ffmpeg -i input_file -filter_complex "[0:a:0][0:a:1]amerge[out]" -map 0:v -map "[out]" -c:v copy -shortest output_file

This command combines two audio tracks present in a video file into one stream. It can be useful in situations where a downstream process, like YouTube’s automatic captioning, expect one audio track. To ensure that you’re mapping the right audio tracks run ffprobe before writing the script to identify which tracks are desired. More than two audio streams can be combined by extending the pattern present in the -filter_complex option.

@@ -863,7 +863,7 @@
-

Flip audio phase shift

+
Flip audio phase shift

ffmpeg -i input_file -af pan="stereo|c0=c0|c1=-1*c1" output_file

This command inverses the audio phase of the second channel by rotating it 180°.

@@ -882,7 +882,7 @@
-

Calculate Loudness Levels

+
Calculate Loudness Levels

ffmpeg -i input_file -af loudnorm=print_format=json -f null -

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.

These instructions use the loudnorm defaults, which align well with PBS recommendations for target loudness. More information can be found at the loudnorm documentation.

@@ -902,7 +902,7 @@
-

RIAA Equalization

+
RIAA Equalization

ffmpeg -i input_file -af aemphasis=type=riaa output_file

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 Wikipedia page on the subject.

@@ -919,7 +919,7 @@
-

Reverse CD Pre-Emphasis

+
Reverse CD Pre-Emphasis

ffmpeg -i input_file -af aemphasis=type=cd output_file

This will apply de-emphasis to reverse the effects of CD pre-emphasis in the somewhat rare case of CDs that were created with this technology. Use this command to create more accurate listening copies of files that were ripped 'flat' (without any de-emphasis) where the original source utilized emphasis. For more information about CD pre-emphasis see the Hydrogen Audio page on this subject.

@@ -936,7 +936,7 @@
-

One Pass Loudness Normalization

+
One Pass Loudness Normalization

ffmpeg -i input_file -af loudnorm=dual_mono=true -ar 48k output_file

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 loudnorm documentation.

Information about PBS loudness standards can be found in the PBS Technical Operating Specifications document. Information about EBU loudness standards can be found in the EBU R 128 recommendation document.

@@ -956,7 +956,7 @@
-

Two Pass Loudness Normalization

+
Two Pass Loudness Normalization

ffmpeg -i input_file -af loudnorm=dual_mono=true:measured_I=input_i:measured_TP=input_tp:measured_LRA=input_lra:measured_thresh=input_thresh:offset=target_offset:linear=true -ar 48k output_file

This command allows using the levels calculated using a first pass of the loudnorm filter 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 loudnorm documentation.

Information about PBS loudness standards can be found in the PBS Technical Operating Specifications document. Information about EBU loudness standards can be found in the EBU R 128 recommendation document.

@@ -982,7 +982,7 @@
-

Fix AV Sync: Resample audio

+
Fix AV Sync: Resample audio

ffmpeg -i input_file -c:v copy -c:a pcm_s16le -af "aresample=async=1000" output_file

ffmpeg
starts the command
@@ -1004,7 +1004,7 @@
-

Join files together

+
Join files together

ffmpeg -f concat -i mylist.txt -c copy output_file

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!

@@ -1031,7 +1031,7 @@
-

Join files together

+
Join files together

ffmpeg -i input_1.avi -i input_2.mp4 -filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[video_out][audio_out]" -map "[video_out]" -map "[audio_out]" output_file

This command takes two or more files of the different file types and joins them together to make a single file.

The input files may differ in many respects - container, codec, chroma subsampling scheme, framerate, etc. However, the above command only works properly if the files to be combined have the same dimensions (e.g., 720x576). Also note that if the input files have different framerates, then the output file will be of variable framerate.

@@ -1090,7 +1090,7 @@
-

Split file into segments

+
Split file into segments

ffmpeg -i input_file -c copy -map 0 -f segment -segment_time 60 -reset_timestamps 1 output_file-%03d.mkv

ffmpeg
Starts the command.
@@ -1121,7 +1121,7 @@
-

Trim a video without re-encoding

+
Trim a video without re-encoding

ffmpeg -i input_file -ss 00:02:00 -to 00:55:00 -c copy -map 0 output_file

This command allows you to create an excerpt from a file without re-encoding the audiovisual data.

@@ -1148,7 +1148,7 @@
-

Excerpt from beginning

+
Excerpt from beginning

ffmpeg -i input_file -t 5 -c copy -map 0 output_file

This command captures a certain portion of a 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.

@@ -1167,7 +1167,7 @@
-

Excerpt to end

+
Excerpt to end

ffmpeg -i input_file -ss 5 -c copy -map 0 output_file

This command copies a 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 file.

@@ -1186,7 +1186,7 @@
-

Excerpt from end

+
Excerpt from end

ffmpeg -sseof -5 -i input_file -c copy -map 0 output_file

This command copies a file starting from a specified time before the end of the file, removing everything before from the output. This can be used to create an excerpt, or extract content from the end of a file (e.g. for extracting the closing credits).

@@ -1205,7 +1205,7 @@
-

Remove silent portion at the beginning of an audio file

+
Remove silent portion at the beginning of an audio file

ffmpeg -i input_file -af silenceremove=start_threshold=-57dB:start_duration=1:start_periods=1 -c:a your_codec_choice -ar your_sample_rate_choice output_file

This command will automatically remove silence at the beginning of an audio file. The threshold for what qualifies as silence can be changed - this example uses anything under -57 dB, which is a decent level for accounting for analogue hiss.

Note: Since this command uses a filter, the audio stream will be re-encoded for the output. If you do not specify a sample rate or codec, this command will use the sample rate from your input and the codec defaults for your output format. Take care that you are getting your intended results!

@@ -1226,7 +1226,7 @@
-

Remove silent portion from the end of an audio file

+
Remove silent portion from the end of an audio file

ffmpeg -i input_file -af areverse,silenceremove=start_threshold=-57dB:start_duration=1:start_periods=1,areverse -c:a your_codec_choice -ar your_sample_rate_choice output_file

This command will automatically remove silence at the end of an audio file. Since the silenceremove filter is best at removing silence from the beginning of files, this command used the areverse filter twice to reverse the input, remove silence and then restore correct orientation.

Note: Since this command uses a filter, the audio stream will be re-encoded for the output. If you do not specify a sample rate or codec, this command will use the sample rate from your input and the codec defaults for your output format. Take care that you are getting your intended results!

@@ -1253,7 +1253,7 @@
-

Upscaled, Pillar-boxed HD H.264 Access Files from SD NTSC source

+
Upscaled, Pillar-boxed HD H.264 Access Files from SD NTSC source

ffmpeg -i input_file -c:v libx264 -filter:v "yadif, scale=1440:1080:flags=lanczos, pad=1920:1080:(ow-iw)/2:(oh-ih)/2, format=yuv420p" output_file

ffmpeg
starts the command
@@ -1278,7 +1278,7 @@
-

Deinterlace a video

+
Deinterlace a video

ffmpeg -i input_file -c:v libx264 -vf "yadif,format=yuv420p" output_file

This command takes an interlaced input file and outputs a deinterlaced H.264 MP4.

@@ -1313,7 +1313,7 @@
-

Inverse telecine a video file

+
Inverse telecine a video file

ffmpeg -i input_file -c:v libx264 -vf "fieldmatch,yadif,decimate" output_file

The inverse telecine procedure reverses the 3:2 pull down process, restoring 29.97fps interlaced video to the 24fps frame rate of the original film source.

@@ -1344,7 +1344,7 @@
-

Change field order of an interlaced video

+
Change field order of an interlaced video

ffmpeg -i input_file -c:v video_codec -filter:v setfield=tff output_file

ffmpeg
starts the command
@@ -1361,7 +1361,7 @@
-

Check video file interlacement patterns

+
Check video file interlacement patterns

ffmpeg -i input file -filter:v idet -f null -

ffmpeg
starts the command
@@ -1382,7 +1382,7 @@
-

Create centered, transparent text watermark

+
Create centered, transparent text watermark

E.g For creating access copies with your institutions name

ffmpeg -i input_file -vf drawtext="fontfile=font_path:fontsize=font_size:text=watermark_text:fontcolor=font_color:alpha=0.4:x=(w-text_w)/2:y=(h-text_h)/2" output_file

@@ -1408,7 +1408,7 @@
-

Overlay image watermark on video

+
Overlay image watermark on video

ffmpeg -i input_video file -i input_image_file -filter_complex overlay=main_w-overlay_w-5:5 output_file

ffmpeg
starts the command
@@ -1425,7 +1425,7 @@
-

Create a burnt in timecode on your image

+
Create a burnt in timecode on your image

ffmpeg -i input_file -vf drawtext="fontfile=font_path:fontsize=font_size:timecode=starting_timecode:fontcolor=font_colour:box=1:boxcolor=box_colour:rate=timecode_rate:x=(w-text_w)/2:y=h/1.2" output_file

ffmpeg
starts the command
@@ -1452,7 +1452,7 @@
-

Embed a subtitle file into a movie file

+
Embed a subtitle file into a movie file

ffmpeg -i input_file -i subtitles_file -c copy -c:s mov_text output_file

ffmpeg
starts the command
@@ -1475,7 +1475,7 @@
-

One thumbnail

+
One thumbnail

ffmpeg -i input_file -ss 00:00:20 -vframes 1 thumb.png

This command will grab a thumbnail 20 seconds into the video.

@@ -1493,7 +1493,7 @@
-

Many thumbnails

+
Many thumbnails

ffmpeg -i input_file -vf fps=1/60 out%d.png

This will grab a thumbnail every minute and output sequential png files.

@@ -1511,7 +1511,7 @@
-

Images to GIF

+
Images to GIF

ffmpeg -f image2 -framerate 9 -pattern_type glob -i "input_image_*.jpg" -vf scale=250x250 output_file.gif

This will convert a series of image files into a GIF.

@@ -1532,7 +1532,7 @@
-

Create GIF

+
Create GIF

Create high quality GIF

ffmpeg -ss HH:MM:SS -i input_file -filter_complex "fps=10,scale=500:-1:flags=lanczos,palettegen" -t 3 palette.png

ffmpeg -ss HH:MM:SS -i input_file -i palette.png -filter_complex "[0:v]fps=10, scale=500:-1:flags=lanczos[v], [v][1:v]paletteuse" -t 3 -loop 6 output_file

@@ -1569,7 +1569,7 @@
-

Transcode an image sequence into uncompressed 10-bit video

+
Transcode an image sequence into uncompressed 10-bit video

ffmpeg -f image2 -framerate 24 -i input_file_%06d.ext -c:v v210 output_file

ffmpeg
starts the command
@@ -1588,7 +1588,7 @@
-

Create a video from an image and audio file.

+
Create a video from an image and audio file.

ffmpeg -r 1 -loop 1 -i image_file -i audio_file -acodec copy -shortest -vf scale=1280:720 output_file

This command will take an image file (e.g. image.jpg) and an audio file (e.g. audio.mp3) and combine them into a video file that contains the audio track with the image used as the video. It can be useful in a situation where you might want to upload an audio file to a platform like YouTube. You may want to adjust the scaling with -vf to suit your needs.

@@ -1614,7 +1614,7 @@
-

Creates a visualization of the bits in an audio stream

+
Creates a visualization of the bits in an audio stream

ffplay -f lavfi "amovie=input_file, asplit=2[out1][a], [a]abitscope=colors=purple|yellow[out0]"

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.

@@ -1637,7 +1637,7 @@
-

Plays a graphical output showing decibel levels of an input file

+
Plays a graphical output showing decibel levels of an input file

ffplay -f lavfi "amovie='input.mp3', astats=metadata=1:reset=1, adrawgraph=lavfi.astats.Overall.Peak_level:max=0:min=-30.0:size=700x256:bg=Black[out]"

ffplay
starts the command
@@ -1666,7 +1666,7 @@
-

Shows all pixels outside of broadcast range

+
Shows all pixels outside of broadcast range

ffplay -f lavfi "movie='input.mp4', signalstats=out=brng:color=cyan[out]"

ffplay
starts the command
@@ -1691,7 +1691,7 @@
-

Plays vectorscope of video

+
Plays vectorscope of video

ffplay input_file -vf "split=2[m][v], [v]vectorscope=b=0.7:m=color3:g=green[v], [m][v]overlay=x=W-w:y=H-h"

ffplay
starts the command
@@ -1713,7 +1713,7 @@
-

This will play two input videos side by side while also applying the temporal difference filter to them

+
This will play two input videos side by side while also applying the temporal difference filter to them

ffmpeg -i input01 -i input02 -filter_complex "[0:v:0]tblend=all_mode=difference128[a];[1:v:0]tblend=all_mode=difference128[b];[a][b]hstack[out]" -map [out] -f nut -c:v rawvideo - | ffplay -

ffmpeg
starts the command
@@ -1743,7 +1743,7 @@
-

This filter enables vertical and horizontal stacking of multiple video sources into one output.

+
This filter enables vertical and horizontal stacking of multiple video sources into one output.

This filter is useful for the creation of output windows such as the one utilized in vrecord.

ffplay -f lavfi -i testsrc -vf "split=3[a][b][c],[a][b][c]xstack=inputs=3:layout=0_0|0_h0|0_h0+h1[out]"

The following example uses the 'testsrc' virtual input combined with the split filter to generate the multiple inputs.

@@ -1770,7 +1770,7 @@
-

Pull specs from video file

+
Pull specs from video file

ffprobe -i input_file -show_format -show_streams -show_data -print_format xml

This command extracts technical metadata from a video file and displays it in xml.

@@ -1790,7 +1790,7 @@
-

Strips metadata from video file

+
Strips metadata from video file

ffmpeg -i input_file -map_metadata -1 -c:v copy -c:a copy output_file

ffmpeg
starts the command
@@ -1813,7 +1813,7 @@
-

Create Bash script to batch process with FFmpeg

+
Create Bash script to batch process with FFmpeg

Bash scripts are plain text files saved with a .sh extension. This entry explains how they work with the example of a bash script named “Rewrap-MXF.sh”, which rewraps .mxf files in a given directory to .mov files.

“Rewrap-MXF.sh” contains the following text:

for file in *.mxf; do ffmpeg -i "$file" -map 0 -c copy "${file%.mxf}.mov"; done

@@ -1843,7 +1843,7 @@
-

Create PowerShell script to batch process with FFmpeg

+
Create PowerShell script to batch process with FFmpeg

As of Windows 10, it is possible to run Bash via Bash on Ubuntu on Windows, allowing you to use bash scripting. To enable Bash on Windows, see these instructions.

On Windows, the primary native command line program is PowerShell. 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.

“rewrap-mp4.ps1” contains the following text:

@@ -1877,7 +1877,7 @@
-

Check decoder errors

+
Check decoder errors

ffmpeg -i input_file -f null -

This decodes your video and prints any errors or found issues to the screen.

@@ -1913,7 +1913,7 @@
-

Create MD5 checksums (video frames)

+
Create MD5 checksums (video frames)

ffmpeg -i input_file -f framemd5 -an output_file

This will create an MD5 checksum per video frame.

@@ -1932,7 +1932,7 @@
-

Create MD5 checksums (audio samples)

+
Create MD5 checksums (audio samples)

ffmpeg -i input_file -af "asetnsamples=n=48000" -f framemd5 -vn output_file

This will create an MD5 checksum for each group of 48000 audio samples.
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).

@@ -1959,7 +1959,7 @@
-

Create stream MD5s

+
Create stream MD5s

ffmpeg -i input_file -map 0:v:0 -c:v copy -f md5 output_file_1 -map 0:a:0 -c:a copy -f md5 output_file_2

This will create MD5 checksums for the first video and the first audio stream in a file. If only one of these is necessary (for example if used on a WAV file) either part of the command can be excluded to create the desired MD5 only. Use of this kind of checksum enables integrity of the A/V information to be verified independently of any changes to surrounding metadata.

@@ -1981,7 +1981,7 @@
-

Get checksum for video/audio stream

+
Get checksum for video/audio stream

ffmpeg -loglevel error -i input_file -map 0:v:0 -f hash -hash md5 -

This script will perform a fixity check on a specified audio or video stream of the file, useful for checking that the content within a video has not changed even if the container format has changed.

@@ -2000,7 +2000,7 @@
-

Creates a QCTools report

+
Creates a QCTools report

ffprobe -f lavfi -i "movie=input_file: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 > input_file.qctools.xml.gz

This will create an XML report for use in QCTools for a video file with one video track and one audio track. See also the QCTools documentation.

@@ -2025,7 +2025,7 @@
-

Creates a QCTools report

+
Creates a QCTools report

ffprobe -f lavfi -i "movie=input_file,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 > input_file.qctools.xml.gz

This will create an XML report for use in QCTools for a video file with one video track and NO audio track. See also the QCTools documentation.

@@ -2050,7 +2050,7 @@
-

Read/Extract EIA-608 (Line 21) closed captioning

+
Read/Extract EIA-608 (Line 21) closed captioning

ffprobe -f lavfi -i movie=input_file,readeia608 -show_entries frame=pkt_pts_time:frame_tags=lavfi.readeia608.0.line,lavfi.readeia608.0.cc,lavfi.readeia608.1.line,lavfi.readeia608.1.cc -of csv > input_file.csv

This command uses FFmpeg's readeia608 filter to extract the hexadecimal values hidden within EIA-608 (Line 21) Closed Captioning, outputting a csv file. For more information about EIA-608, check out Adobe's Introduction to Closed Captions.

If hex isn't your thing, closed captioning character and code sets can be found in the documentation for SCTools.

@@ -2079,7 +2079,7 @@
-

Makes a mandelbrot test pattern video

+
Makes a mandelbrot test pattern video

ffmpeg -f lavfi -i mandelbrot=size=1280x720:rate=25 -c:v libx264 -t 10 output_file

ffmpeg
starts the command
@@ -2115,7 +2115,7 @@
-

Make a test pattern video

+
Make a test pattern video

ffmpeg -f lavfi -i testsrc=size=720x576:rate=25 -c:v v210 -t 10 output_file

ffmpeg
starts the command
@@ -2134,7 +2134,7 @@
-

Play HD SMPTE bars

+
Play HD SMPTE bars

Test an HD video projector by playing the SMPTE color bars pattern.

ffplay -f lavfi -i smptehdbars=size=1920x1080

@@ -2150,7 +2150,7 @@
-

Play VGA SMPTE bars

+
Play VGA SMPTE bars

Test a VGA (SD) video projector by playing the SMPTE color bars pattern.

ffplay -f lavfi -i smptebars=size=640x480

@@ -2166,7 +2166,7 @@
-

Sine wave

+
Sine wave

Generate a test audio file playing a sine wave.

ffmpeg -f lavfi -i "sine=frequency=1000:sample_rate=48000:duration=5" -c:a pcm_s16le output_file.wav

@@ -2184,7 +2184,7 @@
-

SMPTE bars + Sine wave audio

+
SMPTE bars + Sine wave audio

Generate a SMPTE bars test video + a 1kHz sine wave as audio testsignal.

ffmpeg -f lavfi -i "smptebars=size=720x576:rate=25" -f lavfi -i "sine=frequency=1000:sample_rate=48000" -c:a pcm_s16le -t 10 -c:v ffv1 output_file

@@ -2206,7 +2206,7 @@
-

Makes a broken test file

+
Makes a broken test file

Modifies an existing, functioning file and intentionally breaks it for testing purposes.

ffmpeg -i input_file -bsf noise=1 -c copy output_file

@@ -2224,7 +2224,7 @@
-

Conway's Game of Life

+
Conway's Game of Life

Simulates Conway's Game of Life

ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#c83232:life_color=#00ff00,scale=1200:800

@@ -2253,7 +2253,7 @@
-

Plays video with OCR on top

+
Plays video with OCR on top

Note: ffmpeg must be compiled with the tesseract library for this script to work (--with-tesseract if using the brew install ffmpeg method).

ffplay input_file -vf "ocr,drawtext=fontfile=/Library/Fonts/Andale Mono.ttf:text=%{metadata\\\:lavfi.ocr.text}:fontcolor=white"

@@ -2277,7 +2277,7 @@
-

Exports OCR data to screen

+
Exports OCR data to screen

Note: FFmpeg must be compiled with the tesseract library for this script to work (--with-tesseract if using the brew install ffmpeg method)

ffprobe -show_entries frame_tags=lavfi.ocr.text -f lavfi -i "movie=input_file,ocr"

@@ -2299,7 +2299,7 @@
-

Compare two video files for content similarity using perceptual hashing

+
Compare two video files for content similarity using perceptual hashing

ffmpeg -i input_one -i input_two -filter_complex signature=detectmode=full:nb_inputs=2 -f null -

ffmpeg
starts the command
@@ -2317,7 +2317,7 @@
-

Generate a perceptual hash for an input video file

+
Generate a perceptual hash for an input video file

ffmpeg -i input -vf signature=format=xml:filename="output.xml" -an -f null -

ffmpeg -i input
starts the command using your input file
@@ -2338,7 +2338,7 @@
-

Play an image sequence

+
Play an image sequence

Play an image sequence directly as moving images, without having to create a video first.

ffplay -framerate 5 input_file_%06d.ext

@@ -2360,7 +2360,7 @@
-

Split audio and video tracks

+
Split audio and video tracks

ffmpeg -i input_file -map 0:v:0 video_output_file -map 0:a:0 audio_output_file

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 streams are desired.

@@ -2403,7 +2403,7 @@
-

Create ISO files for DVD access

+
Create ISO files for DVD access

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: brew install dvdauthor

ffmpeg -i input_file -aspect 4:3 -target ntsc-dvd output_file.mpg

This command will take any file and create an MPEG file that dvdauthor can use to create an ISO.

@@ -2422,7 +2422,7 @@
-

Exports CSV for scene detection using YDIF

+
Exports CSV for scene detection using YDIF

ffprobe -f lavfi -i movie=input_file,signalstats -show_entries frame=pkt_pts_time:frame_tags=lavfi.signalstats.YDIF -of csv

This ffprobe command prints a CSV correlating timestamps and their YDIF values, useful for determining cuts.

@@ -2443,7 +2443,7 @@
-

Cover head switching noise

+
Cover head switching noise

ffmpeg -i input_file -filter:v drawbox=w=iw:h=7:y=ih-h:t=max output_file

This command will draw a black box over a small area of the bottom of the frame, which can be used to cover up head switching noise.

@@ -2468,7 +2468,7 @@
-

Record and live-stream simultaneously

+
Record and live-stream simultaneously

ffmpeg -re -i ${INPUTFILE} -map 0 -flags +global_header -vf scale="1280:-1,format=yuv420p" -pix_fmt yuv420p -level 3.1 -vsync passthrough -crf 26 -g 50 -bufsize 3500k -maxrate 1800k -c:v libx264 -c:a aac -b:a 128000 -r:a 44100 -ac 2 -t ${STREAMDURATION} -f tee "[movflags=+faststart]${TARGETFILE}|[f=flv]${STREAMTARGET}"

I use this script to stream to a RTMP target and record the stream locally as .mp4 with only one ffmpeg-instance.

As input, I use bmdcapture which is piped to ffmpeg. But it can also be used with a static videofile as input.

@@ -2509,7 +2509,7 @@
-

View information about a specific decoder, encoder, demuxer, muxer, or filter

+
View information about a specific decoder, encoder, demuxer, muxer, or filter

ffmpeg -h type=name

ffmpeg
starts the command
@@ -2543,7 +2543,7 @@
-

Find Drive Offset for Exact CD Ripping

+
Find Drive Offset for Exact CD Ripping

If you want to make CD rips that can be verified via checksums to other rips of the same content, you need to know the offset of your CD drive. Put simply, different models of CD drives have different offsets, meaning they start reading in slightly different locations. This must be compensated for in order for files created on different (model) drives to generate the same checksum. For a more detailed explanation of drive offsets see the explanation here. In order to find your drive offset, first you will need to know exactly what model your drive is, then you can look it up in the list of drive offsets by Accurate Rip.

Often it can be difficult to tell what model your drive is simply by looking at it - it may be housed inside your computer or have external branding that is different from the actual drive manufacturer. For this reason, it can be useful to query your drive with CD ripping software in order to ID it. The following commands should give you a better idea of what drive you have.

Cdda2wav: cdda2wav -scanbus or simply cdda2wav

@@ -2558,7 +2558,7 @@
-

Rip a CD with CD Paranoia

+
Rip a CD with CD Paranoia

cdparanoia -L -B -O [Drive Offset] [Starting Track Number]-[Ending Track Number] output_file.wav

This command will use CD Paranoia to rip a CD into separate tracks while compensating for the sample offset of the CD drive. (For more information about drive offset see the related ffmprovisr command.)

@@ -2577,7 +2577,7 @@
-

Rip a CD with Cdda2wav

+
Rip a CD with Cdda2wav

cdda2wav -L0 -t all -cuefile -paranoia paraopts=retries=200,readahead=600,minoverlap=sectors-per-request-1 -verbose-level all output.wav

Cdda2wav is a tool that uses the Paranoia library to facilitate accurate ripping of audio CDs (CDDA). It can be installed via Homebrew with the command brew install cdrtools. This command will accurately rip an audio CD into a single wave file, while querying the CDDB database for track information and creating a cue sheet. This cue sheet can then be used either for playback of the WAV file or to split it into individual access files. Any cdtext information that is discovered will be stored as a sidecar. For more information about cue sheets see this Wikipedia article.

Notes: On macOS the CD must be unmounted before this command is run. This can be done with the command sudo umount '/Volumes/Name_of_CD'

@@ -2600,7 +2600,7 @@
-

Check/Compensate for CD Emphasis

+
Check/Compensate for CD Emphasis

While somewhat rare, certain CDs had 'emphasis' applied as a form of noise reduction. This seems to mostly affect early (1980s) era CDs and some CDs pressed in Japan. Emphasis is part of the Red Book standard and, if present, must be compensated for to ensure accurate playback. CDs that use emphasis contain flags on tracks that tell the CD player to de-emphasize the audio on playback. When ripping a CD with emphasis, it is important to take this into account and either apply de-emphasis while ripping, or if storing a 'flat' copy, create another de-emphasized listening copy.

The following commands will output information about the presence of emphasis when run on a target CD:

Cdda2wav: cdda2wav -J

@@ -2619,7 +2619,7 @@
-

About ImageMagick

+
About ImageMagick

ImageMagick is a free and open-source software suite for displaying, converting, and editing raster image and vector image files.

It's official website can be found here.

Another great resource with lots of supplemental explanations of filters is available at Fred's ImageMagick Scripts.

@@ -2632,7 +2632,7 @@
-

Compare two images

+
Compare two images

compare -metric ae image1.ext image2.ext null:

Compares two images to each other.

@@ -2649,7 +2649,7 @@
-

Create thumbnails

+
Create thumbnails

Creates thumbnails for all files in a folder and saves them in that folder.

mogrify -resize 80x80 -format jpg -quality 75 -path thumbs *.jpg

@@ -2686,7 +2686,7 @@
-

Get file signature data

+
Get file signature data

convert -verbose input_file.ext | grep -i signature

Gets signature data from an image file, which is a hash that can be used to uniquely identify the image.

@@ -2705,7 +2705,7 @@
-

Remove exif data

+
Remove exif data

mogrify -path ./stripped/ -strip *.jpg

Removes (strips) exif data and moves clean files to a new folder.

@@ -2722,7 +2722,7 @@
-

Resize to width

+
Resize to width

convert input_file.ext -resize 750 output_file.ext

This script will also convert the file format, if the output has a different file extension than the input.

@@ -2741,7 +2741,7 @@
-

About flac tool

+
About flac tool

The flac tool is the tool created by the FLAC project to transcode to/from FLAC and to manipulate metadata in FLAC files. One advantage it has over other tools used to transcode into FLAC is the capability of embedding foreign metadata (such as BWF metadata). This means that it is possible to compress a BWF file into FLAC and maintain the ability to transcode back into an identical BWF, metadata and all. For a more detailed explanation, see Dave Rice's article on the topic, from which the following commands are adapted.

Transcode to FLAC

Use this command to transcode from WAV to FLAC while maintaining BWF metadata