h264 + placebo + profile high: playback distortion with DXVA

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
davor
Posts: 14
Joined: Fri Mar 02, 2012 4:33 pm

h264 + placebo + profile high: playback distortion with DXVA

Post by davor »

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
Deleted User 11865

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

Post by Deleted User 11865 »

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

Post by davor »

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: 2697
Joined: Thu Jan 22, 2009 8:04 pm

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

Post by Smithcraft »

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

Post by davor »

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: 2697
Joined: Thu Jan 22, 2009 8:04 pm

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

Post by Smithcraft »

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

SC
Deleted User 11865

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

Post by Deleted User 11865 »

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).
Deleted User 11865

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

Post by Deleted User 11865 »

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).
Deleted User 11865

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

Post by Deleted User 11865 »

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/
Deleted User 11865

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

Post by Deleted User 11865 »

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

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

Post by davor »

Rodeo wrote:https://trac.handbrake.fr/changeset/4534
https://trac.handbrake.fr/changeset/4535

Will be available in tomorrow's nightly.
Looks interesting. Thank you!
davor
Posts: 14
Joined: Fri Mar 02, 2012 4:33 pm

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

Post by davor »

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?
Deleted User 11865

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

Post by Deleted User 11865 »

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

Post by davor »

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.
Post Reply