diff --git a/index.html b/index.html
index cbcc420..e2033e7 100644
--- a/index.html
+++ b/index.html
@@ -90,7 +90,7 @@
-vf yadifRuns a deinterlacing video filter (yet another deinterlacing filter) on the new file
-c:a pcm_s16leTells ffmpeg to encode the audio stream in 16-bit linear PCM
- output_filepath, name and extension of the output file
+ output_filepath, name and extension of the output file
The extension for the QuickTime container is .mov
.
@@ -145,7 +145,7 @@
-i input_audio_filepath and name of the audio input file. This extension must be .mxf
-c:v libx264transcodes video to H.264
-pix_fmt yuv420psets pixel format to yuv420p for greater compatibility with media players
- -c:a aacre-encodes using the AAC audio codec
+ -c:a aacre-encodes using the AAC audio codec
Note that sadly MP4 cannot contain sound encoded by a PCM (Pulse-Code Modulation) audio codec
output_file.mp4path, name and .mp4 extension of the output file
@@ -196,8 +196,8 @@
- ffmpeg
- starts the command
- -i input_file
- path, name and extension of the input file
- - -filter:v "pad=ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
- video padding
This resolution independent formula is actually padding any aspect ratio into 16:9 by pillarboxing, because the video filter uses relative values for input width (iw), input height (ih), output width (ow) and output height (oh).
- - -c:a copy
- re-encodes using the same audio codec
+ - -filter:v "pad=ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
- video padding
This resolution independent formula is actually padding any aspect ratio into 16:9 by pillarboxing, because the video filter uses relative values for input width (iw), input height (ih), output width (ow) and output height (oh).
+ - -c:a copy
- re-encodes using the same audio codec
For silent videos you can replace -c:a copy
by -an
.
- output_file
- path, name and extension of the output file
@@ -220,13 +220,13 @@
- ffmpeg
- starts the command
- -i input_file
- path, name and extension of the input file
- - -filter:v "colormatrix=bt601:bt709, scale=1440:1080:flags=lanczos, pad=1920:1080:240:0"
- set colour matrix, video scaling and padding
Three filters are applied:
+ - -filter:v "colormatrix=bt601:bt709, scale=1440:1080:flags=lanczos, pad=1920:1080:240:0"
- set colour matrix, video scaling and padding
Three filters are applied:
- The luma coefficients are modified from SD video (according to Rec. 601) to HD video (according to Rec. 709) by a colour matrix. Note that today Rec. 709 is often used also for SD and therefore you may cancel this parameter.
- The scaling filter (
scale=1440:1080
) works for both upscaling and downscaling. We use the Lanczos scaling algorithm (flags=lanczos
), which is slower but gives better results than the default bilinear algorithm.
- The padding filter (
pad=1920:1080:240:0
) completes the transformation from SD to HD.
- - -c:a copy
- re-encodes using the same audio codec
+ - -c:a copy
- re-encodes using the same audio codec
For silent videos you can replace -c:a copy
with -an
.
- output_file
- path, name and extension of the output file
@@ -249,8 +249,8 @@
- ffmpeg
- starts the command
- -i input_file
- path, name and extension of the input file
- - -filter:v "pad=iw:iw*3/4:(ow-iw)/2:(oh-ih)/2"
- video padding
This resolution independent formula is actually padding any aspect ratio into 4:3 by letterboxing, because the video filter uses relative values for input width (iw), input height (ih), output width (ow) and output height (oh).
- - -c:a copy
- re-encodes using the same audio codec
+ - -filter:v "pad=iw:iw*3/4:(ow-iw)/2:(oh-ih)/2"
- video padding
This resolution independent formula is actually padding any aspect ratio into 4:3 by letterboxing, because the video filter uses relative values for input width (iw), input height (ih), output width (ow) and output height (oh).
+ - -c:a copy
- re-encodes using the same audio codec
For silent videos you can replace -c:a copy
by -an
.
- output_file
- path, name and extension of the output file
@@ -326,13 +326,13 @@
This will convert your Matroska (MKV) files to MP4 files.
- ffmpeg
- starts the command
- - -i input_file
- path and name of the input file
+ - -i input_file
- path and name of the input file
The extension for the Matroska container is .mkv
.
- -c:v copy
- re-encodes using the same video codec
- - -c:a aac
- re-encodes using the AAC audio codec
- Note that sadly MP4 cannot contain sound encoded by a PCM (Pulse-Code Modulation) audio codec.
+ - -c:a aac
- re-encodes using the AAC audio codec
+ Note that sadly MP4 cannot contain sound encoded by a PCM (Pulse-Code Modulation) audio codec.
For silent videos you can replace -c:a aac
by -an
.
- - output_file
- path and name of the output file
+ - output_file
- path and name of the output file
The extension for the MP4 container is .mp4
.
@@ -356,7 +356,7 @@
-f image2forces input or output file format. image2
specifies the image file demuxer.
-framerate 9sets framerate to 9 frames per second
-pattern_type globtells ffmpeg that the following mapping should "interpret like a glob" (a "global command" function that relies on the * as a wildcard and finds everything that matches)
- -i "input_image_*.jpg"maps all files in the directory that start with input_image_, for example input_image_001.jpg, input_image_002.jpg, input_image_003.jpg... etc.
+ -i "input_image_*.jpg"maps all files in the directory that start with input_image_, for example input_image_001.jpg, input_image_002.jpg, input_image_003.jpg... etc.
(The quotation marks are necessary for the above "glob" pattern!)
-vf scale=250x250filter the video to scale it to 250x250; -vf is an alias for -filter:v
output_file.gifpath and name of the output file
@@ -380,8 +380,8 @@
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.
- ffmpeg
- starts the command
- - -i concat:input files
- lists the input VOB files and directs ffmpeg to concatenate them. Each input file should be separated by a backslash and a pipe, like so:
- -i concat:VTS_01_1.VOB\|VTS_01_2.VOB\|VTS_01_3.VOB
+ - -i concat:input files
- lists the input VOB files and directs ffmpeg to concatenate them. Each input file should be separated by a backslash and a pipe, like so:
+ -i concat:VTS_01_1.VOB\|VTS_01_2.VOB\|VTS_01_3.VOB
The backslash is simply an escape character for the pipe (|).
- -c:v libx264
- sets the video codec as H.264
- -c:a copy
- audio remains as-is (no re-encode)
@@ -547,7 +547,7 @@
- -i input_file
- path, name and extension of the input file
- -ss 00:02:00
- sets in point at 00:02:00
- -to 00:55:00
- sets out point at 00:55:00
- - -c copy
- use stream copy mode (no re-encoding)
+ - -c copy
- use stream copy mode (no re-encoding)
Note: watch out when using -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.
- output_file
- path, name and extension of the output file
@@ -710,19 +710,19 @@
“Rewrap-MXF.sh” contains the following text:
for file in *.MXF; do ffmpeg -i "$file" -map 0 -c copy "${file%.MXF}.mov"; done
- - for file in *.MXF
- starts the loop, and states what the input files will be. Here, the ffmpeg command within the loop will be applied to all files with an extension of .MXF.
+ - for file in *.MXF
- starts the loop, and states what the input files will be. Here, the ffmpeg command within the loop will be applied to all files with an extension of .MXF.
The word ‘file’ is an arbitrary variable which will represent each .MXF file in turn as it is looped over.
- - do ffmpeg -i "$file"
- carry out the following ffmpeg command for each input file.
+ - do ffmpeg -i "$file"
- carry out the following ffmpeg command for each input file.
Per Bash syntax, within the command the variable is referred to by “$file”. The dollar sign is used to reference the variable ‘file’, and the enclosing quotation marks prevents reinterpretation of any special characters that may occur within the filename, ensuring that the original filename is retained.
- -map 0
- retain all streams
- -c copy
- enable stream copy (no re-encode)
- "${file%.MXF}.mov";
- retaining the original file name, set the output file wrapper as .mov
- done
- complete; all items have been processed.
- Note: the shell script (.sh file) and all .MXF files to be processed must be contained within the same directory, and the script must be run from that directory.
+
Note: the shell script (.sh file) and all .MXF files to be processed must be contained within the same directory, and the script must be run from that directory.
Execute the .sh file with the command sh Rewrap-MXF.sh
.
Modify the script as needed to perform different transcodes, or to use with ffprobe. :)
- The basic pattern will look similar to this:
+
The basic pattern will look similar to this:
for item in *.ext; do ffmpeg -i $item (ffmpeg options here) "${item%.ext}_suffix.ext"
e.g., if an input file is bestmovie002.avi, its output will be bestmovie002_suffix.avi.
@@ -959,14 +959,14 @@
- ffmpeg
- starts the command
- -f concat
- forces ffmpeg to concatenate the files and to keep the same file format
- - -i mylist.txt
- path, name and extension of the input file. Per the ffmpeg documentation, it is preferable to specify relative rather than absolute file paths, as allowing absolute file paths may pose a security risk.
+ - -i mylist.txt
- path, name and extension of the input file. Per the ffmpeg documentation, it is preferable to specify relative rather than absolute file paths, as allowing absolute file paths may pose a security risk.
This text file contains the list of files to be concatenated and should be formatted as follows:
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.
-Note: If specifying absolute file paths in the .txt file, add -safe 0
before the input file.
+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.
+Note: If specifying absolute file paths in the .txt file, add -safe 0
before the input file.
e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file
- -c copy
- use stream copy mode to re-mux instead of re-encode
- output_file
- path, name and extension of the output file
@@ -990,10 +990,10 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_fileffplay -framerate 5 input_file_%06d.ext
- ffplay
- starts the command
- - -framerate 5
- plays image sequence at rate of 5 images per second
+ - -framerate 5
- plays image sequence at rate of 5 images per second
Note: this low framerate will produce a slideshow effect.
- - -i input_file
- path, name and extension of the input file
- This must match the naming convention used! The regex %06d matches six-digit-long numbers, possibly with leading zeroes. This allows the full sequence to be read in ascending order, one image after the other.
+ - -i input_file
- path, name and extension of the input file
+ This must match the naming convention used! The regex %06d matches six-digit-long numbers, possibly with leading zeroes. This allows the full sequence to be read in ascending order, one image after the other.
The extension for TIFF files is .tif or maybe .tiff; the extension for DPX files is .dpx (or even .cin for old files). Screenshots are often in .png format.
Notes:
@@ -1090,8 +1090,8 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file
- ffmpeg
- starts the command
- -i input_file
- path, name and extension of the input file
- - -filter:v "hflip,vflip"
- flips the image horizontally and vertically
By using only one of the parameters hflip or vflip for filtering the image is flipped on that axis only. The quote marks are not mandatory.
- - -c:a copy
- re-encodes using the same audio codec
+ - -filter:v "hflip,vflip"
- flips the image horizontally and vertically
By using only one of the parameters hflip or vflip for filtering the image is flipped on that axis only. The quote marks are not mandatory.
+ - -c:a copy
- re-encodes using the same audio codec
For silent videos you can replace -c:a copy
by -an
.
- output_file
- path, name and extension of the output file
@@ -1228,7 +1228,7 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_fileffmpegstarts the command
-f image2forces the image file de-muxer for single image files
-framerate 24Sets the input framerate to 24 fps. The image2 demuxer defaults to 25 fps.
- -i input_filepath, name and extension of the input file
+ -i input_filepath, 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 v210encodes an uncompressed 10-bit video stream
-an copyno audio
@@ -1279,7 +1279,7 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file
ffmpegstarts the command
-i input_filepath, name and extension of the input file
- -filter:v setfield=tffSets the field order to top field first. Use setfield=bff
for bottom field first.
+ -filter:v setfield=tffSets the field order to top field first. Use setfield=bff
for bottom field first.
-c:v proresTells ffmpeg to transcode the video stream into Apple ProRes 422. Experiment with using other codecs.
output_filepath, name and extension of the output file
@@ -1343,13 +1343,13 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file-hCall 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
-
+
+ encoder=libx264
+ decoder=mp3
+ muxer=matroska
+ demuxer=mov
+ filter=crop
+