Log in

View Full Version : Handbrake decomb filters and frame rate


somy
17th January 2014, 09:33
In handbrake it is possible to do deinterlacing with either decomb or deinterlacing filters. As I read in HandBrake's WIKI, decomb filter seems to be a better option because it works for both interlaced and progressive videos. The WIKI page describes how decomb filter works as follows:
•When a frame shows a significant amount of combing, decomb runs a tweaked version of HandBrake's "Slower" deinterlacing filter. That's yadif, a spatially (within one frame) and temporally (between several frames) aware deinterlacer. The tweak is that it uses a looks at more pixels when generating the spatial predictions.
•When a frame is only very slightly combed, decomb runs a blending deinterlacer called a lowpass-5 filter. This preserves more detail from the image than yadif, and in particular prevents noticeable deinterlacing artifacts on progressive video.

My question is, if I use decomb or deinterlacing filter in HandBrake, what frame rate I should choose? The same as source 25i or I should double it to 50 FPS? YADIF has mode 1 which doubles frame rate, does handbrake use that mode when I choose 50 FPS?
Thank you for your input in advance!

Atak_Snajpera
17th January 2014, 13:06
50 fps

somy
17th January 2014, 13:17
50 fps

Hi, thank you for the reply.
If I choose 50 FPS, will handbrake use YADIF mode 1 for deinterlacing automatically or it simply doubles the FPS after deinterlacing? I searched in the forum, but I found some old post saying that HandBrake is not able/good at double the frame rate for deinterlacing, for example the thread below:
http://forum.doom9.org/archive/index.php/t-162972.html

hello_hello
17th January 2014, 14:03
To de-interlace to "full frame rate" with Handbrake I'm pretty sure you need to select Bob as the de-interlacing method (Bob=Yadif, mode 1) and an appropriate constant output frame rate (50fps/59.94fps). Same as source will output 23.976/25p.... I think.... but I don't use Handbrake myself so I could be remembering wrong. The Decomb filter also has a Bob option, so I assume it'd work the same way.
If you select a de-interlacing/decomb method other than Bob with a 50fps frame rate, you'll probably effectively end up with 25fps video, only every frame will be repeated to give you 50fps. If you use the variable frame rate option.... I've no idea what'll happen.

