Here Comes Bob!

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
rachel
Novice
Posts: 71
Joined: Thu Mar 15, 2007 7:34 pm

Here Comes Bob!

Post by rachel »

Bob's arrived, yay. I have some tests queued up on material I've previously had to do with avisynth on Windows... But in the meantime...

Bob as an option on Deinterlace I get. And presumably I'll get a double framerate eg: a 1080i@50Hz becomes a 1080p at 50fps.

Bob as an option on Decomb? How does that work? Do we end up with a file with variable framerate? ie: 1080i@50Hz gets turned into 1080p but at 25fps where decomb found nothing to do and 50fps where it did? Do we expect players to deal with that smoothly? :-) If so, obviously it makes sense to use it...
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Here Comes Bob!

Post by JohnAStebbins »

rachel wrote:Bob's arrived, yay. I have some tests queued up on material I've previously had to do with avisynth on Windows... But in the meantime...

Bob as an option on Deinterlace I get. And presumably I'll get a double framerate eg: a 1080i@50Hz becomes a 1080p at 50fps.

Bob as an option on Decomb? How does that work? Do we end up with a file with variable framerate? ie: 1080i@50Hz gets turned into 1080p but at 25fps where decomb found nothing to do and 50fps where it did? Do we expect players to deal with that smoothly? :-) If so, obviously it makes sense to use it...
Correct. You will get variable framerate video (if you have the VFR option enabled in the framerate options). The still scenes that do not have combing will be output at 25fps and since they are not filtered they will have greater clarity. Fast moving scenes that do have combing will be output at 50fps and therefore preserve more fluid motion.

HandBrake has been generating VFR video for a long time and most players deal with it just fine. Mixed telecined, interlaced sources also result in VFR output.
mic j
Posts: 48
Joined: Tue Mar 20, 2012 8:35 pm

Re: Here Comes Bob!

Post by mic j »

Can you explain what "Bob" is and where it should be used?
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Here Comes Bob!

Post by JohnAStebbins »

mic j wrote:Can you explain what "Bob" is and where it should be used?
Bob is just another deintelacing method. The other deinterlacing algorithms in HandBrake all result in output that is the same framerate as the input. But interlaced frames are compose of fields that are paced at twice the framerate. So these other algorithms result in loss of temporal information. Bob basically generates one output frame per input field and preserves the temporal information. So the output looks more fluid. But if you were to freeze any one particular frame, it will not look any better that a frame from the other deinterlace methods.

The downside to bob will be larger output file size since you have doubled the number of output frames. The size will not be double because the shorter time span between frames means there is greater duplication which compresses well. But it will be noticeably larger.
rachel
Novice
Posts: 71
Joined: Thu Mar 15, 2007 7:34 pm

Re: Here Comes Bob!

Post by rachel »

mic j wrote:Can you explain what "Bob" is and where it should be used?
Briefly as it might be offtopic but it's new to handbrake so...

(and this is my user's-understanding of it)

Deinterlacing turns an interlaced video into a progressive one. There are several methods for doing so, Bob is one of them. I'm assuming you know what interlaced video is, not going to explain that here. :-)

In Bob-deinterlacing each *field* (ie: half-frame made of alternate lines) is encoded to become a full frame. ie: for a 1080i video, a field will have 540 lines; bob-deinterlacing will turn that into a full 1080-line progressive frame. Obviously in doing so it's having to invent image data to fill those other 540 lines. Presumably it's doing so using some interpolation from the lines that it has on either side, but I don't know *any* details there; I'm happy to accept that clever people do, and that's the algorithm that's acquired the name "bob". :-)

But you end up with a progressive video at double the normal frame rate. ie: a 25fps 1080i has 25 *full* frames a second, which is 50 *fields* a second. Bob-deinterlacing turns that into 50 full frames a second.

(Some video players may struggle to play it!)

