PDA

View Full Version : [Guide] Blu-Ray Disc Authoring with x264 streams (Without Transcoding)


tal.aloni
7th April 2009, 12:22
This guide sums up how to encode / process your H.264 Elementary streams (created with x264) in order to prevent the Blu-Ray Authoring Software from re-encode them.
(those are the bare minimum requirements, they are not assuring Blu-Ray compliant Disc, only successful creation)

regarding b-pyramid:
use --b-pyramid strict or --b-pyramid none when encoding with x264.
avoid using --b-pyramid normal (the default), it's not Blu-Ray compliant, and even if your hardware support it, some authoring / processing software are known to introduce wrong frame order to such streams. (Sony DVD Architect and h264info)

* TSMuxer (and thus multiAVCHD) can handle b-pyramid successfully when remuxing .mkv to Blu-Ray, but fail as everybody else when adding picture timing to a raw elementary stream. (both for avc > avc (demux) and avc > container)

Sony DVD Architect 5.0b (Build 180):
Option 1: Encode using x264 revision 1510+, use the --aud switch. (you don't have to use the --nal-hrd switch)
Option 2: Run the stream through h264info (uncheck all checkboxes)

Notes:
1. renaming the stream to .avc is recommended
2. Don't use --b-pyramid normal with this software, frames will be displayed in the wrong time / order. it seems that the problem lies with the m2ts, as the stream itself is not being modified, and plays back correctly after remuxing.

Adobe Encore CS4:
Option 1: Encode using x264 revision 1510+, use the --nal-hrd and the --aud switches.
Option 2: Run the stream through h264info (uncheck all checkboxes)

Sonic Scenarist Workgroup Blu-Ray Disc Authoring 4.2:
Option 1: Encode using x264 revision 1510+, use the --nal-hrd and the --aud switches.
Option 2: Run the stream through h264info (uncheck all checkboxes)
(and don't forget to run the stream through the MUI generator)

TSMuxer / TSRemux:
No special preperations are required.

Notes:
1. Limited to a single clip. (multiple episodes are not supported)
2. No menu support.

* multiAVCHD is using TSMuxer for the muxing part.

Other software Tested:
Ulead Movie Factory 7 (Trial):
You'll have to mux the AVC stream into m2ts, the m2ts have to have audio (or you'll get a weird error message)
Movie Factory does not seem to support 1280x720, (1920x1080 is supported), also, I couldn't get 23.976 fps support,
ISO or folder creation is not suported as well, only burning, and only to BD-R / BD-RE media. for now, this is a very limited software.

Misc Info:
basic command line example:
--crf 20 --level 4.1 --keyint 24 --min-keyint 1 --ref 4 --mixed-refs --no-fast-pskip --bframes 8 --b-adapt 2 --weightb --direct auto --deblock -3:-3 --subme 9 --trellis 2 --aq-strength 0.8 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --qpmax 29 --vbv-bufsize 30000 --vbv-maxrate 40000 --me esa --merange 32 --threads auto --sar 1:1 --progress --aud

more info: http://forum.doom9.org/showthread.php?t=124835 (some inaccuracies though)

+ h264info version tested is v25 alpha

Contact me if you have corrections or information regarding other software, especially Sonic DVDit 6.4

authorhd
7th April 2009, 13:37
Sonic Scenarist Workgroup Blu-Ray Disc Authoring 4.2:
Option 1: Encode using the NAL HRD Patch, use the --nal-hrd and the --aud switches.
Option 2: Run the stream through h264info (uncheck all checkboxes)
(and don't forget to run the stream through the MUI generator)

[/b]


Sorry but if you use Sonic Cinevision to enocde the streams are always ok...:D

shon3i
7th April 2009, 14:40
AFAIK NAL HRD must be used always because is need for standalones. It will be nice if include information, what audio codecs are supported bu muxer. IIRC Sony DVD Architect support only AC3??

tal.aloni
7th April 2009, 15:11
AFAIK NAL HRD must be used always because is need for standalones.

1. the hardware I was testing does not seem to care, but you are right that most software authoring tools (all but sony architect actually) demand it. neither of us know if the specs demand it, but it safe to assume that they are.

2. you can easily add NAL HRD to the stream using h264info.

3. Sony Architect 5 is limited to AC3 & PCM.

laserfan
7th April 2009, 22:36
Dunno about the MF 7 trial, but my MF6+ with HD add-on does BDMV folder output no problem. It does want 29.97fps input, and max bitrate of 25Mbps, but sure makes nice menus!

deank
8th April 2009, 14:02
@tal.aloni: What exactly are you trying to test with multiAVCHD?

tal.aloni
8th April 2009, 17:28
Hey Deank, thanks for dropping by,
I'm trying to list all Blu-Ray muxing software that support
x264 input and the work-arounds required for each to avoid re-encode.
I did test multiAVCHD today, before that, I thought that multiAVCHD does it's own muxing, and discovered that TSMuxer is handling this part.

multiAVCHD is still left with an honorable mention.

Tal

deank
8th April 2009, 17:35
:) Right... at this point multiAVCHD still uses tsmuxer most of the time.

poisondeathray
8th April 2009, 19:10
Regarding DVD Architect, you can use the current MeGUI profiles (either AVCHD or blu-ray, but the blu-ray profile buffersize should be 30000, not 40000), just set output to RAW and it will pass through fine without re-encoding; if you set a container it will re-encode. No need to use any other tweaks or programs such as h264info, the --nal --hrd --sar 1:1 is preset in the profile

For Scenarist, lots of info here. It depends on which version you are using. The newer versions will gripe at you if you don't use 4 slices.
http://forum.doom9.org/showthread.php?t=143235

shon3i
8th April 2009, 20:01
you can use the current MeGUI profiles (either AVCHD or blu-ray, but the blu-ray profile buffersize should be 30000, not 40000),According this thread http://forum.doom9.org/showthread.php?t=139765 profiles are updated!

V85: Fixed VBV Buffer size for Standalone-Blu-Ray presets.

poisondeathray
8th April 2009, 20:05
@shon3i - I just updated the MeGUI profile on my system and it is indeed corrected, thanks for the heads up

Just to add for DVD architect - you have to select "all files" on import for the raw avc files to be "visible", and you don't need to rename .264 to .avc (unless there was another reason to say this in the initial post?)

Cheers

tal.aloni
8th April 2009, 22:09
poisondeathray,
1. I'm having the feeling that .avc are being loaded faster than .264 / .h264, like there's some extra detection mechanism for any extension other than .avc

2. My experience is very different that yours regarding x264,
which Architect build version are you using?

poisondeathray
8th April 2009, 22:14
tal.aloni - I just upgraded yesterday to the same version (5.0 build 173) after reading your thread, and did some testing (I had been using 4.5 in the past, which didn't support blu-ray)

What is different with your experience/testing?

tal.aloni
8th April 2009, 22:22
my mistake, I now see that you mentioned --nal-hrd, so you're using the patched build as I wrote, just with a GUI.
Due to a bug, Architect won't accept x264 streams from the current x264 builds (x264.nl).

poisondeathray
8th April 2009, 22:30
OK.

Interestingly it has to be RAW, and can never be wrapped. Even if you encode it raw (this imports fine and passes through fine), then wrap it into mp4 then extract the raw stream again (now .h264) , it will re-encode it the "unwrapped" video. Even if you rename the .h264 to .264, it will still re-encode. I have no idea why this is, but this behaviour is similar to the behaviour in the Scenarist thread if you read the link above.

Bottom line: encode everything raw

tal.aloni
8th April 2009, 22:46
yea, we need some software to restructure those streams, h264info / TSRemux are a good start, but not perfect yet.

you can use h264_parse to compare between the streams and see what's added / changed. (very useful)

here is a special 1.6.1 version I made with a larger lookup buffer (the official one does not work well with HD resolutions)

usage:
h264_parse.exe "C:\stream.h264" > "C:\structure.txt"

http://iknowu.net/files/public/mpeg4ip/h264_parse.exe

poisondeathray
8th April 2009, 22:54
^What is wrong with the h264info fix? (what is "not perfect" about it)?

I just did the same thing: wrapped .mp4, extracted, then ran thru h264info as per your instructions (unchecked boxes), now it is accepted with no re-encoding (either extension seems fine: avc, h264, 264)

tal.aloni
8th April 2009, 23:15
AFAIK, h264info doesn't calculate the correct SEI pic_timing when the stream was encoded with b-pyramid

Trahald
10th April 2009, 22:14
If i can find some old source I'll fix that (might be missing some features). I messed up my working directory too bad to fix continue there.

Golgot13
11th April 2009, 12:22
Hi all,


there are today two BD SDK muxer used by all BD authoring software (professional or not):

- Sony BD muxer used by BluPrint and Scenarist BD for professional version
Sony's software (Architect, Vegas,...), Adobe's software (Premiere), Sonic's software... for others

- Ulead/Corel BD muxer used by DSA NetBlender and Canvass software for professional version
And by DMF for public software.


Sony SDK don't check all data on H264 stream, it check only if the header are present.
But Ulead/Corel SDK check all data: header and the stream.


About BD player, the header are really not necessary because it's a chipset which decode the video stream.
And much of this video decoder chipset can decode some data which are not respect the BD specification.

Why the SDK need the header, because it's easy to mux the data with them
(the muxer don't need to decode/understand the picture data on stream).

DiKey
12th August 2009, 06:29
Who knows the Adobe Encore CS3 NoTranscode params?

DiKey
7th February 2010, 13:50
Encore CS3 works perfectly without transcoding and without useing h264info.

galinette69
17th September 2011, 17:40
Hello,

Thanks for this guide
I am trying to author a bluray with 720x576 interlaced content, with x264 and DVD Architect. I cannot find encoding settings for allowing DVDA to mux without re-encoding.
I can do it without problem in 720p, so this is likely an interlacing issue. DVDA does officially not accept progressive 576 streams (because the bluray standard does not) and is not validating my interlaced streams.

My interlaced encoded streams are well recognized under Sony Vegas, which detects correctly the aspect ratio and interlacing flag. So it is there.

My encoding settings are :
program --level 4.1 --bluray-compat --crf 20 --keyint 25 --open-gop --ref 4 --weightp 0 --slices 4 --vbv-bufsize 30000 --vbv-maxrate 40000 --tff --colorprim bt470bg --transfer bt470bg --colormatrix bt470bg --output "output" "input"

I also tried with fake-interlaced with no success.

Thanks for any help!

Etienne

nixo
17th September 2011, 18:09
It's a DVD Architect bug:
http://www.x264bluray.com/issues-with-certain-players

--
Nikolaj

galinette69
18th September 2011, 11:45
Ouch, sounds bad...

Do someone know the reason for this? I will try to look at the flags in a vegas encoded 576i stream (I suppose DVDA supports it) and compare to the flags from the x264 stream, but I'm not an expert. Unfortunately, the Sony encoder (Vegas/DVDA) is really not at the level of x264

I will give a try to TMPegEnc Authoring works

Thanks,

Etienne

7@mp3dotcom
19th September 2011, 20:07
I use the basic command line with Netblender's DoStudio and there have been no issues.

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