Deinterlace / Detelecine (Automation)

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
justincase
Bright Spark User
Posts: 152
Joined: Sun Nov 22, 2009 1:09 am

Deinterlace / Detelecine (Automation)

Post by justincase »

Description of problem or question:
I want to create a profile that suits all my encodings.
I don't want to bother with different settings for 480p/1080p/4k / 8,10,12 bit / deinterlaced or not etc. and other stuff, I rather let the program figure it out on its own.

My current profile looks like this:
- Codec: h.265 (12 bit)
- Constant Quality (CQ): 16
- Preset: Slow

Now the Filters-Tab:
- Detelecine: Default
- Interlace-Detection: Default
- Deinterlace: Decomb -> EEDI2

My question is about the Filters-Tab:
I only want to detelecine / deinterlace material that needs deinterlacing. I don't want to deinterlace every single file if it is not necessary.
Are the settings above ensuring, that Handbrake looks for interlaced material and ONLY deinterlaces / detelecines IF according material is found and IF NOT it won't apply deinterlacing / detelecining at all?
Or do I have to enable/disable deinterlacing manually every single time I want to encode something? That would be rather unconvenient.

HandBrake version (e.g., 1.0.0):
v. 1.6.1 (2023012300)

Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Windows 10 x64

Thanks in advance!
Greets
Lostless
Bright Spark User
Posts: 155
Joined: Thu May 24, 2007 7:55 pm

Re: Deinterlace / Detelecine (Automation)

Post by Lostless »

With the above settings, it’s automatic and a catch all, but handbrake should only deinterlace frames that need it. But it can falsely detect interlacing sometimes. There is no perfect way to do this. Also I recommend doing a bob deinterlace with frame rate set to same as source. That will retrieve any 60fps (ntsc) or 50fps (pal) material out of the interlacing if there. The eedi2 is very slow and my not be worth the slightly extra quality it provides.
But the catch all isn’t always the best way to make a generic profile for everything without some possible issues. Each option is tuned to what your source is. Like having the deinterlacing on a Blu-ray movie could produce false positive for no reason and blur a few frames. Where having Bob deinterlacing on for a DVD movie, will possibly lead to unwanted duplicate frames and larger file sizes. Also, each setting is tuned for the specific resolution for the best quality.
In the end, It’s best to use the settings that is the best for your source because the catch all method is best for only mixed material where the source has multiple frame rates.
Lostless
Bright Spark User
Posts: 155
Joined: Thu May 24, 2007 7:55 pm

Re: Deinterlace / Detelecine (Automation)

Post by Lostless »

With the above settings, it’s automatic and a catch all, but handbrake should only deinterlace frames that need it. But it can falsely detect interlacing sometimes. There is no perfect way to do this. Also I recommend doing a bob deinterlace with frame rate set to same as source. That will retrieve any 60fps (ntsc) or 50fps (pal) material out of the interlacing if there. The eedi2 is very slow and my not be worth the slightly extra quality it provides.
But the catch all isn’t always the best way to make a generic profile for everything without some possible issues. Each option is tuned to what your source is. Like having the deinterlacing on a Blu-ray movie could produce false positive for no reason and blur a few frames. Where having Bob deinterlacing on for a DVD movie, will possibly lead to unwanted duplicate frames and larger file sizes. Also, each setting is tuned for the specific resolution for the best quality.
In the end, It’s best to use the settings that is the best for your source because the catch all method is best for only mixed material where the source has multiple frame rates.
justincase
Bright Spark User
Posts: 152
Joined: Sun Nov 22, 2009 1:09 am

Re: Deinterlace / Detelecine (Automation)

Post by justincase »

Lostless wrote: Thu May 25, 2023 4:24 pm But it can falsely detect interlacing sometimes.
ok I see. So how likely are false detections? Why is HB not reading the media info for the file encoded? In MediaInfo it normally shows: progressive or interlaced and most of the time even the method like top/bottom interlaced etc. So ideal conditions for HB to pick the best option.
Lostless wrote: Thu May 25, 2023 4:24 pm Also I recommend doing a bob deinterlace with frame rate set to same as source. That will retrieve any 60fps (ntsc) or 50fps (pal) material out of the interlacing if there. The eedi2 is very slow and my not be worth the slightly extra quality it provides.
I don't have problems with a slow encode, I prefer quality over quantity. Besides deinterlacing is only needed for 480p material (at least most of the time) so the encoding time on those small files is pretty short anyhow, no matter the deinterlacing method.
But the 60/50 (NTSC/PAL) thing irritates me. What exactly do you mean? EEDI2 shouldn't be that much different to Bob or is it? Normally the overall quality of EEDI2 is superior to Bob but I haven't seen every scenario yet.
Lostless wrote: Thu May 25, 2023 4:24 pm But the catch all isn’t always the best way to make a generic profile for everything without some possible issues.
Ye totally agree. But I want to make it as easy as possible. And yes, I definitely don't want deinterlacing on BD material, not even accidently.
Guess I have to turn it on/off manually then if the error rate on the detection is too big.
Deleted User 11865