I use it for video sources where a normal decomb or detelecine or even just leaving deinterlace off doesn't give me satisfactory results. Some telecined material can't be satisfactorily detelecined, for instance; it's not the common pattern found on NTSC sources, and it defeats Handbrake's automated telecine detection (although I have another test to run now, as a result of another post on this forum I read today, I might have been doing something wrong). Also, some interlaced video with many sequences of smooth movement at a certain speed will consistently have a lot of movement from one field to the next across the whole picture, and decomb/deinterlace will just turn it into an unpleasant jerky motion. Leave decomb and deinterlace *off* on those sources and you will see massive "combing" artifacts all over the screen.

A lot of the interlaced bluray content out of the bbc in the last few years benefits from this; unfortunately much of it is also sourced using the VC1 codec which handbrake can't quite manage yet, but at least we have movement on the AVC/H.264 content.
mic j
Posts: 48
Joined: Tue Mar 20, 2012 8:35 pm

Re: Here Comes Bob!

Post by mic j »

Thanks to you both for your thorough explanation. Definitely will help me in deciding when/when not to use Bob.
tlindgren
Bright Spark User
Posts: 260
Joined: Sun May 03, 2009 2:14 pm

Re: Here Comes Bob!

Post by tlindgren »

For a lot of examples: http://www.100fps.com/

Not sure exactly how intelligent HandBrake's new Bob filter is but it's going to be a noticeable improvement on what was available before for certain type of media. Note that HandBrake "Decomb:Bob" is not as good as the Bob+Weave they show there (second best option), because that uses both methods in the same frame (so only interlaced parts of the frame loose resolution!) while HandBrake always does either Bob or not on each full frame.

Now, the best option by far is the last option, motion/vector compensated area based deinterlacing (including the framerate doubling) and most modern mid-range graphics card are actually capable of doing this on playback! Some expensive TVs can also do a semi-decent (but not as good) job in case it's played back on something else.

The problem is that there's rarely or never any way to access the result, much less the cross-platform/any graphics card access that would needed for HandBrake to include this.

Access to these advanced GPU accelerated deinterlacing methods is one major benefit for GPU based video encoders (hardware video decoders is nice too!), unfortunately the actual video encoder in them are usually pants-on-head retarded which means the result ends up worse despite this. Intel QuickSync is interesting mainly because the encoder isn't quite as bad as the rest :-)

But life would be so much simpler if one could actually get these superior deinterlaced results back from the graphics card and then run a good x264 based encoder like HandBrake on it. Fortunately most new material can be found in progressive format.

So, if your playback environment is a HTPC with a decent graphics card and the media player has HW accelerated playback enabled the best possible result will come from encoding interlaced video as interlaced (no horizontal rescaling, ever!) and let the card sort it out on playback. But HandBrake doesn't (officially) support interlaced encoding and a lot of people uses other platforms for playback so it's kind of specialized...
Smithcraft
Veteran User
Posts: 2697
Joined: Thu Jan 22, 2009 8:04 pm

Re: Here Comes Bob!

Post by Smithcraft »

Now if only the BBC would stop releasing interlaced content!

SC
moneymatt4life
Veteran User
Posts: 440
Joined: Fri Mar 09, 2012 5:26 am

Re: Here Comes Bob!

Post by moneymatt4life »

... since when did Handbrake get Bob deinterlacing??? and how do i go about enabling it??? (^___^) i really like me bobs!
Deleted User 13735

Re: Here Comes Bob!

Post by Deleted User 13735 »

... since when did Handbrake get Bob deinterlacing???
I like to keep an eye on the Dev forums, from time to time.
He is Bob, eager for fun. He wears a smile. Everybody run!

Smart Bob is Donald Graft's biggest claim to fame, except Don doesn't like to brag. Goes back to around the turn of the (21st) century, iirc.
tlindgren
Bright Spark User
Posts: 260
Joined: Sun May 03, 2009 2:14 pm

Re: Here Comes Bob!

Post by tlindgren »

musicvid wrote:I like to keep an eye on the Dev forums, from time to time.
He is Bob, eager for fun. He wears a smile. Everybody run!

Smart Bob is Donald Graft's biggest claim to fame, except Don doesn't like to brag. Goes back to around the turn of the (21st) century, iirc.
DG's Smart Bob is impressive, especially considering that the last version came out in 2001 but it needs to be mentioned that a large reason why it's impressive is because it does exactly what the 100fps page calls "Progressive" or Bob+Weave, IE it only Bob deinterlace the moving sections of a frame while the static parts keeps the full resolution.

