diff --git a/index.html b/index.html index 85227a8..fdb71ce 100644 --- a/index.html +++ b/index.html @@ -93,7 +93,7 @@
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
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 @@
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 @@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.
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).
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.
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.
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.
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 @@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).
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.
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.
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.
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.
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
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
ffmpeg -i input_file -filter:v "hflip,vflip" -c:a copy output_file
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
ffmpeg -i input_file -c:v copy -aspect 4:3 output_file
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
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
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.
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
ffmpeg -i input_file -vf "crop=width:height" output_file
This command crops the input video to the dimensions defined
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).
ffmpeg -i input_file -c:a copy -vn output_file
This command extracts the audio stream without loss from an audiovisual 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.
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°.
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 @@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.
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.
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 @@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 @@ffmpeg -i input_file -c:v copy -c:a pcm_s16le -af "aresample=async=1000" output_file
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!
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 @@ffmpeg -i input_file -c copy -map 0 -f segment -segment_time 60 -reset_timestamps 1 output_file-%03d.mkv
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.
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.
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.
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).
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 @@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 @@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 -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.
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.
ffmpeg -i input_file -c:v video_codec -filter:v setfield=tff output_file
ffmpeg -i input file -filter:v idet -f null -
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
ffmpeg -i input_video file -i input_image_file -filter_complex overlay=main_w-overlay_w-5:5 output_file
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 -i input_file -i subtitles_file -c copy -c:s mov_text output_file
ffmpeg -i input_file -ss 00:00:20 -vframes 1 thumb.png
This command will grab a thumbnail 20 seconds into the video.
ffmpeg -i input_file -vf fps=1/60 out%d.png
This will grab a thumbnail every minute and output sequential png files.
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.
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
ffmpeg -f image2 -framerate 24 -i input_file_%06d.ext -c:v v210 output_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.
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.
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 -f lavfi "movie='input.mp4', signalstats=out=brng:color=cyan[out]"
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"
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 -
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 @@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.
ffmpeg -i input_file -map_metadata -1 -c:v copy -c:a copy output_file
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
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 @@ffmpeg -i input_file -f null -
This decodes your video and prints any errors or found issues to the screen.
ffmpeg -i input_file -f framemd5 -an output_file
This will create an MD5 checksum per video frame.
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).
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.
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.
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.
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.
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 @@ffmpeg -f lavfi -i mandelbrot=size=1280x720:rate=25 -c:v libx264 -t 10 output_file
ffmpeg -f lavfi -i testsrc=size=720x576:rate=25 -c:v v210 -t 10 output_file
Test an HD video projector by playing the SMPTE color bars pattern.
ffplay -f lavfi -i smptehdbars=size=1920x1080
Test a VGA (SD) video projector by playing the SMPTE color bars pattern.
ffplay -f lavfi -i smptebars=size=640x480
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
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
Modifies an existing, functioning file and intentionally breaks it for testing purposes.
ffmpeg -i input_file -bsf noise=1 -c copy output_file
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
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"
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"
ffmpeg -i input_one -i input_two -filter_complex signature=detectmode=full:nb_inputs=2 -f null -
ffmpeg -i input -vf signature=format=xml:filename="output.xml" -an -f null -
Play an image sequence directly as moving images, without having to create a video first.
ffplay -framerate 5 input_file_%06d.ext
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.
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 @@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.
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.
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.
ffmpeg -h type=name
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
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.)
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'
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
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 -metric ae image1.ext image2.ext null:
Compares two images to each other.
Creates thumbnails for all files in a folder and saves them in that folder.
mogrify -resize 80x80 -format jpg -quality 75 -path thumbs *.jpg
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.
mogrify -path ./stripped/ -strip *.jpg
Removes (strips) exif data and moves clean files to a new folder.
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.
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.
Use this command to transcode from WAV to FLAC while maintaining BWF metadata