diff --git a/img/deinterlaced_video_frames.png b/img/deinterlaced_video_frames.png new file mode 100644 index 0000000..2903336 Binary files /dev/null and b/img/deinterlaced_video_frames.png differ diff --git a/img/interlaced_video_fields.png b/img/interlaced_video_fields.png new file mode 100644 index 0000000..7038976 Binary files /dev/null and b/img/interlaced_video_fields.png differ diff --git a/index.html b/index.html index 5a90dd1..0d27ba3 100644 --- a/index.html +++ b/index.html @@ -1354,17 +1354,15 @@
Upscaled, Pillar-boxed HD H.264 Access Files from SD NTSC source
-

ffmpeg -i input_file -c:v libx264 -filter:v "idet, bwdif, scale=1440:1080:flags=lanczos, pad=1920:1080:(ow-iw)/2:(oh-ih)/2, format=yuv420p" output_file

+

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

ffmpeg
starts the command
-i input_file
path, name and extension of the input file
-c:v libx264
encodes video stream with libx264 (h264)
-filter:v
a video filter will be used
"
quotation mark to start filtergraph
-
idet
detect interlaced video field order
- idet will try to detect if the video is interlaced, and if so, what the order of the fields are (top-field-first, or bottom-field-first). This is done to ensure the output of the deinterlacing filter is correct.
-
bwdif
deinterlacing filter (‘Bob Weaver Deinterlacing Filter’)
- By default, bwdif will output one frame for each field, matching the visual cadence of interlaced video. Outputting one frame for each frame (thereby halving the number of output frames per second) with bwdif=mode=send_frame can be used when the presentation device is not capable of reproducing 50 (PAL) or 60 (NTSC) frames per second.
+
yadif
deinterlacing filter (‘yet another deinterlacing filter’)
+ By default, yadif will output one frame for each frame. Outputting one frame for each field (thereby doubling the frame rate) with yadif=1 may produce visually better results.
scale=1440:1080:flags=lanczos
resizes the image to 1440x1080, using the Lanczos scaling algorithm, which is slower but better than the default bilinear algorithm.
pad=1920:1080:(ow-iw)/2:(oh-ih)/2
pads the area around the 4:3 input video to create a 16:9 output video
format=yuv420p
specifies a pixel format of Y′CBCR 4:2:0
@@ -1381,7 +1379,7 @@
Deinterlace a video
-

ffmpeg -i input_file -c:v libx264 -vf "idet,bwdif,format=yuv420p" output_file

+

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.

ffmpeg
starts the command
@@ -1389,18 +1387,16 @@
-c:v libx264
tells FFmpeg to encode the video stream as H.264
-vf
video filtering will be used (-vf is an alias of -filter:v)
"
start of filtergraph (see below)
-
idet
detect interlaced video field order
- idet will try to detect if the video is interlaced, and if so, what the order of the fields are (top-field-first, or bottom-field-first). This is done to ensure the output of the deinterlacing filter is correct.
-
bwdif
deinterlacing filter (‘Bob Weaver Deinterlacing Filter’)
- By default, bwdif will output one frame for each field, matching the visual cadence of interlaced video. Outputting one frame for each frame (thereby halving the number of output frames per second) with bwdif=mode=send_frame can be used when the presentation device is not capable of reproducing 50 (PAL) or 60 (NTSC) frames per second.
+
yadif
deinterlacing filter (‘yet another deinterlacing filter’)
+ By default, yadif will output one frame for each frame. Outputting one frame for each field (thereby doubling the frame rate) with yadif=1 may produce visually better results.
,
separates filters
format=yuv420p
chroma subsampling set to 4:2:0
By default, 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.
"
end of filtergraph
output file
path, name and extension of the output file
-

"idet,bwdif,format=yuv420p" is an FFmpeg filtergraph. Here the filtergraph is made up of one filter chain, which is itself made up of the three filters (separated by the comma).
- The enclosing quote marks are necessary when you use spaces within the filtergraph, e.g. -vf "idet, bwdif, format=yuv420p", and are included above as an example of good practice.

+

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

@@ -1413,6 +1409,43 @@
+ + + +
+
Deinterlace video fields to frames
+

ffmpeg -i input_file -c:v libx264 -vf "idet,bwdif,format=yuv420p" output_file

+

This command takes an interlaced input file and outputs a deinterlaced H.264 MP4, with each field separated into its own frame. This is preferred for interlaced video that contains a lot of motion, as the double-rate output preserves the visual cadence of the source material.

+
+
ffmpeg
starts the command
+
-i input file
path, name and extension of the input file
+
-c:v libx264
tells FFmpeg to encode the video stream as H.264
+
-vf
video filtering will be used (-vf is an alias of -filter:v)
+
"
start of filtergraph (see below)
+
idet
detect interlaced video field order
+ idet will try to detect if the video is interlaced, and if so, what the order of the fields are (top-field-first, or bottom-field-first). This is done to ensure the output of the deinterlacing filter is correct.
+
bwdif
deinterlacing filter (‘Bob Weaver Deinterlacing Filter’)
+ By default, bwdif will output one frame for each field, matching the visual cadence of interlaced video.
+
,
separates filters
+
format=yuv420p
chroma subsampling set to 4:2:0
+ By default, 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.
+
"
end of filtergraph
+
output file
path, name and extension of the output file
+
+

"idet,bwdif,format=yuv420p" is an FFmpeg filtergraph. Here the filtergraph is made up of one filter chain, which is itself made up of the three filters (separated by the comma).
+ The enclosing quote marks are necessary when you use spaces within the filtergraph, e.g. -vf "idet, bwdif, format=yuv420p", and are included above as an example of good practice.

+

Note: bwdif also supports the older method of outputting one frame for each frame (thereby halving the number of output frames per second) with the syntax bwdif=mode=send_frame. This can be used when the presentation device is not capable of reproducing 50 (PAL) or 60 (NTSC) frames per second.

+

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

+
+

Example

+

Before and after deinterlacing with bwdif:

+ VLC screenshot of original interlaced video + VLC screenshot of deinterlaced video +
+ +
+ +