diff --git a/index.html b/index.html index 6132db1..e59e7c0 100644 --- a/index.html +++ b/index.html @@ -46,7 +46,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
yadif=1
may produce visually better results.Note: the very same scaling filter also downscales a bigger image size into HD.
- -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.
--vf
is an alias of -filter:v
)yadif=1
may produce visually better results.libx264
will use a chroma subsampling scheme that is the closest match to that of the input. This can result in Y′CBCR 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, therefore it’s advisable to specify 4:2:0 chroma subsampling. "yadif,format=yuv420p"
is an ffmpeg filtergraph. Here the filtergraph is made up of one filter chain, which is itself made up of the two filters (separated by the comma).
- The enclosing quote marks are necessary when you use spaces within the filtergraph, e.g. -vf "yadif, format=yuv420p"
, and are included above as an example of good practice.
Note: ffmpeg includes several deinterlacers apart from yadif: bwdif, w3fdif, kerndeint, and nnedi.
-For more H.264 encoding options, see the latter section of the encode H.264 command.
-Before and after deinterlacing:
- - -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!
+file './first_file.ext' +file './second_file.ext' +. . . +file './last_file.ext'+In the above, file is simply the word "file". Straight apostrophes ('like this') rather than curved quotation marks (‘like this’) must be used to enclose the file paths.
-safe 0
before the input file.ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file
For more information, see the ffmpeg wiki page on concatenating files.
+ +ffmpeg -i input_file -c copy -map 0 -f segment -segment_time 60 -reset_timestamps 1 output_file-%03d.mkv
Path, name and extension of the output file.
+ In order to have an incrementing number in each segment filename, FFmpeg supports printf-style syntax for a counter.
In this example, '%03d' means: 3-digits, zero-padded
+ Examples:
%03d
: 000, 001, 002, ... 999%05d
: 00000, 00001, 00002, ... 99999%d
: 0, 1, 2, 3, 4, ... 23, 24, etc. 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 video file without re-encoding the image data.
+-ss
with -c copy
if the source is encoded with an interframe codec (e.g., H.264). Since ffmpeg must split on i-frames, it will seek to the nearest i-frame to begin the stream copy.
+ Variation: trim video by setting duration, by using -t
instead of -to
ffmpeg -i input_file -ss 00:05:00 -t 10 -c copy output_file
Note: In order to keep the original timestamps, without trying to sanitise them, you may add the -copyts
option.
ffmpeg -i input_file -t 5 -c copy -map 0 output_file
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.
+ffmpeg -i input_file -ss 5 -c copy -map 0 output_file
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.
+ffmpeg -sseof -5 -i input_file -c copy -map 0 output_file
This command copies a video 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 video file (e.g. for extracting the closing credits).
+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
yadif=1
may produce visually better results.Note: the very same scaling filter also downscales a bigger image size into HD.
+ +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.
+-vf
is an alias of -filter:v
)yadif=1
may produce visually better results.libx264
will use a chroma subsampling scheme that is the closest match to that of the input. This can result in Y′CBCR 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, therefore it’s advisable to specify 4:2:0 chroma subsampling. "yadif,format=yuv420p"
is an ffmpeg filtergraph. Here the filtergraph is made up of one filter chain, which is itself made up of the two filters (separated by the comma).
+ The enclosing quote marks are necessary when you use spaces within the filtergraph, e.g. -vf "yadif, format=yuv420p"
, and are included above as an example of good practice.
Note: ffmpeg includes several deinterlacers apart from yadif: bwdif, w3fdif, kerndeint, and nnedi.
+For more H.264 encoding options, see the latter section of the encode H.264 command.
+Before and after deinterlacing:
+ + +ffmpeg -i input_file -c:v video_codec -filter:v setfield=tff output_file
setfield=bff
for bottom field first.-c copy
. The video must be re-encoded with whatever video codec is chosen, e.g. ffv1
, v210
or prores
.ffmpeg -i input file -filter:v idet -f null -
null
muxer. This allows video decoding without creating an output file.-
is just a place holder. No file is actually created.Note: ffmpeg must be compiled with the tesseract library for this script to work (--with-tesseract
if using 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 brew install ffmpeg
method)
ffprobe -show_entries frame_tags=lavfi.ocr.text -f lavfi -i "movie=input_file,ocr"
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 documentation on ffprobe (full list of flags, commands, www.ffmpeg.org/ffprobe.html)
+ffmpeg -i input_file -map_metadata -1 -c:v copy -c:a copy output_file
ffmpeg -i input_file -t 5 -c copy -map 0 output_file
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.
+ffmpeg -f image2 -framerate 24 -i input_file_%06d.ext -c:v v210 output_file
-start_number 086400
before -i input_file_%06d.ext
. The extension for TIFF files is .tif or maybe .tiff; the extension for DPX files is .dpx (or eventually .cin for old files).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 video file without re-encoding the image data.
+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.
-ss
with -c copy
if the source is encoded with an interframe codec (e.g., H.264). Since ffmpeg must split on i-frames, it will seek to the nearest i-frame to begin the stream copy.
- Variation: trim video by setting duration, by using -t
instead of -to
ffmpeg -i input_file -ss 00:05:00 -t 10 -c copy output_file
Note: In order to keep the original timestamps, without trying to sanitise them, you may add the -copyts
option.
ffmpeg -i input_file -ss 5 -c copy -map 0 output_file
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.
-ffmpeg -sseof -5 -i input_file -c copy -map 0 output_file
This command copies a video 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 video file (e.g. for extracting the closing credits).
-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.
-.mpg
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 -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.
-asplit
allows audio streams to be split up for separate manipulation. This command splits the audio from the first input (the master file) into two streams "a" and "b"concat
is used to join files. n=2
tells the filter there are two inputs. v=0:a=1
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"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_colour:alpha=0.4:x=(w-text_w)/2:y=(h-text_h)/2" output_file
fontfile=/Library/Fonts/AppleGothic.ttf
35
is a good starting point for SD. Ideally this value is proportional to video size, for example use ffprobe to acquire video height and divide by 14.text='FFMPROVISR EXAMPLE TEXT'
fontcolor=white
or a hexadecimal value such as fontcolor=0xFFFFFF
-vf
is a shortcut for -filter:v
.ffmpeg -i input_video file -i input_image_file -filter_complex overlay=main_w-overlay_w-5:5 output_file
main_w-overlay_w-5:5
uses relative coordinates to place the watermark in the upper right hand corner, based on the width of your input files. Please see the ffmpeg documentation for more examples.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
fontfile=/Library/Fonts/AppleGothic.ttf
35
is a good starting point for SD. Ideally this value is proportional to video size, for example use ffprobe to acquire video height and divide by 14.hh:mm:ss[:;.]ff
. Colon escaping is determined by O.S, for example in Ubuntu timecode='09\\:50\\:01\\:23'
. Ideally, this value would be generated from the file itself using ffprobe.fontcolor=white
or a hexadecimal value such as fontcolor=0xFFFFFF
fontcolor=black
or a hexadecimal value such as fontcolor=0x000000
25/1
Note: -vf
is a shortcut for -filter:v
.
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=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.
-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 documentation on ffprobe (full list of flags, commands, www.ffmpeg.org/ffprobe.html)
-ffmpeg -report -i input_file -f null -
This decodes your video and displays any CRC checksum mismatches. These errors will display in your terminal like this: [ffv1 @ 0x1b04660] CRC mismatch 350FBD8A!at 0.272000 seconds
Frame crcs are enabled by default in FFV1 Version 3.
--loglevel verbose
.null
muxer. This allows video decoding without creating an output file.-
is just a place holder. No file is actually created. ffmpeg -i input file -filter:v idet -f null -
null
muxer. This allows video decoding without creating an output file.-
is just a place holder. No file is actually created.ffmpeg -report -i input_file -f null -
This decodes your video and displays any CRC checksum mismatches. These errors will display in your terminal like this: [ffv1 @ 0x1b04660] CRC mismatch 350FBD8A!at 0.272000 seconds
Frame crcs are enabled by default in FFV1 Version 3.
+-loglevel verbose
.null
muxer. This allows video decoding without creating an output file.-
is just a place holder. No file is actually created. Modifies an existing, functioning file and intentionally breaks it for testing purposes.
-ffmpeg -i input_file -bsf noise=1 -c copy output_file
-bsf:v
for video, -bsf:a
for audio, etc. The noise filter 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.Modifies an existing, functioning file and intentionally breaks it for testing purposes.
+ffmpeg -i input_file -bsf noise=1 -c copy output_file
-bsf:v
for video, -bsf:a
for audio, etc. The noise filter 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.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!
+Note: ffmpeg must be compiled with the tesseract library for this script to work (--with-tesseract
if using brew install ffmpeg
method).
ffplay input_file -vf "ocr,drawtext=fontfile=/Library/Fonts/Andale Mono.ttf:text=%{metadata\\\:lavfi.ocr.text}:fontcolor=white"
file './first_file.ext' -file './second_file.ext' -. . . -file './last_file.ext'-In the above, file is simply the word "file". Straight apostrophes ('like this') rather than curved quotation marks (‘like this’) must be used to enclose the file paths.
-safe 0
before the input file.ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file
For more information, see the ffmpeg wiki page on concatenating files.
- -ffmpeg -i input_file -c copy -map 0 -f segment -segment_time 60 -reset_timestamps 1 output_file-%03d.mkv
Path, name and extension of the output file.
- In order to have an incrementing number in each segment filename, FFmpeg supports printf-style syntax for a counter.
In this example, '%03d' means: 3-digits, zero-padded
- Examples:
%03d
: 000, 001, 002, ... 999%05d
: 00000, 00001, 00002, ... 99999%d
: 0, 1, 2, 3, 4, ... 23, 24, etc. Note: ffmpeg must be compiled with the tesseract library for this script to work (--with-tesseract
if using brew install ffmpeg
method)
ffprobe -show_entries frame_tags=lavfi.ocr.text -f lavfi -i "movie=input_file,ocr"
ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_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.
+
+ - ffmpeg
- starts the command
+ - -i input_file
- path, name and extension of the input file
+ - -c:a copy
- re-encodes using the same audio codec
+ - -vn
- no video stream
+ - output_file
- path, name and extension of the output file
+
+
+
+
+
+
+
+
@@ -1917,31 +2060,39 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_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.
+ Generate two access MP3s from input. One with appended audio (such as 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.
- ffmpeg
- starts the command
- - -i input_file
- path, name and extension of the input file
- - -c:a copy
- re-encodes using the same audio codec
- - -vn
- no video stream
- - output_file
- path, name and extension of the output file
+ - -i input_file
- path, name and extension of the input file (the master file)
+ - -i input_file_to_append
- path, name and extension of the input file (the file to be appended to access file)
+ - -filter_complex
- enables the complex filtering to manage splitting the input to two audio streams
+ - [0:a:0]asplit=2[a][b];
asplit
allows audio streams to be split up for separate manipulation. This command splits the audio from the first input (the master file) into two streams "a" and "b"
+ - [b]afifo[bb];
- this buffers the stream "b" to help prevent dropped samples and renames stream to "bb"
+ - [1:a:0][bb]concat=n=2:v=0:a=1[concatout]
concat
is used to join files. n=2
tells the filter there are two inputs. v=0:a=1
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"
+ - -map "[a]"
- this maps the unmodified audio stream to the first output
+ - -codec:a libmp3lame -dither_method modified_e_weighted -qscale:a 2
- sets up MP3 options (using constant quality)
+ - output_file
- path, name and extension of the output file (unmodified)
+ - -map "[concatout]"
- this maps the modified stream to the second output
+ - -codec:a libmp3lame -dither_method modified_e_weighted -qscale:a 2
- sets up MP3 options (using constant quality)
+ - output_file_appended
- path, name and extension of the output file (with appended notice)
-
+
-
+
@@ -1961,7 +2112,7 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file
-
+
@@ -1992,164 +2143,6 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file
-
-
-
-
-
-
- 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_colour:alpha=0.4:x=(w-text_w)/2:y=(h-text_h)/2" output_file
-
- - ffmpeg
- starts the command
- - -i input_file
- path, name and extension of the input file
- - -vf drawtext=
- This calls the drawtext filter with the following options:
-
- - fontfile=font_path
- Set path to font. For example in macOS:
fontfile=/Library/Fonts/AppleGothic.ttf
- - fontsize=font_size
- Set font size.
35
is a good starting point for SD. Ideally this value is proportional to video size, for example use ffprobe to acquire video height and divide by 14.
- - text=watermark_text
- Set the content of your watermark text. For example:
text='FFMPROVISR EXAMPLE TEXT'
- - fontcolor=font_colour
- Set colour of font. Can be a text string such as
fontcolor=white
or a hexadecimal value such as fontcolor=0xFFFFFF
- - alpha=0.4
- Set transparency value.
- - x=(w-text_w)/2:y=(h-text_h)/2
- Sets x and y coordinates for the watermark. These relative values will centre your watermark regardless of video dimensions.
-
- Note: -vf
is a shortcut for -filter:v
.
- - output_file
- path, name and extension of the output file.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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
- - -i input_video_file
- path, name and extension of the input video file
- - -i input_image_file
- path, name and extension of the image file
- - -filter_complex overlay=main_w-overlay_w-5:5
- This calls the overlay filter and sets x and y coordinates for the position of the watermark on the video. Instead of hardcoding specific x and y coordinates,
main_w-overlay_w-5:5
uses relative coordinates to place the watermark in the upper right hand corner, based on the width of your input files. Please see the ffmpeg documentation for more examples.
- - output_file
- path, name and extension of the output file
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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
- - -i input_file
- path, name and extension of the input file
- - -vf drawtext=
- This calls the drawtext filter with the following options:
-
- "
- quotation mark to start drawtext filter command
- - fontfile=font_path
- Set path to font. For example in macOS:
fontfile=/Library/Fonts/AppleGothic.ttf
- - fontsize=font_size
- Set font size.
35
is a good starting point for SD. Ideally this value is proportional to video size, for example use ffprobe to acquire video height and divide by 14.
- - timecode=starting_timecode
- Set the timecode to be displayed for the first frame. Timecode is to be represented as
hh:mm:ss[:;.]ff
. Colon escaping is determined by O.S, for example in Ubuntu timecode='09\\:50\\:01\\:23'
. Ideally, this value would be generated from the file itself using ffprobe.
- - fontcolor=font_colour
- Set colour of font. Can be a text string such as
fontcolor=white
or a hexadecimal value such as fontcolor=0xFFFFFF
- - box=1
- Enable box around timecode
- - boxcolor=box_colour
- Set colour of box. Can be a text string such as
fontcolor=black
or a hexadecimal value such as fontcolor=0x000000
- - rate=timecode_rate
- Framerate of video. For example
25/1
- - x=(w-text_w)/2:y=h/1.2
- Sets x and y coordinates for the timecode. These relative values will horizontally centre your timecode in the bottom third regardless of video dimensions.
- - "
- quotation mark to end drawtext filter command
- - output_file
- path, name and extension of the output file.
-
- Note: -vf
is a shortcut for -filter:v
.
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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
- - -f image2
- forces the image file de-muxer for single image files
- - -framerate 24
- Sets the input framerate to 24 fps. The image2 demuxer defaults to 25 fps.
- - -i input_file
- path, name and extension of the input file
- This must match the naming convention actually used! The regex %06d matches six digits long numbers, possibly with leading zeroes. This allows to read in ascending order, one image after the other, the full sequence inside one folder. For image sequences starting with 086400 (i.e. captured with a timecode starting at 01:00:00:00 and at 24 fps), add the flag -start_number 086400
before -i input_file_%06d.ext
. The extension for TIFF files is .tif or maybe .tiff; the extension for DPX files is .dpx (or eventually .cin for old files).
- - -c:v v210
- encodes an uncompressed 10-bit video stream
- - output_file
- path, name and extension of the output 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.
-
- - ffmpeg
- starts the command
- - -r 1
- set the framerate
- - -loop 1
- loop the first input stream
- - -i image_file
- path, name and extension of the image file
- - -i audio_file
- path, name and extension of the audio file
- - -acodec copy
- copy the audio. -acodec is an alias for -c:a
- - -shortest
- finish encoding when the shortest input stream ends
- - -vf scale=1280:720
- filter the video to scale it to 1280x720 for YouTube. -vf is an alias for -filter:v
- - output_file
- path, name and extension of the video output file
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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
- - -i input_file
- path, name and extension of the input file
- - -filter:v setfield=tff
- Sets the field order to top field first. Use
setfield=bff
for bottom field first.
- - -c:v video_codec
- As a video filter is used, it is not possible to use
-c copy
. The video must be re-encoded with whatever video codec is chosen, e.g. ffv1
, v210
or prores
.
- - output_file
- path, name and extension of the output file
-
-
-
-
-
-
-
-
@@ -2191,34 +2184,29 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file
-
-
-
+
+
+
- View information about a specific format
- ffmpeg -h type=name
+ 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.
- ffmpeg
- starts the command
- - -h
- Call the help option
- - type=name
- - Tells ffmpeg which kind of option you want, for example:
-
- encoder=libx264
- decoder=mp3
- muxer=matroska
- demuxer=mov
- filter=crop
-
-
+ - -i input_file
- path, name and extension of the input file
+ - -aspect 4:3
- declares the aspect ratio of the resulting video file. You can also use 16:9.
+ - -target ntsc-dvd
- specifies the region for your DVD. This could be also pal-dvd.
+ - output_file.mpg
- path and name of the output file. The extension must be
.mpg
-
+
@@ -2265,29 +2253,6 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_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
- - -i input_file
- path, name and extension of the input file
- - -map_metadata -1
- sets metadata copying to -1, which copies nothing
- - -vcodec copy
- copies video track
- - -acodec copy
- copies audio track
- - output_file
- Makes copy of original file and names output file
-
-
-
-
-
-
-
-
@@ -2314,32 +2279,89 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file
-
-
-
+
+
+
+
+
+ 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.
+
+ - ffmpeg
- starts the command
+ - -i input_file
- path, name and extension of the input file
+ - -filter:v drawbox=
+ - This calls the drawtext filter with the following options:
+
+ - w=in_w
- Width is set to the input width. Shorthand for this command would be w=iw
+ - h=7
- Height is set to 7 pixels.
+ - y=ih-h
- Y represents the offset, and ih-h sets it to the input height minus the height declared in the previous parameter, setting the box at the bottom of the frame.
+ - t=max
- T represents the thickness of the drawn box. Default is 3.
+
+
+ - output_file
- path and name of the output file
+
+
+
-
-->
-
-
+
+
+
+
+
+
+
+ View information about a specific format
+ ffmpeg -h type=name
+
+ - ffmpeg
- starts the command
+ - -h
- Call the help option
+ - type=name
+ - Tells ffmpeg which kind of option you want, for example:
+
+ encoder=libx264
+ decoder=mp3
+ muxer=matroska
+ demuxer=mov
+ filter=crop
+
+
+
+
+
+
+
+
+
+
+
+
+
+