From 2dee34d4296e69c8e150216ad8e5daf0f060a6f9 Mon Sep 17 00:00:00 2001 From: Reto Kromer Date: Thu, 17 Jan 2019 15:11:25 +0100 Subject: [PATCH] uniform URLs (#364) --- index.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index bc285ef..a14962b 100644 --- a/index.html +++ b/index.html @@ -453,7 +453,7 @@

Transcode to Ogg/Theora

-b:v 690k
specifies the 690k video bitrate
output file
path, name and extension of the output file (make sure to include the .ogv filename suffix)
-

This recipe is based on Paul Rouget's recipes.

+

This recipe is based on Paul Rouget's recipes.

@@ -724,7 +724,7 @@

Synchronize video and audio streams

ffmpeg
starts the command
-i input_file
path, name and extension of the input file
-
-itsoffset 0.125
uses itsoffset command to set offset to 0.125 of a second. The offset time must be a time duration specification, see FFMPEG Utils Time Duration Syntax.
+
-itsoffset 0.125
uses itsoffset command to set offset to 0.125 of a second. The offset time must be a time duration specification, see FFMPEG Utils Time Duration Syntax.
-i input_file
repeat path, name and extension of the input file
-map 1:v -map 0:a
selects the video channel for itsoffset command. To slip the audio channel reverse the selection to -map 0:v -map 1:a.
-c copy
copies the encode settings of the input_file to the output_file
@@ -821,7 +821,7 @@

Change video color to black and white

ffmpeg
starts the command
-i input_file
path, name and extension of the input file
-c:v prores_ks
encodes the video to ProRes (prores_ks marks the stream as interlaced, unlike prores)
-
-flags +ildct
ensures that the output_file has interlaced field encoding, using interlace aware discrete cosine transform
+
-flags +ildct
ensures that the output_file has interlaced field encoding, using interlace aware discrete cosine transform
-map 0
ensures ffmpeg maps all streams of the input_file to the output_file
-c:a copy
copies the encode settings of the input_file to the output_file
output_file
path, name and extension of the output file
@@ -1089,12 +1089,12 @@

Variation: concatenating files of different resolutions

(The Lanczos scaling algorithm is recommended, as it is slower but better than the default bilinear algorithm).

The rescaling should be applied just before the point where the streams to be used in the output file are listed. Select the stream you want to rescale, apply the filter, and assign that to a variable name (rescaled_video in the below example). Then you use this variable name in the list of streams to be concatenated.

ffmpeg -i input_1.avi -i input_2.mp4 -filter_complex "[0:v:0] scale=1920:1080:flags=lanczos [rescaled_video], [rescaled_video] [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

-

However, this will only have the desired visual output if the inputs have the same aspect ratio. If you wish to concatenate an SD and an HD file, you will also wish to pillarbox the SD file while upscaling. (See the Convert 4:3 to pillarboxed HD command). The full command would look like this:

+

However, this will only have the desired visual output if the inputs have the same aspect ratio. If you wish to concatenate an SD and an HD file, you will also wish to pillarbox the SD file while upscaling. (See the Convert 4:3 to pillarboxed HD command). The full command would look like this:

ffmpeg -i input_1.avi -i input_2.mp4 -filter_complex "[0:v:0] scale=1440:1080:flags=lanczos, pad=1920:1080:(ow-iw)/2:(oh-ih)/2 [to_hd_video], [to_hd_video] [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

Here, the first input is an SD file which needs to be upscaled to match the second input, which is 1920x1080. The scale filter enlarges the SD input to the height of the HD frame, keeping the 4:3 aspect ratio; then, the video is pillarboxed within a 1920x1080 frame.

Variation: concatenating files of different framerates

If the input files have different framerates, then the output file may be of variable framerate. To explicitly obtain an output file of constant framerate, you may wish convert an input (or multiple inputs) to a different framerate prior to concatenation.

-

You can speed up or slow down a file using the fps and atempo filters (see also the Modify speed command).

+

You can speed up or slow down a file using the fps and atempo filters (see also the Modify speed command).

Here's an example of the full command, in which input_1 is 30fps, input_2 is 25fps, and 25fps is the desired output speed.

ffmpeg -i input_1.avi -i input_2.mp4 -filter_complex "[0:v:0] fps=fps=25 [video_to_25fps]; [0:a:0] atempo=(25/30) [audio_to_25fps]; [video_to_25fps] [audio_to_25fps] [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

Note that the fps filter will drop or repeat frames as necessary in order to achieve the desired frame rate - see the FFmpeg fps docs for more details.

@@ -1271,7 +1271,7 @@

Deinterlace a video

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

+

For more H.264 encoding options, see the latter section of the encode H.264 command.

Example

Before and after deinterlacing:

@@ -1817,7 +1817,7 @@

Create Bash 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.

+

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:

$inputfiles = ls *.mp4
@@ -1962,7 +1962,7 @@ 

Get checksum for video/audio stream

-loglevel error
sets the verbosity of logging to show all errors
-i input_file
path, name and extension of the input file
-map 0:v:0
designated the first video stream as the stream on which to perform this hash generation operation. -map 0 can be used to run the operation on all streams.
-
-f hash -hash md5
produce a checksum hash, and set the hash algorithm to md5. See the official documentation on hash for other algorithms.
+
-f hash -hash md5
produce a checksum hash, and set the hash algorithm to md5. See the official documentation on hash for other algorithms.
-
FFmpeg syntax requires a specified output, and - is just a place holder. No file is actually created.
@@ -2517,7 +2517,7 @@

CDDA (Audio CD) Ripping Tools

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.

+

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

CD Paranoia: cdparanoia -vsQ