Re: Deinterlace / Detelecine (Automation)

Post by Deleted User 11865 »

justincase wrote: Thu May 25, 2023 4:34 pm
Lostless wrote: Thu May 25, 2023 4:24 pm But it can falsely detect interlacing sometimes.
ok I see. So how likely are false detections? Why is HB not reading the media info for the file encoded? In MediaInfo it normally shows: progressive or interlaced and most of the time even the method like top/bottom interlaced etc. So ideal conditions for HB to pick the best option.
That info is not always reliable (especially on old content which is most likely to be interlaced). Interlace Detection instead looks for actual interlacing artifacts to determine whether any specific frame is interlaced or not, and does a fairly good job at it (not perfect, but usually good enough, and definitely better than going by the frame progressive/interlaced flags alone in many cases).
Lostless
Bright Spark User
Posts: 155
Joined: Thu May 24, 2007 7:55 pm

Re: Deinterlace / Detelecine (Automation)

Post by Lostless »

For your first question, handbrake, as far as I know and from using for years, does not even read if a sources meta data, And treats every source as a progressive input. I have noticed false positives when there’s a bunch of it lines like powerlines or horizontal shades on a window in the background, ect. Anything that could be misinterpreted as horizontal lines. It’s not that noticeable, but you do notice a slight flicker on the edges of objects for a second on the frames that have been improperly deinterlace.
Eedi2 is just how it’s going to deinterlace and deals in the spacial domain. It probably has better spatial awareness the basic decomb to reproduce a frame with as much detail as it can.
Bob on the other hand, deals in the temporal domain. It deals with what do you do with the two fields. Interlace video is actually holding 60 frames per second of temporal information, in the bandwidth of 30 at the cost of vertical resolution. So bob will extract both fields and makes separate frames. It’s complicated and I’m sure you can find any resources out there and that can explain it to you if interested.
Hope this helps.
justincase
Bright Spark User
Posts: 152
Joined: Sun Nov 22, 2009 1:09 am

Re: Deinterlace / Detelecine (Automation)

Post by justincase »

Rodeo wrote: Thu May 25, 2023 4:56 pm That info is not always reliable...
Thanks for the insight, pretty interesting to know!
So as expert, do you recommend the filters tab as shown above or do you recommend turning deinterlacing / detelecining on or off manually?
I can live with an error rate up to 1% :wink:
Lostless wrote: Thu May 25, 2023 5:00 pm Hope this helps.
It does, thanks a lot for your help!
Lostless
Bright Spark User
Posts: 155
Joined: Thu May 24, 2007 7:55 pm

Re: Deinterlace / Detelecine (Automation)

Post by Lostless »

I’m no expert, just understand this stuff. I recommend you use a proper setting for the source that you are converting. Even if you have to make multiple presets for yourself.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Deinterlace / Detelecine (Automation)

Post by mduell »

12 bit is silly and has limited playback support.

You really need different presets for wildly different resolutions because they need different quality targets.

Also generally leave deinterlace/detelecine on for the lower resolution content, and off for the higher resolution content.
justincase
Bright Spark User
Posts: 152
Joined: Sun Nov 22, 2009 1:09 am

Re: Deinterlace / Detelecine (Automation)

Post by justincase »

Lostless wrote: Thu May 25, 2023 5:38 pm I’m no expert, just understand this stuff. I recommend you use a proper setting for the source that you are converting. Even if you have to make multiple presets for yourself.
Ok sounds like the best solution, thanks.
I know we are kinda drifitng off of the original topic but is there a guideline on when to use Bob and when to use EEDI2?
Or are you using Bob for every deinterlace you do?
mduell wrote: Thu May 25, 2023 5:58 pm 12 bit is silly and has limited playback support.
Kinda. For now I'm only watching files on my PC and it plays just fine there. I don't really need GPU acceleration, my CPU is from 2013 and still more than capable of decoding it on its own without the GPU.
At the time I buy myself a TV for the living room in a few years 12 bit and 4k will be the new standard :wink:
I just give the encoder the maximum freedom to pick the colours it wants to choose. 10 bit is recommended anyway, so why not go the next step to over 60 billion colours (a.k.a. 12 bit)? Definitely future proofed and the maximal quality I can encode today with absolutely no downsides (except the missing GPU acceleration for now) :D
mduell wrote: Thu May 25, 2023 5:58 pm You really need different presets for wildly different resolutions because they need different quality targets.
Not really. I settled on CQ: 16 as good compromise. For 1080p it is a really good value. For 480p it is slightly over the top but it doesn't matter. For 4k it looks fine as well so far, but maybe I go to CQ: 14/12 in the future for 4k, who knows.
mduell wrote: Thu May 25, 2023 5:58 pm Also generally leave deinterlace/detelecine on for the lower resolution content, and off for the higher resolution content.
Alright, I will do that.
justincase
Bright Spark User
Posts: 152
Joined: Sun Nov 22, 2009 1:09 am

