Log in

View Full Version : Problem with x264 encoding for Blu-ray


colinhunt
25th November 2014, 18:18
Hello gents,

I hope someone here can help me with this. I'm having trouble creating Blu-ray compatible .264 streams with x264(-64.exe). The resulting disc plays nicely on software players and on every standalone player I tested it on - except on PlayStation 3 and 4. On those playback stutters and jerks, like the stream is missing half its frames.

My source is a 1080p/24.00fps ProRes 4:2:2 file. Here's the pass 1 command line I used:

x264-64 --demuxer lavf --fps 24 --bluray-compat --preset veryslow --open-gop --bitrate 24000 --aud --nal-hrd vbr --level 4.1 --keyint 24 --sar 1:1 --b-pyramid strict --slices 4 --vbv-bufsize 30000 --vbv-maxrate 35000 --pass 1 -o VERYSLOW35MB_OUT.264 prores_feature.mov

I read on x264 wiki that "--b-pyramid strict" enforces restrictions imposed by the Blu-ray standard... but looking at BD-Rebuilder's LASTCMD.TXT I noticed this: "--b-pyramid none".

Other parameters used by BD-RB not present in my command are:
--weightp 1
--b-adapt 1
--pic-struct
--min-keyint 1

I also noticed that by omitting "--ref 4" the encoder seems to have used only 3 reference frames. MediaInfo reports 3 refs in Format settings, even though 4 refs are mentioned under encoder settings.

What I'd like to know:

1) What's the deal with --b-pyramid; "strict" or "none" for Blu-ray compatibility?
2) Which parameteres do I need to add to ensure proper playback on BD players, PlayStations included?
3) Does the order of parameters make a difference; i.e. should "--bluray-compat" be one of the first or one of the last parameters in the command?


I'm ever so grateful for any help and assistance you see fit to provide.

Asmodian
26th November 2014, 05:15
Have you already looked at www.x264bluray.com (http://www.x264bluray.com/)?

x264 --bitrate XXXXX --preset veryslow --tune film --bluray-compat --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 24 --open-gop --slices 4 --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o out.264 input.file

x264 --bitrate XXXXX --preset veryslow --tune film --bluray-compat --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 24 --open-gop --slices 4 --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 -o out.264 input.file

parameters are order agnostic, order does not matter.

Sharc
26th November 2014, 05:25
I think to remember that playstations have issues with --b-byramid; hence it had to be set to none.

colinhunt
26th November 2014, 08:41
Have you already looked at www.x264bluray.com (http://www.x264bluray.com/)?
That was new to me; thanks!

parameters are order agnostic, order does not matter.
What happens if I have a parameter that conflicts with --bluray-compat? Which parameter "wins"?

colinhunt
26th November 2014, 08:44
I think to remember that playstations have issues with --b-byramid; hence it had to be set to none.
That's very good to know, thank you.

I ran another encode last night:

x264-64 --bitrate 24000 --preset veryslow --bluray-compat --ref 4 --tune grain --direct auto --b-adapt 1 --demuxer lavf --fps 24 --b-pyramid none --weightp 1 --open-gop --qpmin=0 --aud --nal-hrd vbr --pic-struct --vbv-bufsize 30000 --keyint 24 --min-keyint 1 --vbv-maxrate 35000 --threads auto --level 4.1 --slices 4 --thread-input --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o V3_BDRBpars_OUT.264 source.mov

Will find out shortly if this one works any better. Fingers crossed :)

sneaker_ger
26th November 2014, 08:56
The PS3 is a fully fledged Blu-Ray player. It can't be broken with b-pyramid in general, lots of commercial Blu-Rays would fail. Could as well be a muxing problem (though disabling b-pyramid or bframes could be a workaround for a broken muxer).

Ghitulescu
26th November 2014, 09:04
I think to remember that playstations have issues with --b-byramid; hence it had to be set to none.

All BD-players may have a problem with b-pyramids. In particular the older ones, with less memory on board. Newer ones might play such a stream, but it's a bonus (like playing back DivX) because the BD specs also limit the b-pyramids to a max. number, according to the chosen profile.

colinhunt
26th November 2014, 11:26
Last night's encode plays properly on PS3. Didn't have time to test on PS4 yet.

I was wondering about b-pyramid and all those thousands of commercial releases also; are they all encoded without b-pyramid for PlayStation compatibility?

The muxer I use has been used by studios on commercial releases so I doubt that's the issue. Can't be 100% sure about that, of course.

sneaker_ger
26th November 2014, 11:44
Old version of Sony Blu-Print?

colinhunt
26th November 2014, 20:58
Old version of Sony Blu-Print?
Blu-Disc Studio which uses DVDLogic's muxer.

Sharc
26th November 2014, 21:17
Any evidence of commercial BDs using in fact b-pyramids?

bigotti5
26th November 2014, 21:36
BD Standard allows only one B frame as ref
So if you use b-pyramid you have to use --b-pyramid strict

nixo
27th November 2014, 13:06
I think it could well be a muxer issue:
http://forum.doom9.org/showthread.php?p=1540116#post1540116

Better use "none", I'd think. Also, there are certainly commercial BD's using the exact settings from http://www.x264bluray.com.

--
Nikolaj

colinhunt
28th November 2014, 12:46
I think it could well be a muxer issue
Yes, it is. I just got confirmation from DVD Logic; their muxer has a problem with b-pyramids. Bad news for me, but it's good to know where the problem was, regardless.

Thank you very much indeed to all who took time to reply & comment.

iSeries
29th November 2014, 15:30
This issue has been present for quite a while:

http://forum.doom9.org/showthread.php?t=160682&page=8