As far as I can see and understand the new HandBrake Bob is what DG and others call "dumb bob", which always deinterlace the entire frame (IE reduced resolution). HB's new Decomb+Bob alleviates this a bit by skipping the Bob step on frames without large amount of visible interlacing, but it's still not as good as DG Smart Bob. Enabling other filters in the Decomb chain can improve the result further but it still starts from a much inferior starting point.

It's still a significant step forward and the Decomb chain in HandBrake is world class, though it only works on entire frames instead of "moving parts" which would be even better.
moneymatt4life
Veteran User
Posts: 440
Joined: Fri Mar 09, 2012 5:26 am

Re: Here Comes Bob!

Post by moneymatt4life »

... i don't see Bob deinterlacing as an option on Handbrake... do i have to enable it manually??? or... something else???
Deleted User 11865

Re: Here Comes Bob!

Post by Deleted User 11865 »

It's only available in the CLI, Linux & Mac GUIs right now. I don't think Scott has exposed it in the WinGUI yet.
moneymatt4life
Veteran User
Posts: 440
Joined: Fri Mar 09, 2012 5:26 am

Re: Here Comes Bob!

Post by moneymatt4life »

Rodeo wrote:It's only available in the CLI, Linux & Mac GUIs right now. I don't think Scott has exposed it in the WinGUI yet.
awwwwwwwwwwww.... well i hope it is implemented in the WinGUI sometime soon!!! (^___^)
ljorg
Posts: 14
Joined: Fri Oct 01, 2010 9:23 am

Re: Here Comes Bob!

Post by ljorg »

What are the odds that decombing with bob will play back on iDevices? I mainly use an iPhone4, iPad2 and AppleTV2.
rachel
Novice
Posts: 71
Joined: Thu Mar 15, 2007 7:34 pm

Re: Here Comes Bob!

Post by rachel »

ljorg wrote:What are the odds that decombing with bob will play back on iDevices? I mainly use an iPhone4, iPad2 and AppleTV2.
pretty small I expect - I'm even having trouble trying to get my bob-decombed and bob-deinterlaced HD videos running at their proper framerates in Plex on a modern mac mini. Have made a batch of test encodes with different settings but life has intervened and haven't had a chance to try them out yet. iOS devices are pretty restricted in what they'll play though, so my bet is, no way.
Deleted User 11865

Re: Here Comes Bob!

Post by Deleted User 11865 »

ljorg wrote:What are the odds that decombing with bob will play back on iDevices? I mainly use an iPhone4, iPad2 and AppleTV2.
If you use the appropriate preset, Peak Framerate will make sure that the output framerate doesn't exceed 29.97 fps, ensuring that your files are playable on iDevices. However, PFR may have to drop frames in order to achieve that result, so the output may not be as smooth as without PFR (which defeats the purpose of Bob, to a certain extent).
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Here Comes Bob!

Post by JohnAStebbins »

moneymatt4life wrote:
Rodeo wrote:It's only available in the CLI, Linux & Mac GUIs right now. I don't think Scott has exposed it in the WinGUI yet.
awwwwwwwwwwww.... well i hope it is implemented in the WinGUI sometime soon!!! (^___^)
While you are waiting for the GUI to be updated, you can still enable this using the "Custom" option in the GUI. For decomb, the custom option would be "455", and for deinterlace the custom option would be "15".
rachel
Novice
Posts: 71
Joined: Thu Mar 15, 2007 7:34 pm

Re: Here Comes Bob!

Post by rachel »

Testing bob-deinterlace / bob-decomb with Plex... (for avoidance of doubt, and why posting here of course - the bob-deinterlace/decomb is going on in the encode-stage in handbrake; just trying to get satisfactory results on my plex media player on my tv)

Having huge problems. Basically if I select bob-deinterlace and select constant frame rate, (selecting the 59.9whateveritis framerate), playback is perfectly smooth.

If I leave it to variable frame rate on either bob-deinterlace or bob-decomb, what happens in plex is that playback framerate fluctuates wildly throughout, and movement is visibly jerky and inconstant. Speeding up and slowing down all the time.