Re: Deinterlace / Detelecine (Automation)

Post by justincase »

Lostless wrote: Thu May 25, 2023 5:38 pm I’m no expert, just understand this stuff. I recommend you use a proper setting for the source that you are converting. Even if you have to make multiple presets for yourself.
Or how about the compromise "EEDI2 Bob"? Best of both or worst of both? :D
Lostless
Bright Spark User
Posts: 155
Joined: Thu May 24, 2007 7:55 pm

Re: Deinterlace / Detelecine (Automation)

Post by Lostless »

Well the 2 have different goals. A basic Bob will just take one field make frame 1 and take field 2 and make field 2 which leads to a flickery mess. If you don’t use a Bob, you throw away half of the Fields (and half your temporal resolution ) lead into a 30 frames per second output. The deinterlacer of choice is what generates the frames (pictures) and takes into account of what the other fields are doing to regenerate in a new frame for the best possible spacial resolution.
It all depends on what your needs are. If you’re just doing movies, a Bob is not even necessary. If you’re converting home VHS tapes or interlace material off TV, then the Bob may help to keep the smoothness of the original video.
The best thing is to know what your source is, and use the proper settings
Lostless
Bright Spark User
Posts: 155
Joined: Thu May 24, 2007 7:55 pm

Re: Deinterlace / Detelecine (Automation)

Post by Lostless »

https://www.100fps.com/
Should help explain
justincase
Bright Spark User
Posts: 152
Joined: Sun Nov 22, 2009 1:09 am

Re: Deinterlace / Detelecine (Automation)

Post by justincase »

Lostless wrote: Thu May 25, 2023 6:40 pm Well the 2 have different goals.
Ok thanks. I'm not deinterlacing often, so I'm lacking experience. But to be frank here, I don't need to become an expert on that subject. I simply don't use it often enough.
I was kinda hoping for an easy answer like pick this if you have this and pick that if you have that.
But I guess it is not that simple.

I found this video on Youtube: https://www.youtube.com/watch?v=LrWw2iYqEQM
EEDI2 definitely looks the best there in comparison. That might not hold up for every kind of material but I'll take it as my own personal guideline from now on.
-> EEDI2+Bob sounds interesting as well, but I will have to do research on that before figuring out if that is a good compromise between the two.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Deinterlace / Detelecine (Automation)

Post by mduell »

justincase wrote: Thu May 25, 2023 5:59 pm
mduell wrote: Thu May 25, 2023 5:58 pm You really need different presets for wildly different resolutions because they need different quality targets.
Not really. I settled on CQ: 16 as good compromise. For 1080p it is a really good value. For 480p it is slightly over the top but it doesn't matter. For 4k it looks fine as well so far, but maybe I go to CQ: 14/12 in the future for 4k, who knows.
You're moving in the wrong direction - with higher resolution, you can go to higher CQ targets.

But since you're going silly overkill at all resolutions, ok fine whatever.
justincase
Bright Spark User
Posts: 152
Joined: Sun Nov 22, 2009 1:09 am

Re: Deinterlace / Detelecine (Automation)

Post by justincase »

mduell wrote: Thu May 25, 2023 6:52 pm You're moving in the wrong direction - with higher resolution, you can go to higher CQ targets.
oh ye you are right, my bad.
mduell wrote: Thu May 25, 2023 6:52 pm But since you're going silly overkill at all resolutions, ok fine whatever.
Well, that is true. But since I'm putting time and electricity into it I want to do it properly. Even if that means too much of something. I try to avoid doing the same work again in a few years once another standard comes along like others tend to do it. I'm a code once and for all kind of guy :D
But to be honest, a little overkill on 480p material is not noticeable (neither in encoding duration nor file size) since the input material already is pretty small in comparison (CQ: 16 is a pretty good value for that, although one could go up to 10 for 480p if necessary).
Besides, I wouldn't call CQ:16 a huge/silly overkill for 1080p. It still is within the norm when comparing to others in the forum (although more on the quality side of things of course, I've mentioned my reasons for that above).
I yet have to do more experiments on 4k encoding before settling on a CQ value. Maybe I stick to 16, maybe I switch to 20 or more, who knows.
Post Reply