diff --git a/index.html b/index.html index 1798154..a569a72 100644 --- a/index.html +++ b/index.html @@ -286,7 +286,7 @@

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).

+

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
starts the command
-i input file
path, name and extension of the input file
@@ -395,7 +395,7 @@
"
quotation mark to end filtergraph
output_file
path, name and extension of the output file
-

Note: the very same scaling filter also downscales a bigger image size into HD.

+

Note: the very same scaling filter also downscales a bigger image size into HD.

@@ -528,7 +528,7 @@

"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.

+

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.

Example

@@ -561,7 +561,7 @@ For example, to convert from Rec.601 to Rec.709, you would use -vf colormatrix=bt601:bt709.
output file
path, name and extension of the output file
-

Note: Converting between colourspaces with ffmpeg can be done via either the colormatrix or colorspace filters, with colorspace allowing finer control (individual setting of colourspace, transfer characteristics, primaries, range, pixel format, etc). See this entry on the ffmpeg wiki, and the ffmpeg documentation for colormatrix and colorspace.

+

Note: Converting between colourspaces with ffmpeg can be done via either the colormatrix or colorspace filters, with colorspace allowing finer control (individual setting of colourspace, transfer characteristics, primaries, range, pixel format, etc). See this entry on the ffmpeg wiki, and the ffmpeg documentation for colormatrix and colorspace.


Convert colourspace and embed colourspace metadata

ffmpeg -i input_file -c:v libx264 -vf colormatrix=src:dst -color_primaries val -color_trc val -colorspace val output_file

@@ -589,7 +589,7 @@ MediaInfo screenshots of colourspace metadata

Using this command it is possible to add Rec.709 tags to a file that is actually Rec.601 (etc), so apply with caution!

These commands are relevant for H.264 and H.265 videos, encoded with libx264 and libx265 respectively.

-

Note: If you wish to embed colourspace metadata without changing to another colourspace, omit -vf colormatrix=src:dst. However, since it is libx264/libx265 that writes the metadata, it’s not possible to add these tags without reencoding the video stream.

+

Note: If you wish to embed colourspace metadata without changing to another colourspace, omit -vf colormatrix=src:dst. However, since it is libx264/libx265 that writes the metadata, it’s not possible to add these tags without reencoding the video stream.

For all possible values for -color_primaries, -color_trc, and -colorspace, see the ffmpeg documentation on codec options.


1. Out of step with the regular pattern, -color_trc doesn’t accept bt470bg; it is instead here referred to directly as gamma.
@@ -679,7 +679,7 @@

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
-
-f lavfi
tells ffmpeg to use the Libavfilter input virtual device
+
-f lavfi
tells ffplay to use the Libavfilter input virtual device
"
quotation mark to start the lavfi filtergraph
movie='input.mp3'
declares audio source file on which to apply filter
,
comma signifies the end of audio source section and the beginning of the filter section
@@ -713,7 +713,7 @@

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

ffplay
starts the command
-
-f lavfi
tells ffmpeg to use the Libavfilter input virtual device
+
-f lavfi
tells ffplay to use the Libavfilter input virtual device
"
quotation mark to start the lavfi filtergraph
movie='input.mp4'
declares video file source to apply filter
,
comma signifies closing of video source assertion and ready for filter assertion
@@ -775,7 +775,7 @@
ffprobe
starts the command
-show_entries
sets a list of entries to show
frame_tags=lavfi.ocr.text
shows the lavfi.ocr.text tag in the frame section of the video
-
-f lavfi
tells ffmpeg to use the Libavfilter input virtual device
+
-f lavfi
tells ffprobe to use the Libavfilter input virtual device
-i "movie=input_file,ocr"
declares 'movie' as input_file and passes in the 'ocr' command
@@ -975,7 +975,7 @@
-to 00:55:00
sets out point at 00:55:00
-c copy
use stream copy mode (no re-encoding)
-map 0
Tells ffmpeg to map all streams of the input to the output.
- 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. + 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