So basically it would appear that variable framerate is a nono, and thus bob-decomb must be. bob-deinterlace with fixed frame rate works fine though, at least as well as the videos I've already done with avisynth. (I'd done those in Main/3.0 nocabac because at the time my player hardware could play these files like that but not at High/4.0 cabac. But my current player seems to have no such issues, so I can base my encoding preset off High Profile, set bob-deinterlace and constant frame rate to the correct rate, and it works. It also demonstrates the computer is fast enough to play HD video of this framerate, as I wasn't sure about that.

But as pointed out earlier in this thread, a working bob-decomb would give a benefit in picture clarity for the parts where there's no decombing needed. (although tbh still scenes look pretty good now.) So I'd like to have that work too.

Plex uses ffmpeg as its playback library, optionally using the OSX VDADecoder to handle GPU h.264 hardware decoding. I get the same results whether I enable vdadecoder or not (the main difference seems to be in the CPU usage). The problem basically seems to be ffmpeg's handling of VFR.

In my googling I came across this:

http://ffmpeg.org/trac/ffmpeg/ticket/730

which doesn't *exactly* describe what I'm seeing but close enough that it might be the same thing. It suggests that what's needed is for the video track to have timecodes or timestamps (not sure if use of timestamps means classic video timecodes here or something else). So I'm wondering if there's a way for handbrake to put the required timestamp/timecode information into the video track?

I did those test encodes outputting to .mp4. I'm doing one with the same settings to .mkv now to see if the wrapper format makes a difference here, though with only a vague hope that it might based on x264 options regarding timecodes being mkvmerge-format.

BTW also if you know of an OSX player that you know for sure works with handbrake-encoded VFR videos, I'll give that a go. Plex is my media player so the problem isn't solved for me until it's solved there, but it could help with diagnosis.

edit: no, mkv makes no difference; though at least the slightly-differently-formatted video line on the info pane lets me see for sure it's not actually *dropping* frames, just playing them at all sorts of speeds, and much visible judder. This was a bob-deint encode, not a bob-decomb, so why is it even using vfr?
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Here Comes Bob!

Post by JohnAStebbins »

HandBrake always timestamps every frame. So timestamps is not your problem. QT on OSX plays VFR m4v files just fine.

FYI, you can use decomb-bob + 59.94 constant framerate setting to achieve the same thing you did with deinterlace-bob. It will just generate duplicate frames when needed to fill in the frames that are not bobbed.
rachel
Novice
Posts: 71
Joined: Thu Mar 15, 2007 7:34 pm

Re: Here Comes Bob!

Post by rachel »

JohnAStebbins wrote:HandBrake always timestamps every frame. So timestamps is not your problem. QT on OSX plays VFR m4v files just fine.
QT on the same playback machine playing the bob-decomb test does indeed look better, though I'm still seeing occasional juddering. There doesn't seem to be an equivalent option to see actual framerate as-you-go as there is on plex, but the movie inspector reports a framerate of 50.48. (Source is 29.97 interlaced.) Presumably showing an average

The bob-deinterlace test include seems to play back very similarly - also with some slight judder, but movie inspector shows 59.94 which is what I'd expect.

Possible the judder i'm seeing is just the slight mismatch between the 59.94 framerate to the 60Hz actual screen mode, which plex seems to handle better. (bloody ntsc legacy - stuff i rip at 25fps and 50fps is always perfect, as was PAL of course, Perfection At Last. :-) If that interpretation is correct then, yes, quicktime is doing it right and presumably this is an ffmpeg bug.
FYI, you can use decomb-bob + 59.94 constant framerate setting to achieve the same thing you did with deinterlace-bob. It will just generate duplicate frames when needed to fill in the frames that are not bobbed.
I may do that; certainly i'll try it. I kind of assumed constant framerate was just incompatible with bob-decomb going from normal to double framerate, so didn't even try to do that. I suppose given every second frame on the non-decombed sequences is a repeat, it would compress well... :-)

(I suppose that also answers a question I was slightly wondering with the posts above regarding bob+weave: it would do this.)
rachel
Novice
Posts: 71
Joined: Thu Mar 15, 2007 7:34 pm

