Page 1 of 1

h264 + placebo + profile high: playback distortion with DXVA

Posted: Sun Mar 04, 2012 4:17 pm
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

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

Posted: Sun Mar 04, 2012 4:58 pm
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

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

Posted: Sun Mar 04, 2012 5:53 pm
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.

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

Posted: Sun Mar 04, 2012 8:28 pm
by Smithcraft
Not to go off topic, but does "placebo" mean something different with regards to x264?

SC

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

Posted: Mon Mar 05, 2012 4:23 pm
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.

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

Posted: Mon Mar 05, 2012 9:38 pm
by Smithcraft
That's not quite what I'm asking. Going through the settings, it looks like it means exactly what I thought.

SC

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

Posted: Sat Mar 10, 2012 4:47 pm
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).

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

Posted: Sat Mar 10, 2012 4:50 pm
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).

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

Posted: Mon Mar 19, 2012 11:53 pm
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/

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

Posted: Sat Mar 24, 2012 7:32 pm
by Deleted User 11865

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

Posted: Wed Mar 28, 2012 9:16 am
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!

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

Posted: Wed Aug 29, 2012 10:34 pm
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?

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

Posted: Wed Aug 29, 2012 11:44 pm
by Deleted User 11865
Nope. But TBH anything above 5-8 is overkill for most content.

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

Posted: Thu Aug 30, 2012 7:01 am
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.