I'm no expert when it comes to de-interlacing but I think the best idea is to de-interlace if the video is interlaced and disable it completely when it isn't. For PAL at least (someone correct me if I'm wrong) it's usually one or the other, so I either de-interlace or I don't.
Alternative you use a filter like Decomb and hope it makes the correct choice most of the time. I can't tell you how well it works as I've not encoded with it much. I did try a few little test encodes a while back and thought it did a good job but I wouldn't take that as gospel. Maybe a Handbrake user will come along....

If you're really fussy about de-interlacing and not married to the idea of using Handbrake, you can't go past QTGMC (http://forum.doom9.org/showthread.php?t=156028). It's not hard to use once you get it working, and if there's progressive sections it shouldn't adversely effect them. In fact it also has a progressive mode which I use regularly. I use MeGUI for encoding and manually replace Yadif with QTGMC in scripts it creates.
Have a look at the samples here (http://forum.videohelp.com/threads/354092-Converting-video-frame-rates?p=2225116&viewfull=1#post2225116) and here (http://forum.videohelp.com/threads/354092-Converting-video-frame-rates?p=2225237&viewfull=1#post2225237).

hello_hello
17th January 2014, 14:13
If I choose 50 FPS, will handbrake use YADIF mode 1 for deinterlacing automatically or it simply doubles the FPS after deinterlacing? I searched in the forum, but I found some old post saying that HandBrake is not able/good at double the frame rate for deinterlacing, for example the thread below:
http://forum.doom9.org/archive/index.php/t-162972.html

As far as I know, Bob de-interlacing was only added to Handbrake fairly recently (sometime last year (http://forum.videohelp.com/threads/354092-Converting-video-frame-rates?p=2225268&viewfull=1#post2225268)), so while that thread was probably correct then, it's wrong now.
It appears Handbrake still won't resize DVD's "up" when resizing to square pixels, which I prefer to do (ie 1024x576 for PAL). I'm pretty sure VidCoder does.

I'll admit I probably assumed Bob = "Yadif mode 1" when I tested it because I couldn't see a difference between Handbrake's "Bob" and MeGUI's "Yadif (with Bob)", which is definitely "Yadif, mode 1".
Unfortunately, Handbrake's log file seems not to be overly specific about it's de-interlacing. When using Bob and a 50fps output frame rate:

Deinterlace (ffmpeg or yadif/mcdeint) (15)

It doesn't mean a lot to me.

somy
17th January 2014, 14:44
As far as I know, Bob de-interlacing was only added to Handbrake fairly recently (sometime last year (http://forum.videohelp.com/threads/354092-Converting-video-frame-rates?p=2225268&viewfull=1#post2225268)), so while that thread was probably correct then, it's wrong now.
It appears Handbrake still won't resize DVD's "up" when resizing to square pixels, which I prefer to do (ie 1024x576 for PAL). I'm pretty sure VidCoder does.

I'll admit I probably assumed Bob = "Yadif mode 1" when I tested it because I couldn't see a difference between Handbrake's "Bob" and MeGUI's "Yadif (with Bob)", which is definitely "Yadif, mode 1".
Unfortunately, Handbrake's log file seems not to be overly specific about it's de-interlacing. When using Bob and a 50fps output frame rate:

Deinterlace (ffmpeg or yadif/mcdeint) (15)

It doesn't mean a lot to me.

Thank you very much for the very helpful reply.
In practice do I gain any PQ improvement with YADIF deinterlacing for doubling FPS to 50 (mode 1) instead of keeping the original 25 FPS (mode 0)? If not, I would probably just keep the original 25 FPS for now.
I also have a hard time to understand why MeGUI is better than HandBrake, aren't they based on the same X264 encoder?

Atak_Snajpera
17th January 2014, 15:41
in fact original fps is 50 not 25. it is just stored in 25i aka 50i. you should deinterlace to 50 if you want keep original smooth motion.

nm
17th January 2014, 18:20
I also have a hard time to understand why MeGUI is better than HandBrake, aren't they based on the same X264 encoder?

Yes, both use x264 for H.264 encoding. If you only compare encoding without any preprocessing, MeGUI is not better than HandBrake as long as both have the same x264 version and same settings. But MeGUI uses AviSynth for filtering, so it's possible to deinterlace with QTGMC. Try it yourself and compare the result to HandBrake's decomb.

hello_hello
17th January 2014, 18:45
Thank you very much for the very helpful reply.
In practice do I gain any PQ improvement with YADIF deinterlacing for doubling FPS to 50 (mode 1) instead of keeping the original 25 FPS (mode 0)? If not, I would probably just keep the original 25 FPS for now.

Definitely. Did you look at the samples I linked to, because to me the difference is obvious. There's a sample of both Yadif and QTGMC at 25fps and 50fps in the zip file.
50fps generally looks a lot smoother in terms of motion. When I compared 25fps to 50fps using ffdshow's de-interlacing filter on playback (Yadif), 50fps looked pretty much the same as if the video card/TV did the de-interlacing. 25fps was noticeably less smooth, or more "jittery", however you'd describe it, so in that respect if the goal is to have an encode which looks as close as possible to the original video, de-interlacing to 50fps when encoding would be fairly mandatory.

I also have a hard time to understand why MeGUI is better than HandBrake, aren't they based on the same X264 encoder?

I wasn't trying to say it's better, although I prefer it myself, only to point out that for quality de-interlacing I don't think anything else matches QTGMC, which would require an encoder capable of opening Avisynth scripts. It wouldn't need to be MeGUI, but MeGUI is a program which lets you modify the scripts it creates fairly easily.
I pretty much struggle to let myself use anything other than QTGMC for de-interlacing these days, although admittedly it's fairly slow. It's one of the few filters I've used.... maybe the only one.... where it's output is pretty much guaranteed to look better than the source video (it's de-interlacing also removes noise and stabilises the picture). Yadif at 50 fps is still pretty good though.

Asmodian
17th January 2014, 21:57
This has already been alluded to but I want to stress it. I always want people to create the highest quality videos they can, especially from unique sources. :)

To help convince you to always use double rate deinterlacing:
True interlaced video (like that from a camcorder) has 50 discrete points in time. Interlaced video has stored the frame as fields which are made up of every other line of the full frame of video. When recording the camcorder does not capture a frame and then store every other line as separate fields, instead it captures the first field with one exposure and then the second field with a second exposure. This means that a camcorder really captures 50 frames per second with 1/2 the vertical resolution. A great deinterlacer like QTGMC will try to use static information from the previous and next fields to add detail when "resizing" each field to full resolution. In the places where it decides motion has happened between fields it uses a classic resize algorithm. If doing "half rate" deinterlacing QTGMC or Yadif would then drop every other frame, losing half the temporal resolution.

I hope this hasn't made you more confused instead of less. :o
A better explanation of interlacing (http://www.neuron2.net/LVG/interlacing.html)

somy
18th January 2014, 12:36
50fps generally looks a lot smoother in terms of motion. When I compared 25fps to 50fps using ffdshow's de-interlacing filter on playback (Yadif), 50fps looked pretty much the same as if the video card/TV did the de-interlacing. 25fps was noticeably less smooth, or more "jittery", however you'd describe it, so in that respect if the goal is to have an encode which looks as close as possible to the original video, de-interlacing to 50fps when encoding would be fairly mandatory.


True interlaced video (like that from a camcorder) has 50 discrete points in time. Interlaced video has stored the frame as fields which are made up of every other line of the full frame of video. When recording the camcorder does not capture a frame and then store every other line as separate fields, instead it captures the first field with one exposure and then the second field with a second exposure. This means that a camcorder really captures 50 frames per second with 1/2 the vertical resolution. A great deinterlacer like QTGMC will try to use static information from the previous and next fields to add detail when "resizing" each field to full resolution. In the places where it decides motion has happened between fields it uses a classic resize algorithm. If doing "half rate" deinterlacing QTGMC or Yadif would then drop every other frame, losing half the temporal resolution.
Hi hello_hello and Asmodian,
Thank you very much for the explanation. I'm convinced to double FPS for deinterlacing, however I couldn't figure out how to do it properly in HandBrake. I have the following options:
1) Transcode 25i to 25i and let video player to do de-interlacing, for example LAV video decoder can do YADIF double frame rate de-interlacing. The problem is, HandBrake doesn't recognize the source video is interlaced and therefore mark the output video to be 25P and the video player consider it's progressive and therefore doesn't apply deinterlacing at all.
2) Transcode to 50P with deinterlacing filter in HandBrake. I have difficulty to understand how HandBrake handle double frame rate (which is the reason I opened this thread). If I manually type 50 FPS in the X264 encoder conf, does HandBrake use YADIF mode 1 automatically (there is no way to configure it any where) or does it use YADIF mode 0 and copy each every frame (which loses the benefit of 50 FPS IMO)
3) Transcode to 50P with decomb filter in HandBrake. This is the most complicated situation and deinterlacing only applied for some of the frames. Does it make any difference if I choose 50 FPS constant framerate or 50 FPS variable framerate? I would assume the correct behavior is to copy the frames that do not need deinterlacing and use YADIF mode 1 for the frames that requires deinterlacing. However I doubt that is how HandBrake works.

hello_hello
18th January 2014, 17:02
There's an x264 setting for interlaced encoding. MeGUI tells me there's two options. --bff, and --tff (bottom field first, top field first, I assume). I'm pretty sure all you need to do is add the appropriate one to the command line and you're encoding in interlaced mode. How you add them to the command line using Handbrake I'm not sure, and hopefully the x264 version Handbrake uses supports interlaced encoding. I don't think I've encoded a video as interlaced in my life, so the last couple of sentences pretty much contain everything I know about the subject. :)

You shouldn't need to type the frame rate into the encoder command line, if that's what you were referring to. Just select 50fps under the video tab along with the constant frame rate option. And of course either Bob deinterlacing or decomb.

I'd just use the deinterlacing filter myself rather than decomb. That's probably how it's done most of the time, at least outside of the Handbrake world. ;)
Deinterlacing or decomb, I'd also set the frame rate option to "constant". Chances are most video is entirely, or very close to entirely interlaced (or entirely progressive), so 50fps would be fine. When choosing 50fps for the output frame rate, "variable frame rate" is no longer an option. The choices are constant frame rate and peak frame rate.
The effect of the variable or peak frame rate setting isn't something I'm very familiar with given I don't use Handbrake myself, but maybe if the Decomb filter doesn't de-interlace frames they're treated as progressive, and the you'd have the frame rate switching between 25fps and 50fps accordingly..... I'm really guessing but I'd be going with constant frame rate to make sure it's a steady 50fps and I'd probably stick with de-interlacing at least until I'd run some test encodes and understand what the decomb filter is likely to do and how it might effect the frame rate.

When using the Decomb filter, Handbrake's log file tells you how much de-interlacing it's doing. From one of my little "test encodes" the other day:

decomb: deinterlaced 2274 | blended 582 | unfiltered 71 | total 2927

I don't know if the frame rate would have varied as a result of what decomb was doing without the output set to a constant frame rate. I'll have to try it some time soon.... out of curiosity.

JohnAStebbins
23rd January 2014, 16:54
Hi,

Bob in HandBrake is indeed yadif mode 1.

Regarding framerates, the default framerate mode in HandBrake is "variable frame rate" (VFR). The duration of each frame can vary. This is especially useful with the Bob Decomb filter. This filter will output some frames at 25fps (frames where no combing is detected) and some frames at 50fps (combed frames). In this scenario, if you do not use VFR and instead set your framerate to 50fps CFR, the 25fps sequences will have their framerate increased to 50fps by duplicating frames. This results in encoding of duplicate frames that wastes a little space. The amount of wasted space is pretty minimal since duplicate frames compress really well.

Basically, what I'm saying is framerate doesn't matter if you use HandBrake's default VFR setting. It automatically "does the right thing" to preserve fluid motion. The important factor is your choice of deinterlace filter. The Bob variation of decomb or deinterlace preserves motion best.

The only reason not to use VFR would be for device compatibility. Some broken devices don't parse h.264 VFR information properly.

somy
27th January 2014, 21:35
Hi,

Bob in HandBrake is indeed yadif mode 1.

Regarding framerates, the default framerate mode in HandBrake is "variable frame rate" (VFR). The duration of each frame can vary. This is especially useful with the Bob Decomb filter. This filter will output some frames at 25fps (frames where no combing is detected) and some frames at 50fps (combed frames). In this scenario, if you do not use VFR and instead set your framerate to 50fps CFR, the 25fps sequences will have their framerate increased to 50fps by duplicating frames. This results in encoding of duplicate frames that wastes a little space. The amount of wasted space is pretty minimal since duplicate frames compress really well.

Basically, what I'm saying is framerate doesn't matter if you use HandBrake's default VFR setting. It automatically "does the right thing" to preserve fluid motion. The important factor is your choice of deinterlace filter. The Bob variation of decomb or deinterlace preserves motion best.

The only reason not to use VFR would be for device compatibility. Some broken devices don't parse h.264 VFR information properly.

Thank you for your reply!
I'm not very comfortable with VFR option - I'd rather keep frame rate constant. If I understand you correctly, in HandBrake if I set frame rate to 50 for 25i material and enable decomb, handbrake will 1)duplicate frames which don't need deinterlacing and 2) deinterlace by using YADIF mode 1 ((NB. mode 1 != dulplicating frames)) for frames require deinterlacing. If that is the case then I'm very happy :)

hello_hello
28th January 2014, 03:05
I ran some more little test encodes and meant to post back.

When selecting Bob for de-interlacing the output seems to be a constant 50fps whether you use "same as source" or "50" for the output frame rate. Even when the variable frame rate mode is selected. So I guess as long as the input frame rate is a constant 25fps, it just de-interlaces to 50fps.

When selecting Bob for the decomb filter, that's when the variable frame rate stuff happens, and the Handbrake log file tells you what it's doing. This was from my 30 second test encodes.

Variable frame rate:
[12:18:06] decomb: deinterlaced 1070 | blended 88 | unfiltered 78 | total 1236
[12:18:06] render: 1236 frames output, 0 dropped and 0 duped for CFR/PFR

Constant frame rate:
[12:19:49] decomb: deinterlaced 1070 | blended 88 | unfiltered 78 | total 1236
[12:19:49] render: 1314 frames output, 0 dropped and 78 duped for CFR/PFR

Interestingly, the constant frame rate encode resulted in a slightly smaller file size. 4.437MB for VFR. 4.423 for CFR.
I'm not sure how duplicating frames reduces the file size, but I repeated the above encodes and got the same result each time. Maybe it's something to do with the x264 encoder being frame rate aware (encode the same number of frames using two different frame rates and the same CRF value and you'll get two different bitrates).

Same little sample. Bob deinterlacing (not decomb)

[12:14:35] sync: got 658 frames, 1316 expected
[12:14:35] render: 1314 frames output, 0 dropped and 0 duped for CFR/PFR

For the record, the file size when de-interlacing was 4.296MB. Slightly smaller than decomb, so whether it means those 78 frames which weren't de-interlaced have more detail.... I don't know. I couldn't see any obvious differences between de-interlacing and de-comb.

I think I said in an earlier post you needed to select 50fps as the output frame rate for Bob de-interlacing to work. That appears to be wrong according to the test encodes I ran above. "Same as source" also produced a 50fps output.

JohnAStebbins
28th January 2014, 17:15
Thank you for your reply!
I'm not very comfortable with VFR option - I'd rather keep frame rate constant. If I understand you correctly, in HandBrake if I set frame rate to 50 for 25i material and enable decomb, handbrake will 1)duplicate frames which don't need deinterlacing and 2) deinterlace by using YADIF mode 1 ((NB. mode 1 != dulplicating frames)) for frames require deinterlacing. If that is the case then I'm very happy :)

You need to use the "bob" option of the decomb filter if you want this behavior.

somy
30th January 2014, 12:07
You need to use the "bob" option of the decomb filter if you want this behavior.

OK, is bob the deinterlacing algorithm gives the worst picture quality by simple doubling frames?

osgZach
3rd February 2014, 19:16
If I wanted to bob something I'd probably use TGMCmod, or QTGMC, at least then the bob output would be the best. But it'll be SLOW as hell to do the work, is the only drawback.
I don't see a point to quicker bobs if they result in lower picture quality (probably aliasing and stuff?)

JohnAStebbins
4th February 2014, 17:57
OK, is bob the deinterlacing algorithm gives the worst picture quality by simple doubling frames?

I don't know what this question means? Are you saying you are getting worse picture quality when you use bob than when you don't use bob? I do not experience this.

nm
4th February 2014, 18:37
I'm guessing he's confused by naming of the option. Some programs (such as VLC) have a filter named "Bob" that simply separates the fields and scales them up, which results in poor vertical resolution and a shimmering effect.

Here bob means that you get full temporal resolution (50 Hz) instead of half rate (25 Hz). Quality is determined by the selected algorithm.

hello_hello
6th February 2014, 01:05
Anyone know why video de-interlaced to "half frame rate" (25fps for PAL) never looks a smooth as video which is natively progressive? I'd guess it's maybe something to do with motion blur, or lack thereof, but even when de-interlacing to 25fps with QTGMC, motion seems to have a slight "jitter" to it. The "jitter" effect is usually worse using Yadif, but sometimes that appears to happen more for low quality or noisy video, I assume because Yadif doesn't denoise as QTGMC does.

If I wanted to bob something I'd probably use TGMCmod, or QTGMC, at least then the bob output would be the best. But it'll be SLOW as hell to do the work, is the only drawback.
I don't see a point to quicker bobs if they result in lower picture quality (probably aliasing and stuff?)

I'd agree, except it wasn't all that long ago most people were de-interlacing to half frame rate (most people probably still do) and Yadif at full frame rate is a huge improvement on that.
I don't know where the de-interlacing takes place if the player isn't doing it (is it the renderer, TV or video card which de-interlaces?) but for me Yadif at 50fps seems to look pretty much the same as de-interlacing when playing the original video, so if nothing else Yadif at 50fps doesn't seem to be reducing the quality further.

Once you've used QTGMC though, it's very hard to go back. I've been using it more and more when encoding progressive video (in progressive mode), which can clean it up pretty well (especially if you include a little of QTGMC's own denoising) so unless the source video is fairly clean I find it hard to let myself encode without QTGMC these days, which is annoying at the same time as it means even my encodes of progressive video tend to be nice and slow.

nm
6th February 2014, 18:11
Anyone know why video de-interlaced to "half frame rate" (25fps for PAL) never looks a smooth as video which is natively progressive? I'd guess it's maybe something to do with motion blur, or lack thereof

Yep. It's about camera shutter speed or exposure time. Native 24 fps film is usually shot with longer frame exposures and therefore more motion blur.


I don't know where the de-interlacing takes place if the player isn't doing it (is it the renderer, TV or video card which de-interlaces?)

On computer playback deinterlacing may be done by the decoder, the video player, the renderer or a filter within the GPU driver, enabled by one of the previous components. Generally it's about the same quality as yadif. Latest TV models might have slightly better filters, but on a PC it's difficult to get the interlaced video to the TV completely intact. You need to use an interlaced display mode for starters, and take care that fields don't get messed up at any point from a scaling operation, and make sure fields get swapped correctly and so on...


Once you've used QTGMC though, it's very hard to go back. I've been using it more and more when encoding progressive video (in progressive mode), which can clean it up pretty well

Hmm. Have you compared to simple MDegrain2?

osgZach
6th February 2014, 20:42
If you're deinterlacing to half frame rate, you're also cutting out half the temporal data, right? I'd think that would be the larger contributor than anything.

Sharc
7th February 2014, 00:08
If you're deinterlacing to half frame rate, you're also cutting out half the temporal data, right? I'd think that would be the larger contributor than anything.
Yes, but hello_hello compares half-rate deinterlacing with native progressive material at the same frame rate (e.g. 25fps).
Indeed half-rate deinterlacing tends to show a stroboscopic effect due to the shorter shutter opening (= less motion blur) of the camera which took the original interlaced pictures at double frame rate.

somy
7th February 2014, 11:30
I'm guessing he's confused by naming of the option. Some programs (such as VLC) have a filter named "Bob" that simply separates the fields and scales them up, which results in poor vertical resolution and a shimmering effect.

Here bob means that you get full temporal resolution (50 Hz) instead of half rate (25 Hz). Quality is determined by the selected algorithm.

Yes, that is my confusion.
So what exactly Handbrake will do if I choose double framerate and Bob as deinterlacing option?

somy
7th February 2014, 11:34
I don't know what this question means? Are you saying you are getting worse picture quality when you use bob than when you don't use bob? I do not experience this.

I wanted to ask how "Bob" option works in handbrake:
1. Does it use YADIF mode 1 for deinterlacing or
2. Displays each half-picture like a full picture, by simply displaying each line twice?
Thanks!

nm
7th February 2014, 16:36
Yes, that is my confusion.
So what exactly Handbrake will do if I choose double framerate and Bob as deinterlacing option?

For 25 fps input, it gives you 50 fps output with full temporal resolution.


I wanted to ask how "Bob" option works in handbrake:
1. Does it use YADIF mode 1 for deinterlacing or

"Bob" option doesn't change the filtering algorithm (or mode) that you have selected. If the mode is 1 then yadif with spatial and temporal interlacing check gets used.

2. Displays each half-picture like a full picture, by simply displaying each line twice?
Thanks!

I don't think there's a mode for this in HandBrake's decomb. The closest according to the documentation (https://trac.handbrake.fr/wiki/Decomb) might be cubic interpolation (mode 4), but I haven't tried it.

Brent212
20th March 2014, 05:49
Related question that I can't find addressed anywhere:
If I have progressive video, but have Deinterlace set to Bob, what happens?

I'd like to not have to figure out whether or not each video I'm encoding is interlaced. I'm also not sure what to do if a video has both progressive parts and interlaced parts. The main thing I don't want to do is lose motion smoothness... I hate when I'm watching something that was originally 60i that's been encoded into 30p (or is just playing in a software player that's deinterlacing it to 30p). The degradation in motion is huge.

nm
21st March 2014, 20:08
Related question that I can't find addressed anywhere:
If I have progressive video, but have Deinterlace set to Bob, what happens?

You get sort-of duplicated frames with quality degradation caused by the deinterlacing filter.

I'd like to not have to figure out whether or not each video I'm encoding is interlaced. I'm also not sure what to do if a video has both progressive parts and interlaced parts.

The easiest way is to use HandBrake's Decomb filter in Bob mode. It detects interlaced frames and only deinterlaces those. Progressive frames are passed through without deinterlacing, so their quality is not affected. Output is variable framerate unless you force constant framerate in the video tab. You could also play with the advanced parameters for higher deinterlacing quality: https://trac.handbrake.fr/wiki/Decomb

Brent212
21st March 2014, 20:53
The easiest way is to use HandBrake's Decomb filter in Bob mode. It detects interlaced frames and only deinterlaces those. Progressive frames are passed through without deinterlacing, so their quality is not affected. Output is variable framerate unless you force constant framerate in the video tab.

Awesome, so it sounds like if I just keep the Decomb filter set to Bob mode, if I input a fully progressive video, the output will be the same as if the Decomb filter was off. But if some of the input is interlaced, it'll bob/double the framerate for the interlaced part of the output. Or if the whole input video is interlaced, it'll apply the bob filter to the whole thing (or maybe just the parts where "teething" is evident).

nm
22nd March 2014, 01:26
Awesome, so it sounds like if I just keep the Decomb filter set to Bob mode, if I input a fully progressive video, the output will be the same as if the Decomb filter was off. But if some of the input is interlaced, it'll bob/double the framerate for the interlaced part of the output. Or if the whole input video is interlaced, it'll apply the bob filter to the whole thing (or maybe just the parts where "teething" is evident).

Yep, that's what it's designed to do. Personally I don't have much experience in using it though.

FeB
31st March 2014, 16:49
I have years of experience deinterlacing with HandBrake (and months of experience with the bob option that was added last year on HandBrake 0.9.9 release).

I must say that:

- HandBrake's Decomb gives horrible quality in some DVDs, particularly in scenes where there is a small object moving fast and the rest of the scene is static, so Decomb doesn't detect these frames as interlaced, so these frames are not deinterlaced and the result is that the small moving object remains full of horrible combing lines. I call this "Decomb's hands issue" because it affects particularly small moving hands in static scenes. For example, use decomb in "ABBA in Japan" DVD an look at Agnetha's hands from 00:04:25 (hh:mm:ss) to 00:04:50 time range. You will want to send the m4v/mkv file to the trash. Default behaviour in HandBrake's Decomb is that it needs to detect at least 80 pixels interlaced in at least one 16x16 block in a frame, to this frame be flagged as interlaced. You can change this to, for example, 10 pixels in a 8x8 block using Decomb custom settings, "maybe" these changed values would detect small moving hands, but this custom option is available only for regular decombbing to 25fps/29.97fps, not for bob decombbing to 50/59.94fps, so with Decomb Bob you're stuck in default values which don't detect small moving objects

- HandBrake's Deinterlace gives near DVD-playback quality (which is not horrible, but is below acceptable in scenes where there is small objects) and has the problem of deinterlacing everything, including progressive parts.

I was trying to use HandBrake to deinterlace a brazilian MTV Unplugged DVD which has the "small fast moving hands in static scenes" problem. I tried Decomb Bob which gave me a horrible output and I couldn't change default values. Using Decomb custom I could change default values to 10 pixels at a 8x8 block, which "maybe" would detect the small moving hands, but I could only use custom values to a 29.97fps output, not 59.94fps. Using HandBrake's deinterlace gave me a better quality, but the (progressive!) MTV's logo in the first few seconds, before concert starting, became deinterlaced (and horrible)

So. I went to QTGMC under AviSynth.

I first tried QTGMC with default settings (Preset = "Slower") but I saw strange object deformations in some scenes (but only when watching the video in slow motion in a TV).

So I'm now using QTGMC with Preset = "Placebo" and very happy (except for the "eternity" it takes to encode in Placebo speed).
.

FeB
31st March 2014, 18:50
Please I want your help with this:

I was using HandBrake but now I'm starting to use QTGMC(Preset="Placebo") for all my music DVDs... And placebo speed takes an "eternity" to encode...

So I want to never have to deinterlace all again in the future.

So I thought I could make a "placebo-deinterlaced backup version" to the future.

For example, now I'm encoding to h.264 (I don't want to go to h.265 right now).

But maybe in some years I will want to reeconde all my past h.264 encodes to h.265, and then to h.266, h.267, or whatever we will be using in year 2030 (if I'm still alive there!), and it would be very good to have in the future a "placebo-deinterlaced backup version" so I will never have to placebo-deinterlace again the already deinterlaced DVDs.

What do you think in:

- x264 RF 10 with Preset=slow
- Strict anamorphic with no cropping and no resizing
- QTGMC(Preset="Placebo")
- All audio and subtitles streams copied exactly ("passthru")

Are these settings sufficiently "transparent quality" to be used as source?

Asking the same question, using other words:

1) If I encode a DVD to this "backup version", and then use it as a source to reencode again to RF 18 (in total: two encodes using an intermediate step)

or

2) Encode directly from DVD to RF 18 with no intermediate encoding