Re: Here Comes Bob!

Post by rachel »

Hmm. High Profile Bob-Decomb Constant Frame Rate still gives me moments of judder even though the info pane on plex shows no dropped frames, no abnormal deviation from the frame rate. I suspect there's a glitch in the apparent smoothness of motion in the transition from sequences when it has to bob-decomb and when it doesn't, that is encoded into the file itself. And given the wrong kind of footage that can flip on and off several times a minute I guess.

I wonder if it might be because the original video is, I believe, telecined from 25fps to 30fps, and I don't know if the original 25fps master was interlaced or progressive. BBC mastered a bunch of blurays like that for a while. Thankfully they've stopped now! But it could be that because the combing that the decomb filter is detecting is happening as a result of a telecine, it's having to swap between decomb and not all the time.

(I tried for a long time and failed to detelecine these sources. Certainly handbrake's auto-detelecine is defeated by it; although I'm now slightly wondering if I was just encountering the VFR bug identified today, so one more test to try! but in the meantime, bob-deinterlace has been the only way I could get decent playback with these sources.)

(Unfortunately the interlaced-but-not-telecined sources I'd like to try are all VC1-interlaced, which still crashes in handbrake (reported elsewhere))

High Profile Bob-Deinterlace Constant Frame Rate doesn't show those judders. And from TV-watching distances I don't think I can tell the difference in clarity of still or still-enough frames; but I *can* tell when there are timing glitches.

So I guess I need to stick to the bob-deinterlace with constant-frame rate. Those play very well.

I can upload these test encodes if people think they're useful. Each one's only a few minutes but I did a load of different combinations so they amount to quite a lot of video, which will take a while, so I'll only bother if there's interest. :-)
moneymatt4life
Veteran User
Posts: 440
Joined: Fri Mar 09, 2012 5:26 am

Re: Here Comes Bob!

Post by moneymatt4life »

(^_____________________________^) i just used bob and it the motion is sooooo nice!!!! although i haven't tried customizing it for yadif (2x)... imma try that next...
anyways... as for bob and iDevices playback... i used a concert dvd that was re-authored and bob was the only that looked the best (using vlc)... so i encoded it using the bob deinterlacing filter and i used fps same as source + variable frame rate... fps ranges 19.978 to 59.960 (59.940) and i synced the file to my iPod and it plays great and the motion is AMAZING!!! (^___^)
my ipod is 4th gen iOS5.1 if that makes any difference...
rachel
Novice
Posts: 71
Joined: Thu Mar 15, 2007 7:34 pm

Re: Here Comes Bob!

Post by rachel »

for my part, I'm increasingly of the opinion that most of my problems are because of trying to do a vfr bob-decomb or bob-deinterlace on a telecined source. These are OK with bob-deinterlace with cfr so I have to stick with that. For non-telecined interlaced sources, the only ones I can try at the moment are SD DVD rips; I tried one earlier today where the original footage is mixed film and interlaced video in PAL, and it looks great using bob-decomb with vfr on plex. So I've just queued up a batch of re-encodes of DVD rips that have always been a problem.

Trying it on the problematic interlaced HD material I have has to wait for VC1-interlaced support to work reliably. The BBC's more recent output that's in h.264 also seems to be entirely shot in progressive rather than interlaced form, even if transmitted or published on dvd interlaced, so there's no problem encoding those with no filters.
Deleted User 11865

Re: Here Comes Bob!

Post by Deleted User 11865 »

moneymatt4life wrote:(^_____________________________^) i just used bob and it the motion is sooooo nice!!!! although i haven't tried customizing it for yadif (2x)... imma try that next...
anyways... as for bob and iDevices playback... i used a concert dvd that was re-authored and bob was the only that looked the best (using vlc)... so i encoded it using the bob deinterlacing filter and i used fps same as source + variable frame rate... fps ranges 19.978 to 59.960 (59.940) and i synced the file to my iPod and it plays great and the motion is AMAZING!!! (^___^)
my ipod is 4th gen iOS5.1 if that makes any difference...
Using decomb or deinterlace? What's the average framerate of the output?
Post Reply