h264 + placebo + profile high: playback distortion with DXVA

General discussion of HandBrake - not for tech support
Forum rules
Activity Log is required for support requests. See Must Read: How To Get Questions Answered on These Forums for details
davor
Posts: 14
Joined: Fri Mar 02, 2012 4:33 pm

h264 + placebo + profile high: playback distortion with DXVA

Postby davor » Sun Mar 04, 2012 4:17 pm

My playback setup: XBMC with video hardware acceleration enabled (=DXVA2) on Win7

Now, if I encode a sample with “preset placebo + profile high” or “preset veryslow + profile high”, I get distortion in my picture (purple-like color everywhere with proper keyframes every 5-10sec). This is not the case with other samples encoded with “faster” presets.

As far as I see, this is due to enabled DXVA2, because when I disable it (software decoding), I get perfect picture, even with placebo-encoded samples.

But now I am confused. Doesn’t “--profile high” assure me that my sample should be playable with DXVA2 enabled?? It is an 1000kbps stream. (cf. Intel® HD Graphics: Support H.264/AVC decode acceleration High Profile @ L4.1 up to 40 Mbps. I am using Intel Core i3-550.)

Can someone explain? As far as I see, this is a bug (?).

Kind regards,
Davor

User avatar
Rodeo
HandBrake Team
Posts: 11178
Joined: Tue Mar 03, 2009 8:55 pm

Re: h264 + placebo + profile high: playback distortion with

Postby Rodeo » Sun Mar 04, 2012 4:58 pm

davor wrote:(cf. Intel® HD Graphics: Support H.264/AVC decode acceleration High Profile @ L4.1 up to 40 Mbps. I am using Intel Core i3-550.)


x264 presets/tunes and HandBrake
H.264 Profiles
H.264 Levels

davor
Posts: 14
Joined: Fri Mar 02, 2012 4:33 pm

Re: h264 + placebo + profile high: playback distortion with

Postby davor » Sun Mar 04, 2012 5:53 pm

Rodeo wrote:
davor wrote:(cf. Intel® HD Graphics: Support H.264/AVC decode acceleration High Profile @ L4.1 up to 40 Mbps. I am using Intel Core i3-550.)


H.264 Levels


Thank you for your instructive post. Had read about profiles, but not about levels…
As far as I understand, I should set these extra options to make placebo L4.1 compliant:
--encopts "ref=4:vbv-bufsize=78125:vbv-maxrate=62500"

I have tried this, and it works now with DXVA2 enabled.

But still, I don’t understand why there is no simple option like “--x264-level” as there is “--x264-profile”. Basically, what I need, and probably many users also, is to select a profile and level, and select the highest preset (i.e. placebo) which gives me the best quality given a certain bitrate.

Kind regards,
Davor

EDIT: I think --encopts "level=4.1:vbv-bufsize=78125:vbv-maxrate=62500" would also work.
EDIT2: It gives a warning that ref is set to 16.
Last edited by davor on Mon Mar 05, 2012 4:13 pm, edited 1 time in total.

Smithcraft
Veteran User
Posts: 2630
Joined: Thu Jan 22, 2009 8:04 pm

Re: h264 + placebo + profile high: playback distortion with

Postby Smithcraft » Sun Mar 04, 2012 8:28 pm

Not to go off topic, but does "placebo" mean something different with regards to x264?

SC

davor
Posts: 14
Joined: Fri Mar 02, 2012 4:33 pm

Re: h264 + placebo + profile high: playback distortion with

Postby davor » Mon Mar 05, 2012 4:23 pm

Smithcraft wrote:Not to go off topic, but does "placebo" mean something different with regards to x264?


As far as I can see from x264 presets/tunes and HandBrake, they are based on the x264 presets. So they are equivalent, and I think one would get the same results with --x264-preset placebo as with --encopts "preset=placebo".

So I think (hope) '--x264-preset placebo' is simply translated to '--encopts "preset=placebo"' and passed to the x264 encoder. Same holds for '--x264-tune' option.