Would output number 1) and 2) be equal in quality?

If the answer is "yes", then OK.

If the answer is "no", then I should use a lower RF instead of 10 in the "backup version"?

I first tried using RF zero (lossless?), but this gave me a 50 Mbit/s output from standard definition 480p DVDs!!!
One hour of 480p DVD became a 20 GB file!!!
.

Guest
31st March 2014, 19:16
Multiple encoding generations (unless they are lossless) will always degrade quality compared to a single encode.

Are these settings sufficiently "transparent quality" to be used as source? What is perceived as transparent for a lossy encode is subjective. You have to answer this for yourself.

If deinterlacing speed is too slow for you then consider trying deinterlacing on a GPU. It may be enough for you.

JohnAStebbins
31st March 2014, 22:39
... Default behaviour in HandBrake's Decomb is that it needs to detect at least 80 pixels interlaced in at least one 16x16 block in a frame, to this frame be flagged as interlaced.
These are the old defaults. The new defaults are 40 pixels in a 16x16 block coupled with a new algorithm that should filter out false positive hits better. The old defaults are still available as the "Fast" option since the new algorithm is somewhat slower.

That said, the thresholds are tuned to be on the edge of catching visible combing. This tuning is done manually with whatever samples we can find. So if you have samples that fail badly with the new default settings, it would be helpful if you could supply small clips that can be used to do better tuning.

