<p>The same as with any interlaced footage: yadif</p>

<pre><code>ffmpeg -i in.mpg -vf yadif out.mp4
</code></pre>

<p>(I've skipped the encoding parameters)</p>

CC BY-SA 3.0
2016-11-28T05:19:59.880Z
Thanks, I'll test this answer as soon as I get back to my work machine.  Are there no special parameters to pass in to apply different filters?  I've done some compression before but am generally new to `yadif`.  What if the source was NTSC or film?  Wouldn't the interlacing be different?  How does `yadif` know the difference?
JAL
CC BY-SA 3.0
2016-11-28T05:41:42.707Z
The video stream with its context (resolution, rate..etc) is passed along to a filter when executed.
Gyan
CC BY-SA 3.0
2016-11-28T05:45:11.330Z
If the source was film, it wouldn't be interlaced. The pulldown applied during telecine (24->30) can be reversed using the detelecine filter.
Gyan
CC BY-SA 3.0
2016-11-28T18:35:21.013Z
@JAL Other deinterlacing filters to try are [nnedi](http://ffmpeg.org/ffmpeg-filters.html#nnedi) and [w3fdif](http://ffmpeg.org/ffmpeg-filters.html#w3fdif).
llogan
CC BY-SA 3.0
2017-12-06T20:26:35.487Z
@Mulvya I know you are an expert on ffmpeg, but I think your advice here may not be good, because you are giving the message that it is *always* the right thing to do to demote a 50 Hz footage to 25 Hz. Depending on the shutter speed and the amount of pan/zoom, the resulting 25 Hz can look really crappy. The yadif filter alone drops half of the fields. Without any more information, the OP is safer with -vf "yadif=1" that generates 50p from 50i, and not 25p like in your code. I have nothing to say if the footage is a TV render of a classic movie, but in any other case, 50i to 25p is disastrous.
Mephisto
CC BY-SA 3.0
2017-12-06T20:36:01.580Z
@Mulvya And the footage is likely not a classic movie, otherwise the OP would have much better and easier ways to get a copy of it, than a SDTV capture... It is most likely TV footage: a documentary, a sitcom chapter, news, who knows. TV footage is meant to be shot at 50 fps (in Europe) and the director acts accordingly, using other artistic resources: fast zoom, pan, hand-held shaking camera for subjective views, high shutter speed, low or no depth of field... Dropping half of the frames demoting the footage to 25p gives very ugly results, nothing to to with "cinema look".
Mephisto
CC BY-SA 3.0
2017-12-07T05:35:27.260Z
The filter settings can be tweaked based on the results. The answer is a basic template for which filter to use. If the OP had an issue with the results, they presumably would have gotten back with "*this filter is crap*". `yadif` is written by a German dev, i.e. someone lives in PAL territory, so I assume they chose defaults that work for the samples it was tested on.
Gyan
CC BY-SA 3.0
2016-11-28T04:55:32.800Z
2016-11-28T04:55:32.800Z
Gyan
<p>I don't agree that the other answer is a good idea in general, because "-vf yadif" will drop half the frames, thus resulting in a poor substitute of the original footage. Here is the thing: 576i25 means that you have 50 interlaced fields per second, rendering motion of objects fluid and natural to the human eye. You can get a high speed video at 50 frames per second easily by means of this:</p>

<pre><code>ffmpeg -i in.mpg -vf yadif=1 out.mp4
</code></pre>

<p>Please note the difference, i.e. yadif=1 is specified. If you don't give a value, the yadif filter defaults to yadif=0 which cuts the frame rate of TV footage in 2.</p>

<p>Some people think that, because 25 fps is close to the theatrical movie speed (24p), the resulting video should look better, right?. Big mistake. The director of any project for TV had in mind that the target medium was TV and acted accordingly, using different techniques and taking a different artistic approach, allowing for instance a lot of fast movement, pan and zoom, or a hand-held camera to give a more subjective point of view. Also, a higher shutter speed is usual in TV without producing the nasty stroboscopic look because the frame rate is high. But later, when that footage gets converted to half frame rate the result is not "cinema look" but simply bad TV footage with stroboscopic movement.</p>

CC BY-SA 4.0
2019-08-12T04:46:00.253Z
Thanks for the good answer.  So many articles on the web seem to get this wrong! To achieve the same thing in Handbrake, in the *Filters* tab you need to choose `Deinterlace: Yadif` and `Deinterlace Preset: Bob`. (Or you may also be able to choose Decomb + Bob, I'm not sure which is technically better.)
Simon East
CC BY-SA 4.0
2019-08-12T04:59:41.113Z
(Update to my previous comment: When using Decomb (as opposed to Yadif) it auto-detects the frames where interlacing is present and deinterlaces only those, although beware that it [won't always get it correct](https://forum.doom9.org/showthread.php?p=1675763#post1675763).)
Simon East
CC BY-SA 4.0
2019-08-12T17:42:35.570Z
@SimonEast so does yadif (add deint=1).
Gyan
CC BY-SA 3.0
2017-12-08T20:35:59.000Z
2017-12-08T22:50:28.077Z
2017-12-08T22:50:28.077Z
Mephisto
<p>I have a PAL MPEG-2 576i 25fps raw capture (presumably either straight from satellite or a DVD recorder) that I would like to encode to AVC.  I'd like to deinterlace the file during compression with either ffmpeg or some other tool (maybe a frontend like Handbrake?).</p>

<p>What deinterlacing filter should I use with PAL 576i raw footage?</p>

<video><ffmpeg><encoding><compression>
What deinterlacing filter should I use to encode/compress a PAL MPEG-2 576i 25fps raw file?
JAL
# What deinterlacing filter should I use to encode/compress a PAL MPEG-2 576i 25fps raw file?

(Asked by: username_0 on 2016-11-28)

I have a PAL MPEG-2 576i 25fps raw capture (presumably either straight from satellite or a DVD recorder) that I would like to encode to AVC. I'd like to deinterlace the file during compression with either ffmpeg or some other tool (maybe a frontend like Handbrake?).

What deinterlacing filter should I use with PAL 576i raw footage?

**Tags:** video, ffmpeg, encoding, compression


---

## 2 answers

### Answer by username_3 on 2017-12-08. Score: 4 | Accepted answer

I don't agree that the other answer is a good idea in general, because "-vf yadif" will drop half the frames, thus resulting in a poor substitute of the original footage. Here is the thing: 576i25 means that you have 50 interlaced fields per second, rendering motion of objects fluid and natural to the human eye. You can get a high speed video at 50 frames per second easily by means of this:
ffmpeg -i in.mpg -vf yadif=1 out.mp4

Please note the difference, i.e. yadif=1 is specified. If you don't give a value, the yadif filter defaults to yadif=0 which cuts the frame rate of TV footage in 2.
Some people think that, because 25 fps is close to the theatrical movie speed (24p), the resulting video should look better, right?. Big mistake. The director of any project for TV had in mind that the target medium was TV and acted accordingly, using different techniques and taking a different artistic approach, allowing for instance a lot of fast movement, pan and zoom, or a hand-held camera to give a more subjective point of view. Also, a higher shutter speed is usual in TV without producing the nasty stroboscopic look because the frame rate is high. But later, when that footage gets converted to half frame rate the result is not "cinema look" but simply bad TV footage with stroboscopic movement.

> **Comments:**
> **username_4**: Thanks for the good answer.  So many articles on the web seem to get this wrong! To achieve the same thing in Handbrake, in the *Filters* tab you need to choose `Deinterlace: Yadif` and `Deinterlace Preset: Bob`. (Or you may also be able to choose Decomb + Bob, I'm not sure which is technically better.)  
> **username_4**: (Update to my previous comment: When using Decomb (as opposed to Yadif) it auto-detects the frames where interlacing is present and deinterlaces only those, although beware that it [won't always get it correct](https://forum.doom9.org/showthread.php?p=1675763#post1675763).)  
> **username_1**: @SimonEast so does yadif (add deint=1).  

---

### Answer by username_1 on 2016-11-28. Score: -1

The same as with any interlaced footage: yadif
ffmpeg -i in.mpg -vf yadif out.mp4

(I've skipped the encoding parameters)

> **Comments:**
> **username_0**: Thanks, I'll test this answer as soon as I get back to my work machine.  Are there no special parameters to pass in to apply different filters?  I've done some compression before but am generally new to `yadif`.  What if the source was NTSC or film?  Wouldn't the interlacing be different?  How does `yadif` know the difference?  
> **username_1**: The video stream with its context (resolution, rate..etc) is passed along to a filter when executed.  
> **username_1**: If the source was film, it wouldn't be interlaced. The pulldown applied during telecine (24->30) can be reversed using the detelecine filter.  
> **username_2**: @username_0 Other deinterlacing filters to try are [nnedi](http://ffmpeg.org/ffmpeg-filters.html#nnedi) and [w3fdif](http://ffmpeg.org/ffmpeg-filters.html#w3fdif).  
> **username_3**: @Mulvya I know you are an expert on ffmpeg, but I think your advice here may not be good, because you are giving the message that it is *always* the right thing to do to demote a 50 Hz footage to 25 Hz. Depending on the shutter speed and the amount of pan/zoom, the resulting 25 Hz can look really crappy. The yadif filter alone drops half of the fields. Without any more information, the OP is safer with -vf "yadif=1" that generates 50p from 50i, and not 25p like in your code. I have nothing to say if the footage is a TV render of a classic movie, but in any other case, 50i to 25p is disastrous.  
> **username_3**: @Mulvya And the footage is likely not a classic movie, otherwise the OP would have much better and easier ways to get a copy of it, than a SDTV capture... It is most likely TV footage: a documentary, a sitcom chapter, news, who knows. TV footage is meant to be shot at 50 fps (in Europe) and the director acts accordingly, using other artistic resources: fast zoom, pan, hand-held shaking camera for subjective views, high shutter speed, low or no depth of field... Dropping half of the frames demoting the footage to 25p gives very ugly results, nothing to to with "cinema look".  
> **username_1**: The filter settings can be tweaked based on the results. The answer is a basic template for which filter to use. If the OP had an issue with the results, they presumably would have gotten back with "*this filter is crap*". `yadif` is written by a German dev, i.e. someone lives in PAL territory, so I assume they chose defaults that work for the samples it was tested on.  

---