Smithcraft
Veteran User
Posts: 2630
Joined: Thu Jan 22, 2009 8:04 pm

Re: h264 + placebo + profile high: playback distortion with

Postby Smithcraft » Mon Mar 05, 2012 9:38 pm

That's not quite what I'm asking. Going through the settings, it looks like it means exactly what I thought.

SC

User avatar
Rodeo
HandBrake Team
Posts: 11178
Joined: Tue Mar 03, 2009 8:55 pm

Re: h264 + placebo + profile high: playback distortion with

Postby Rodeo » Sat Mar 10, 2012 4:47 pm

davor wrote:But still, I don’t understand why there is no simple option like “--x264-level” as there is “--x264-profile”.


Because the function to ensure level compliance is not implemented in libx264 yet? We can't use a function that doesn't exist.

When x264 adds it (there are plans to do so), we'll add support for it to HandBrake (in the CLI).

User avatar
Rodeo
HandBrake Team
Posts: 11178
Joined: Tue Mar 03, 2009 8:55 pm

Re: h264 + placebo + profile high: playback distortion with

Postby Rodeo » Sat Mar 10, 2012 4:50 pm

davor wrote:So I think (hope) '--x264-preset placebo' is simply translated to '--encopts "preset=placebo"' and passed to the x264 encoder. Same holds for '--x264-tune' option.


No. "preset" is not a valid libx264 option. We need to use a dedicated function (x264_param_default_preset for presets and tunes, and x264_param_apply_profile for profiles). Otherwise there's be absolutely no need for dedicated options (you'd just use --encopts).

User avatar
Rodeo
HandBrake Team
Posts: 11178
Joined: Tue Mar 03, 2009 8:55 pm

Re: h264 + placebo + profile high: playback distortion with

Postby Rodeo » Mon Mar 19, 2012 11:53 pm

Rodeo wrote:
davor wrote:But still, I don’t understand why there is no simple option like “--x264-level” as there is “--x264-profile”.


Because the function to ensure level compliance is not implemented in libx264 yet? We can't use a function that doesn't exist.

When x264 adds it (there are plans to do so), we'll add support for it to HandBrake (in the CLI).


We might be adding our own variant of x264_param_apply_level instead.

If you know how to build from source: https://reviews.handbrake.fr/r/278/

User avatar
Rodeo
HandBrake Team
Posts: 11178
Joined: Tue Mar 03, 2009 8:55 pm

Re: h264 + placebo + profile high: playback distortion with

Postby Rodeo » Sat Mar 24, 2012 7:32 pm


davor
Posts: 14
Joined: Fri Mar 02, 2012 4:33 pm

Re: h264 + placebo + profile high: playback distortion with

Postby davor » Wed Mar 28, 2012 9:16 am



Looks interesting. Thank you!

davor
Posts: 14
Joined: Fri Mar 02, 2012 4:33 pm

Re: h264 + placebo + profile high: playback distortion with

Postby davor » Wed Aug 29, 2012 10:34 pm

I am still experiencing playback distortion when using 16 reference frames with DVD resolution. According tot this page 16 reference frames is well within the 4.1 spec, so it should work...

If I use 11 reference frames I get no playback distortion.

Any idea what might be wrong this time?

User avatar
Rodeo
HandBrake Team
Posts: 11178
Joined: Tue Mar 03, 2009 8:55 pm

Re: h264 + placebo + profile high: playback distortion with

Postby Rodeo » Wed Aug 29, 2012 11:44 pm

Nope. But TBH anything above 5-8 is overkill for most content.

davor
Posts: 14
Joined: Fri Mar 02, 2012 4:33 pm

Re: h264 + placebo + profile high: playback distortion with

Postby davor » Thu Aug 30, 2012 7:01 am

Rodeo wrote:Nope. But TBH anything above 5-8 is overkill for most content.


I have some encodings on 720p with 9ref, and they work just fine.

But 576p seems problematic. Even at 11ref I see glitches.


Return to “General”