FeB
1st April 2014, 00:28
These are the old defaults. The new defaults are 40 pixels in a 16x16 block coupled with a new algorithm that should filter out false positive hits better. The old defaults are still available as the "Fast" option since the new algorithm is somewhat slower.

That said, the thresholds are tuned to be on the edge of catching visible combing. This tuning is done manually with whatever samples we can find. So if you have samples that fail badly with the new default settings, it would be helpful if you could supply small clips that can be used to do better tuning.

Hi, JohnAStebbins.

So HandBrake's wiki page (https://trac.handbrake.fr/wiki/Decomb) is outdated because it's written there that Decomb uses 80 pixels to 16x16 blocks:

The defaults are pretty good. They are:

7:2:6:9:80:16:16:10:20:20:4:2:50:24:1:-1

A very good sample is the "ABBA in Japan" DVD in the time range from 00:04:25 (hh:mm:ss) to 00:04:50 as I wrote in my earlier post in this page.

If someone can make a decomb filter that automatically passthrough progressive segments untouched and at same time can make a perfect deinterlacing at this 25 second segment from ABBA's DVD, this person deserves a Nobel.

I think that HandBrake's Decomb is good for people who don't want to waste time, or don't know how, to detect if a video is progressive, interlaced or mixed. And want a automated filter.