Variation: trim video by setting duration, by using -t instead of -to

@@ -1279,7 +1279,7 @@
"${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:
@@ -1317,13 +1317,13 @@ foreach ($file in $inputfiles) {

{
Opens the code block.
$output = [io.path]::ChangeExtension($file, '.mkv')
Sets up the output file: it will be located in the current folder and keep the same filename, but will have an .mkv extension instead of .mp4.
ffmpeg -i $file
Carry out the following ffmpeg command for each input file.
- Note: To call ffmpeg here as just ‘ffmpeg’ (rather than entering the full path to ffmpeg.exe), you must make sure that it’s correctly configured. See this article, especially the section ‘Add to Path’.
+ Note: To call ffmpeg here as just ‘ffmpeg’ (rather than entering the full path to ffmpeg.exe), you must make sure that it’s correctly configured. See this article, especially the section ‘Add to Path’.
-map 0
retain all streams
-c copy
enable stream copy (no re-encode)
$output
The output file is set to the value of the $output variable declared above: i.e., the current file name with an .mkv extension.
}
Closes the code block.
-

Note: the PowerShell script (.ps1 file) and all .mp4 files to be rewrapped must be contained within the same directory, and the script must be run from that directory.

+

Note: the PowerShell script (.ps1 file) and all .mp4 files to be rewrapped must be contained within the same directory, and the script must be run from that directory.

Execute the .ps1 file by typing .\rewrap-mp4.ps1 in PowerShell.

Modify the script as needed to perform different transcodes, or to use with ffprobe. :)

@@ -1470,7 +1470,7 @@ foreach ($file in $inputfiles) {

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
starts the command
-
-f lavfi
tells ffmpeg to use the Libavfilter input virtual device
+
-f lavfi
tells ffprobe to use the Libavfilter input virtual device
-i
input file and parameters
"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]"
This very large lump of commands declares the input file and passes in a request for all potential data signal information for a file with one video and one audio track
@@ -1500,7 +1500,7 @@ foreach ($file in $inputfiles) {

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
starts the command
-
-f lavfi
tells ffmpeg to use the Libavfilter input virtual device
+
-f lavfi
tells ffprobe to use the Libavfilter input virtual device
-i
input file and parameters
"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"
This very large lump of commands declares the input file and passes in a request for all potential data signal information for a file with one video and one audio track
@@ -1634,7 +1634,7 @@ foreach ($file in $inputfiles) {

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

ffplay
starts the command
-
-f lavfi
tells ffmpeg to use the Libavfilter input virtual device
+
-f lavfi
tells ffplay to use the Libavfilter input virtual device
-i smptehdbars=size=1920x1080
asks for the smptehdbars filter pattern as input and sets the HD resolution. This generates a colour bars pattern, based on the SMPTE RP 219–2002.
@@ -1655,7 +1655,7 @@ foreach ($file in $inputfiles) {

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

ffplay
starts the command
-
-f lavfi
tells ffmpeg to use the Libavfilter input virtual device
+
-f lavfi
tells ffplay to use the Libavfilter input virtual device
-i smptebars=size=640x480
asks for the smptebars filter pattern as input and sets the VGA (SD) resolution. This generates a colour bars pattern, based on the SMPTE Engineering Guideline EG 1–1990.
@@ -1788,7 +1788,7 @@ 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.
+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
@@ -1849,12 +1849,12 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file
ffplay
starts the command
-framerate 5
plays image sequence at rate of 5 images per second
- Note: this low framerate will produce a slideshow effect.
+ 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.
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:

+

Notes:

If -framerate is omitted, the playback speed depends on the images’ file sizes and on the computer’s processing power. It may be rather slow for large image files.

You can navigate durationally by clicking within the playback window. Clicking towards the left-hand side of the playback window takes you towards the beginning of the playback sequence; clicking towards the right takes you towards the end of the sequence.

@@ -2069,7 +2069,7 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file"
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.

+

Note: -vf is a shortcut for -filter:v.