From 88f8480bf0f08efbb619e4f7f91c211095af7e94 Mon Sep 17 00:00:00 2001 From: kfrn Date: Sun, 30 Oct 2016 21:05:49 +1300 Subject: [PATCH 1/7] Add command to create H.264 from DVD --- index.html | 60 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 5c238ec..9fd7214 100644 --- a/index.html +++ b/index.html @@ -110,7 +110,7 @@
ffmpeg
starts the command
-i input_file
path, name and extension of the input file
-c:v libx264
tells ffmpeg to change the video codec of the file to H.264
-
-pix_fmt yuv420p
libx264 will use a chroma subsampling scheme that is the closest match to that of the input. This can result in YUV 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. In order to allow the video to play in all players, you can specify 4:2:0 chroma subsampling.
+
-pix_fmt yuv420p
libx264 will use a chroma subsampling scheme that is the closest match to that of the input. This can result in YUV 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. In order to allow the video to play in all players, you can specify 4:2:0 chroma subsampling.
-c:a copy
tells ffmpeg not to change the audio codec
output_file
path, name and extension of the output file
@@ -289,7 +289,7 @@ - + + + + + +

Make derivative variations

@@ -508,7 +546,7 @@
-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
- +

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

@@ -642,7 +680,7 @@

Modify the ffmpeg script as needed to perform different transcodes :)

- + @@ -1173,7 +1211,7 @@ 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 setfield=tff
Sets the field order to top field first. Use setfield=bff for bottom field first.
+
-filter:v setfield=tff
Sets the field order to top field first. Use setfield=bff for bottom field first.
-c:v prores
Tells ffmpeg to transcode the video stream into Apple ProRes 422. Experiment with using other codecs.
output_file
path, name and extension of the output file
@@ -1183,7 +1221,7 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file - + - + From ef43d544a883b3927681f7b79eef449e8e8b2882 Mon Sep 17 00:00:00 2001 From: kfrn Date: Sun, 30 Oct 2016 21:13:27 +1300 Subject: [PATCH 2/7] Add further explanation of .VOB files --- index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 9fd7214..de9c97b 100644 --- a/index.html +++ b/index.html @@ -373,14 +373,15 @@

Convert DVD to H.264

ffmpeg -i concat:input_file1\|input_file2\|input_file3 -c:v libx264 -c:a copy output_file.mp4

-

This command allows you to create an H.264 file from a DVD source.

+

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.

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
The backslash is simply an escape character for the pipe (|).
-c:v libx264
sets the codec as H.264
-
-c:a copy
audio remains as-is (it is not reencoded)
+
-c:a copy
audio remains as-is (no re-encode)
output_file.mp4
path and name of the output file.

It's also possible to adjust the quality of your output by setting the -crf and -preset values:

@@ -394,7 +395,7 @@

ffmpeg -i concat:input_file1\|input_file2 -map 0:v -map 0:a -c:v libx264 -c:a copy output_file.mp4

-map 0:v
encodes all video streams
-
-map 0:a
encodes all audio streams
+
-map 0:a
encodes all audio streams.
From b99d80f2e04b2075b7d9b3ce1aee7d61d543ca61 Mon Sep 17 00:00:00 2001 From: kfrn Date: Sun, 30 Oct 2016 21:15:51 +1300 Subject: [PATCH 3/7] Update instructions on sample example --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index de9c97b..9f62abf 100644 --- a/index.html +++ b/index.html @@ -1297,14 +1297,14 @@ e.g.: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output_file + + + + + From fb2e571806818eb38dd51414486261a51502550d Mon Sep 17 00:00:00 2001 From: kfrn Date: Mon, 31 Oct 2016 07:54:36 +1300 Subject: [PATCH 6/7] Minor text edits (punctuation, clarification) --- index.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 9f62abf..794e7cd 100644 --- a/index.html +++ b/index.html @@ -374,28 +374,28 @@

Convert DVD to H.264

ffmpeg -i concat:input_file1\|input_file2\|input_file3 -c:v libx264 -c:a copy 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.

+

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 codec as H.264
+
-c:v libx264
sets the video codec as H.264
-c:a copy
audio remains as-is (no re-encode)
-
output_file.mp4
path and name of the output file.
+
output_file.mp4
path and name of the output file
-

It's also possible to adjust the quality of your output by setting the -crf and -preset values:

+

It’s also possible to adjust the quality of your output by setting the -crf and -preset values:

ffmpeg -i concat:input_file1\|input_file2\|input_file3 -c:v libx264 -crf 18 -preset veryslow -c:a copy output_file.mp4

-crf 18
sets the constant rate factor to a visually lossless value. Libx264 defaults to a crf of 23, considered medium quality; a smaller crf value produces a larger and higher quality video.
-preset veryslow
A slower preset will result in better compression and therefore a higher-quality file. The default is medium; slower presets are slow, slower, and veryslow.
-

Bear in mind that by default, libx264 will only encode a single video stream and a single audio stream, picking the 'best' of the options available. To preserve all video and audio streams, add -map parameters:

+

Bear in mind that by default, libx264 will only encode a single video stream and a single audio stream, picking the ‘sbest’ of the options available. To preserve all video and audio streams, add -map parameters:

ffmpeg -i concat:input_file1\|input_file2 -map 0:v -map 0:a -c:v libx264 -c:a copy output_file.mp4

-map 0:v
encodes all video streams
-
-map 0:a
encodes all audio streams.
+
-map 0:a
encodes all audio streams
From 99e45016574671f222cd9806dbbb60b2d7874800 Mon Sep 17 00:00:00 2001 From: kfrn Date: Mon, 31 Oct 2016 07:56:50 +1300 Subject: [PATCH 7/7] Fix typo --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 794e7cd..9196d6e 100644 --- a/index.html +++ b/index.html @@ -391,7 +391,7 @@
-crf 18
sets the constant rate factor to a visually lossless value. Libx264 defaults to a crf of 23, considered medium quality; a smaller crf value produces a larger and higher quality video.
-preset veryslow
A slower preset will result in better compression and therefore a higher-quality file. The default is medium; slower presets are slow, slower, and veryslow.
-

Bear in mind that by default, libx264 will only encode a single video stream and a single audio stream, picking the ‘sbest’ of the options available. To preserve all video and audio streams, add -map parameters:

+

Bear in mind that by default, libx264 will only encode a single video stream and a single audio stream, picking the ‘best’ of the options available. To preserve all video and audio streams, add -map parameters:

ffmpeg -i concat:input_file1\|input_file2 -map 0:v -map 0:a -c:v libx264 -c:a copy output_file.mp4

-map 0:v
encodes all video streams