You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update deinterlacing methods to current best practices
For many years, hardware devices and online streaming platforms
have been capable of 50p or 60p output, so the older advice of
deinterlacing 25i/30i to 25p/30p is no longer necessary. For matching
the fidelity of interlaced sources as they were originally viewed on
period hardware, each field should be output to its own frame, producing
50p content from 25i sources, and 60p content from 30i sources. These
updates to ffmprovisr reflect that.
Additionally, the deinterlacing filter advice of yadif or w3fdif has
been changed to bwdif, which combines the best attributes of both older
filters.
<dt>-i <em>input_file</em></dt><dd>path, name and extension of the input file</dd>
1361
1361
<dt>-c:v libx264</dt><dd>encodes video stream with libx264 (h264)</dd>
1362
1362
<dt>-filter:v</dt><dd>a video filter will be used</dd>
1363
1363
<dt>"</dt><dd>quotation mark to start filtergraph</dd>
1364
-
<dt>yadif</dt><dd>deinterlacing filter (‘yet another deinterlacing filter’)<br>
1365
-
By default, <ahref="https://ffmpeg.org/ffmpeg-filters.html#yadif-1" target="_blank">yadif</a> will output one frame for each frame. Outputting one frame for each <em>field</em> (thereby doubling the frame rate) with <code>yadif=1</code> may produce visually better results.</dd>
1364
+
<dt>idet</dt><dd>detect interlaced video field order<br>
1365
+
<ahref="https://ffmpeg.org/ffmpeg-filters.html#idet" target="_blank">idet</a> 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.</dd>
By default, <ahref="https://ffmpeg.org/ffmpeg-filters.html#bwdif-1" target="_blank">bwdif</a> will output one frame for each field, matching the visual cadence of interlaced video. Outputting one frame for each <em>frame</em> (thereby halving the number of output frames per second) with <code>bwdif=mode=send_frame</code> can be used when the presentation device is not capable of reproducing 50 (PAL) or 60 (NTSC) frames per second.</dd>
1366
1368
<dt>scale=1440:1080:flags=lanczos</dt><dd>resizes the image to 1440x1080, using the Lanczos scaling algorithm, which is slower but better than the default bilinear algorithm.</dd>
1367
1369
<dt>pad=1920:1080:(ow-iw)/2:(oh-ih)/2</dt><dd>pads the area around the 4:3 input video to create a 16:9 output video</dd>
1368
1370
<dt>format=yuv420p</dt><dd>specifies a pixel format of Y′C<sub>B</sub>C<sub>R</sub> 4:2:0</dd>
@@ -1379,24 +1381,26 @@ <h5>Upscaled, Pillar-boxed HD H.264 Access Files from SD NTSC source</h5>
<p>This command takes an interlaced input file and outputs a deinterlaced H.264 MP4.</p>
1384
1386
<dl>
1385
1387
<dt>ffmpeg</dt><dd>starts the command</dd>
1386
1388
<dt>-i <em>input file</em></dt><dd>path, name and extension of the input file</dd>
1387
1389
<dt>-c:v libx264</dt><dd>tells FFmpeg to encode the video stream as H.264</dd>
1388
1390
<dt>-vf</dt><dd>video filtering will be used (<code>-vf</code> is an alias of <code>-filter:v</code>)</dd>
1389
1391
<dt>"</dt><dd>start of filtergraph (see below)</dd>
1390
-
<dt>yadif</dt><dd>deinterlacing filter (‘yet another deinterlacing filter’)<br>
1391
-
By default, <ahref="https://ffmpeg.org/ffmpeg-filters.html#yadif-1" target="_blank">yadif</a> will output one frame for each frame. Outputting one frame for each <em>field</em> (thereby doubling the frame rate) with <code>yadif=1</code> may produce visually better results.</dd>
1392
+
<dt>idet</dt><dd>detect interlaced video field order<br>
1393
+
<ahref="https://ffmpeg.org/ffmpeg-filters.html#idet" target="_blank">idet</a> 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.</dd>
By default, <ahref="https://ffmpeg.org/ffmpeg-filters.html#bwdif-1" target="_blank">bwdif</a> will output one frame for each field, matching the visual cadence of interlaced video. Outputting one frame for each <em>frame</em> (thereby halving the number of output frames per second) with <code>bwdif=mode=send_frame</code> can be used when the presentation device is not capable of reproducing 50 (PAL) or 60 (NTSC) frames per second.</dd>
1392
1396
<dt>,</dt><dd>separates filters</dd>
1393
1397
<dt>format=yuv420p</dt><dd>chroma subsampling set to 4:2:0<br>
1394
1398
By default, <code>libx264</code> will use a chroma subsampling scheme that is the closest match to that of the input. This can result in Y′C<sub>B</sub>C<sub>R</sub> 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.</dd>
1395
1399
<dt>"</dt><dd>end of filtergraph</dd>
1396
1400
<dt><em>output file</em></dt><dd>path, name and extension of the output file</dd>
1397
1401
</dl>
1398
-
<p><code>"yadif,format=yuv420p"</code> is an FFmpeg <ahref="https://trac.ffmpeg.org/wiki/FilteringGuide#FiltergraphChainFilterrelationship" target="_blank">filtergraph</a>. Here the filtergraph is made up of one filter chain, which is itself made up of the two filters (separated by the comma).<br>
1399
-
The enclosing quote marks are necessary when you use spaces within the filtergraph, e.g. <code>-vf "yadif, format=yuv420p"</code>, and are included above as an example of good practice.</p>
1402
+
<p><code>"idet,bwdif,format=yuv420p"</code> is an FFmpeg <ahref="https://trac.ffmpeg.org/wiki/FilteringGuide#FiltergraphChainFilterrelationship" target="_blank">filtergraph</a>. Here the filtergraph is made up of one filter chain, which is itself made up of the three filters (separated by the comma).<br>
1403
+
The enclosing quote marks are necessary when you use spaces within the filtergraph, e.g. <code>-vf "idet, bwdif, format=yuv420p"</code>, and are included above as an example of good practice.</p>
1400
1404
<p><strong>Note:</strong> FFmpeg includes several deinterlacers apart from <ahref="https://ffmpeg.org/ffmpeg-filters.html#yadif-1" target="_blank">yadif</a>: <ahref="https://ffmpeg.org/ffmpeg-filters.html#bwdif" target="_blank">bwdif</a>, <ahref="https://ffmpeg.org/ffmpeg-filters.html#w3fdif" target="_blank">w3fdif</a>, <ahref="https://ffmpeg.org/ffmpeg-filters.html#kerndeint" target="_blank">kerndeint</a>, and <ahref="https://ffmpeg.org/ffmpeg-filters.html#nnedi" target="_blank">nnedi</a>.</p>
1401
1405
<p>For more H.264 encoding options, see the latter section of the <ahref="#transcode_h264">encode H.264 command</a>.</p>
0 commit comments