But the best result is always the manual process, not the automated process.
.

Guest
1st April 2014, 00:32
If someone can make a decomb filter that automatically passthrough progressive segments untouched and at same time can make a perfect deinterlacing at this 25 second segment from ABBA's DVD, this person deserves a Nobel. Ok, I'll bite on that. Please post a link to a small unprocessed source sample that we can use to see if the prize should come our way. (You are allowed to post samples under the fair use clause of the copyright law and that don't violate rule 6 etc.)

There are several deinterlacers that try to pass progressive frames through untouched. And maybe Handbrake can be tuned as John suggested. Either way, a sample will get everybody going to help you. You earlier said "Please I want your help..."

FeB
1st April 2014, 01:26
Hi, neuron2.

First of all, thank you very much for your reply in my earlier question about "backup version".

Now, talking about the HandBrake's Decomb:

I don't like the idea of uploading 20 seconds of copyrighted video, so I can't help.

But you can use the time range 00:04:24 to 00:04:53 from "ABBA in Japan" DVD (it's a very popular and cheap DVD) as a challenge source to be automatically decombed.

I will make a suggestion to make a "state-of-the-art" automatic decomb filter:

Instead of trying to detect frame by frame if it needs to be deinterlaced...

Try to detect segment by segment (between two scenecuts).

x264 has a "scenecut" detector (http://mewiki.project357.com/wiki/X264_Settings):


scenecut

Default: 40

Sets the threshold for I/IDR frame placement (read: scene change detection).
x264 calculates a metric for every frame to estimate how different it is from the previous frame. If the value is lower than scenecut, a 'scenecut' is detected.

A "state-of-the-art" Decomb filter could work with x264's scenecut this way:

- Divide the source in segments, each one with 1 second to, last say, a maximum of 30 seconds (???), working together with x264's scenecut

- Inside each 1-to-30-seconds segment, try to find if the whole segment has at least x% (I don't know what would be a good value to 'x') of frames detected as interlaced. If the 1-to-30-seconds segment has x% or more interlaced frames, apply deinterlace to all the segment (don't apply deinterlace only to the frames detected as interlaced, which is the way HandBrake's Decomb work now)

For example, in the ABBA in Japan DVD there is a segment from 00:04:24 to 00:04:53 where the scene is the same, the background is the same, so Decomb should treat this 29 seconds segment in group, not frame by frame.

It's just my idea, I don't know if it would work...

Best regards.

Guest
1st April 2014, 01:31
I don't like the idea of uploading 20 seconds of copyrighted video, so I can't help. Have fun talking to yourself. :)

I'm moving this to the GUIs forum.

fenomeno83
7th December 2018, 16:34
Hi.
My camera records at 1920x1080 50fps.
I want rencovert with handbrake to save space.
Handbrake use "decomb" filter as default. Should I Off it, because I don't need to deinterlace?
Thanks

Sharc
7th December 2018, 17:15
Hi.
My camera records at 1920x1080 50fps.
I want rencovert with handbrake to save space.
Handbrake use "decomb" filter as default. Should I Off it, because I don't need to deinterlace?
Thanks
If you are positive that your frames are progressive at 50 frames per second you should switch decomb off.
As far as I know, decomb in handbrake is adaptive, means it does not deinterlace when there are no combes detected. Hence leaving it on shouldn't make a difference for progressive frames. But you better check it out.

fenomeno83
7th December 2018, 19:01
Here MediaInfo:
https://i.imgur.com/6VlA0Ei.jpg

tebasuna51
8th December 2018, 10:54
Here MediaInfo:

Use the menu: File -> Export -> Text (tab for Format output) -> (Advanced mode) -> Info.txt

zip the Info.txt and attach the file or use PasteBin.com

SaurusX
23rd January 2019, 21:45
If you are positive that your frames are progressive at 50 frames per second you should switch decomb off.
As far as I know, decomb in handbrake is adaptive, means it does not deinterlace when there are no combes detected. Hence leaving it on shouldn't make a difference for progressive frames. But you better check it out.

For my own sake I've been doing experimentation with the latest Handbrake (1.2?) so that I could better understand how it operates.

Using a DVD source with animation encoded as progressive, leaving Decomb on and Default Interlace Detection results in garbage. It does not just decomb left over interlacing artifacts, but is overly conservative by deinterlacing any areas that have moved since the prior frame. This results in a lot of animation lines that look extremely jagged when there is absolutely no need. By changing the Interlace Detection to "Fast" then most of these problems disappear. This works the same way whether Detelecine is turned on or off. Maybe this setting is not such a big deal in live action, but in animation it looks terrible.

There seems to be a lot of misinformation about "best" settings for Handbrake, which is understandable given the lack of documentation and that the functionality changes from release to release.