View Full Version : Encoding Video for Blu-Ray using H264/AVC
shon3i
12th May 2010, 22:54
Here is part of specification that apply when encoding with H264/AVC codec, all parameters showed here are not guessing, it's based on original Blu-Ray specification, which are not available in public.
NOTE: This is discussion about settings that are for creating 100% compliant Blu-Ray structures, not for encoding from Blu-Ray sources to matroska/mp4 or other media, if you encode to those skip this nightmare :)
1. GENERAL CONSTRAINTS FOR MPEG-4 H264/AVC
1.1 ALLOWED RESOLUTIONS/FRAMERATES
tom.niko.users.sbb.rs/resolutions.png
https://forum.doom9.org/attachment.php?attachmentid=18660&stc=1&d=1718614590
1.2 ALLOWED LEVELS, PROFILES, REFERENCE FRAMES, VBV
1.2.1 Primary Video Rules
tom.niko.users.sbb.rs/gopsrefs2.png
https://forum.doom9.org/attachment.php?attachmentid=18661&stc=1&d=1718614633
1.2.2 Secondary Video Rules
NOTE: In case of 1080 and 720 resolutions same rules apply as Primary video, while 576 and 480 resolutions have stricter parameters showed in table:
tom.niko.users.sbb.rs/gopsrefs3.png
https://forum.doom9.org/attachment.php?attachmentid=18662&stc=1&d=1718614687
1.3 SIMPLE ASPECT RATIO
tom.niko.users.sbb.rs/sar.png
https://forum.doom9.org/attachment.php?attachmentid=18663&stc=1&d=1718614732
1.4 COLOR CHARACTERISTICS
tom.niko.users.sbb.rs/color.png
https://forum.doom9.org/attachment.php?attachmentid=18664&stc=1&d=1718614748
1.5 OTHER REQUIRED PARAMETERS
8-bit (4:2:0) Colorspace is only allowed
Main and High profiles are allowed
Maximum 3 B-Frames is allowed
NAL-HRD Type 2 capable encoder is needed
2. ENCODE BLU-RAY VIDEO USING x264
2.1 MANDATORY PARAMETERS
Every encode for Blu-Ray must contain this parameters, without it will not meet Blu-Ray specification.
--bluray-compatEnforce x264 to create BD compliant stream, that will reduce x264 settings to BD compatible: bframe<=3, ref<=4 for 1080, ref<=6 for 720/576/480, bpyramid<=strict, weightp<=1, aud=1, nalhrd=vbr
--levelBlu-Ray level, see the table for the appropriate level
--keyintMaximum number displayed pictures in GOP. If you set Maximum bitrate less or equal to 15mbps you can use 2 second long GOP otherwise, 1 second GOP must be used.
--vbv-maxrateMaximum allowed bitrate. Depend of destination media, for normal BD Media, maximum settings is allowed (40000), while for DVD Media (eg BD-5 or BD-9) there is no maximum per Blu-Ray specification, but is strongly recommended that use less or equal to 15000, since DVD reading is slower.
--vbv-bufsizeMaximum allowed buffer, buffer size is in relation with maxrate. Since STD Buffer Delay for Blu-Ray allows maximum 1 second. This mean to divide buffer with maxrate and see if result is less or equal to 1, if not, buffer is need to be reduced to lower value that meet 1 second STD. For BD media, maximum settings is allowed (30000), but if not meet STD Buffer Delay, then need to be reduced to lower value. For DVD media there is no maximum in Blu-Ray specification, but is strongly recommended that use less or equal to 15000, and again need to meet STD delay of 1 second.
For example:
--vbv-bufsize 30000 --vbv-maxrate 40000 is allowed
--vbv-bufsize 30000 --vbv-maxrate 30000 is allowed
--vbv-bufsize 15000 --vbv-maxrate 30000 is allowed
--vbv-bufsize 30000 --vbv-maxrate 15000 is not allowed (delay is greater than 1 second)
Basicly vbv-bufsize should newer been greater than vbv-maxrate, that is whole point.
--sar
Simple Aspect Ratio, must present in stream, see the table for the appropriate settings
--slices
Only when encoding with --level 4.1, slices need to be set to 4 or greater, otherwise you can skip this setting or set it to 1.
-o xxx.264
Output file must be in raw 264 elementary stream (extension .264) otherwise settings will not applied correctly. DO NOT USE MKV OR MP4.
2.2 OPTIONAL PARAMETERS
This parameters is optional and not need for every encode.
--colorprim
--transfer
--colormatrix
Specify color primaries, transfer characteristics and color matrix. This is optional, and not need to be present, see the table for the appropriate settings.
--pic-struct
Need only when fake interlaced is used, and it's default on with interlaced and pulldown. It's fine with progressive aslo, and some BD verification tools request to be present in stream.
--open-gop
Use non-IDR pictures instead classic IDR picture, this will tend to resolve pulsing picture problem that is usually came with short GOP's.
--fake-interlaced
Since 25p or 30p video is not allowed for Primary Video, encoding progressive video that meet Blu-Ray specification is only possible with this option. If use this option you aslo need to specify --pic-struct
--qpfileNeed for chapters.
2.2 EXAMPLES
Progressive
1080p (http://www.x264bluray.com/home/1080i-p)
720p (http://www.x264bluray.com/home/720p-encoding)
576p (http://www.x264bluray.com/home/576p-pal)
480p (http://www.x264bluray.com/home/480p-ntsc)
Interlaced
1080i (http://www.x264bluray.com/home/1080i)
576i (http://www.x264bluray.com/home/576i-pal)
480i (http://www.x264bluray.com/home/480i-ntsc)
b66pak
12th May 2010, 23:19
thanks a lot...
_
Guest
12th May 2010, 23:46
Please advise when it is complete so we can make it a stickie. Thank you.
AnonCrow
13th May 2010, 00:31
Little nitpick : since you're using images and you're hosting them yourself, might want to optimize them for smaller size - pics 1 and 2 went from 50 KiB and 62 KiB to 13 and 16 KiB, respectively , just by decreasing bit-depth and using maximum PNG compression. This without even resorting to PNGOUT or Pngcrush.
ajp_anton
13th May 2010, 02:24
What does "Max bitrate BD, DVD and with or without 2 sec GOP" mean?
And to do 25fps progressive, you have to either double the framerate to 50fps, or encode it as 25fps interlaced?
creamyhorror
13th May 2010, 03:11
Thanks for doing this. I think a specific x264 section with recommended commandlines and workflow notes would be essential.
shon3i
13th May 2010, 07:30
@AnonCrow, thanks for tip. i probably will upload later here as attach, but i will optimize as much as possible.
What does "Max bitrate BD, DVD and with or without 2 sec GOP" mean?It mean, if you target is BD media and if you set VBV maxrate <=15000 then you can use --keyint from Max Frames in 2 sec. GOP. Or if you target media is DVD (BD5/BD9) you aslo may not use higher maxrate/buffer than 15000, coz DVD spin speed is lower, that is some error free maximum for DVD. Still if you set maxrate to 15000 you can choose what you want to use 1 second or 2 second GOP, for BD or DVD.
And to do 25fps progressive, you have to either double the framerate to 50fps, or encode it as 25fps interlaced? You need encode it as interlaced, or convert to 720p50.
Thanks for doing this. I think a specific x264 section with recommended commandlines and workflow notes would be essential. To be continued :) with explanation, examples, and few more tables.
Snowknight26
13th May 2010, 08:00
You need encode it as interlaced, or convert to 720p50.
Doesn't actually have to be interlaced, can just be flagged as interlaced yet contain progressive frames.
kieranrk
13th May 2010, 08:23
Doesn't actually have to be interlaced, can just be flagged as interlaced yet contain progressive frames.
If you had an encoder that can do adaptive PAFF/MBAFF then yes.
Or you could force it manually since the spec says frame_mbs_only shall be 0.
bob0r
13th May 2010, 10:03
May i advice, that instead of an image, maybe make a .html page or something silimar.
So in case of link down, or user absense, people can easy update or repost when needed.
kypec
13th May 2010, 10:06
May i advice, that instead of an image, maybe make a .html page or something silimar.
So in case of link down, or user absense, people can easy update or repost when needed.
+++ Images are nice but hardly maintainable nor usable (copy/paste) and so on.:goodpost:
kolak
13th May 2010, 11:26
I'm preaty sure that 25p is allowed for secondary video stream.
Andrew
mp3dom
13th May 2010, 11:31
Infact it's mentioned in the tab :)
I would like to add that even if it's allowed to have a fullHD secondary video, it's better to prefer SD secondary video because not all the standalone players are able to handle 2 fullhd stream at once.
Doesn't actually have to be interlaced, can just be flagged as interlaced yet contain progressive frames.If you had an encoder that can do "full" PAFF/MBAFF then yes.
Is x264 able to do this already? (= flagging the stream interlaced, but just coding progressive frames)
I've got many progressive PAL-sources (most satellite-streams are p anyway), and wouldn't like to encode that "interlaced". :(
kieranrk
13th May 2010, 13:07
Is x264 able to do this already? (= flagging the stream interlaced, but just coding progressive frames)
I've got many progressive PAL-sources (most satellite-streams are p anyway), and wouldn't like to encode that "interlaced". :(
You could modify x264 to write frame_mbs_only flag as zero. You'd have to write pic_struct too but the spec isn't clear whether it wants you to signal the frame as two fields or as one frame.
ajp_anton
13th May 2010, 13:31
It mean, if you target is BD media and if you set VBV maxrate <=15000 then you can use --keyint from Max Frames in 2 sec. GOP. Or if you target media is DVD (BD5/BD9) you aslo may not use higher maxrate/buffer than 15000, coz DVD spin speed is lower, that is some error free maximum for DVD. Still if you set maxrate to 15000 you can choose what you want to use 1 second or 2 second GOP, for BD or DVD.
But the "with or without 2 sec GOP" means it is 15000 *always*, whether or not you use 2 sec GOP, and this is false, because if you use 1 sec GOP with BD, it's 40000 and not 15000.
Sure 15000 can be used, but it's not max, which is what this tries to tell you.
IMO it should say something like
Max bitrate
2 sec GOP BD
DVD
rack04
13th May 2010, 14:55
Thanks for taking the time to put this together. Here are my comments:
1.) "RESOLITIONS" should be spelled "RESOLUTIONS"
2.) Add a section that includes mandatory items like --aud, --bframes 3, --nal-hrd vbr, etc. I know you mention bframes 3 in the title section of Section 2 but that could easily be overlooked by people who concentrate on big pretty pictures.
Sharc
13th May 2010, 15:00
Thanks a lot shon3i for your initiative :)
Thanks for doing this. I think a specific x264 section with recommended commandlines and workflow notes would be essential.
+++ Would indeed be very helpful.
Could it eventually be included in x264 as 'device presets' or similar?
poisondeathray
13th May 2010, 15:24
Nice work sho3ni!
And to do 25fps progressive, you have to either double the framerate to 50fps, or encode it as 25fps interlaced?
And another option would be to do the slowdown to 24p or 23.976p if you can tolerate the audio shift
shon3i
13th May 2010, 15:52
But the "with or without 2 sec GOP" means it is 15000 *always*, whether or not you use 2 sec GOP, and this is false, because if you use 1 sec GOP with BD, it's 40000 and not 15000.
Sure 15000 can be used, but it's not max, which is what this tries to tell you.
IMO it should say something like
Max bitrate
2 sec GOP BD
DVD
Not exactly because situation looks like this:
1. 15000 is max for DVD
2. 15000 is max i you want use 2 sec GOP besides you use DVD or BD
3. you can still use 1 sec gop.
so if you don't use 2 sec GOP that mean you will use 1 second instead. I will somehow fix this.
@all, be patient :)
kolak
13th May 2010, 15:56
Infact it's mentioned in the tab :)
I would like to add that even if it's allowed to have a fullHD secondary video, it's better to prefer SD secondary video because not all the standalone players are able to handle 2 fullhd stream at once.
I see it now :)
sub24ox7
13th May 2010, 17:32
What we still need are the exact specifications for 100% blu-ray compliant video I have a good idea or at least I am 99% sure I already know all the specifications I just want to be 100% sure.
Now that x264 can produce a 100% compliant blu-ray video I
think it would be a great Idea to have a sticky with he exact encoder settings.
ajp_anton
13th May 2010, 17:40
Not exactly because situation looks like this:
1. 15000 is max for DVD
2. 15000 is max i you want use 2 sec GOP besides you use DVD or BD
3. you can still use 1 sec gop.
so if you don't use 2 sec GOP that mean you will use 1 second instead. I will somehow fix this.
@all, be patient :)
What I suggested means
DVD, 1s GOP: 15000
DVD, 2s GOP: 15000
BD, 1s GOP: 40000 / 24000
BD, 2s GOP: 15000
You could make it even more clear by adding "1 sec GOP" to the 40000/24000 maxrate.
Or is this wrong?
shon3i
13th May 2010, 20:32
You could make it even more clear by adding "1 sec GOP" to the 40000/24000 maxrate.Yes you right, i will fix this somehow.
kolak
13th May 2010, 21:20
What we still need are the exact specifications for 100% blu-ray compliant video I have a good idea or at least I am 99% sure I already know all the specifications I just want to be 100% sure.
Now that x264 can produce a 100% compliant blu-ray video I
think it would be a great Idea to have a sticky with he exact encoder settings.
Keep in mind that x264 was mainly tested with 1920x1080 24p sources. If you start using other possible combination you may find some problems.
Losts of people use 40Mbit as max bitrate- this would be the first thing which I would avoid :) Encoding for BD is not exactly the same as for PC playback.
Andrew
laserfan
16th May 2010, 18:11
Thanks shon3i for the charts.
Question: I've been using --keyint 24 and 15000/15000 for all "BD"-on-DVD work, and given my bitrates are typically in the low 3500-7000 range should I really be using --keyint 48 instead to minimize "pulsing" at GOP changes?
poisondeathray
16th May 2010, 19:05
I can't see any reason NOT to use the longer gop size if you are <15Mbps.
shon3i
16th May 2010, 19:45
I can't see any reason NOT to use the longer gop size if you are <15Mbps.
I agree, longer gop, better compression efficiency, is not that marginal but probably will reduce some pulsing.
laserfan
16th May 2010, 19:53
Thanks for confirming!!! :)
MadMonkey57
18th May 2010, 17:58
And what about --min-keyint ? Does it have to be set with regards to --keyint or x264 default (auto) is blu ray compliant ?
Santa
18th May 2010, 20:55
I'm pretty sure to have a 25p or 30p bluray disc with some demo movies from panasonic.
is it sure that the only allowed progressive framerate for 1920x1080 resolution is 23.976 or 24p and not 25p or 30p?
i'll take a look on that bluray disc as soon as possible.
kieranrk
18th May 2010, 21:17
I'm pretty sure to have a 25p or 30p bluray disc with some demo movies from panasonic.
is it sure that the only allowed progressive framerate for 1920x1080 resolution is 23.976 or 24p and not 25p or 30p?
i'll take a look on that bluray disc as soon as possible.
It is possible using PAFF mode.
shon3i
18th May 2010, 21:37
There are many disc that out of specs even retail's, that disc probably is not done by any "expensive" authoring software, that follow BD Specs, which clearly not allow 25p or 30p as combination.
As kieranrk says, it's possible to encode as 50i or 60i using some of interlace modes, which not skrew PQ
kieranrk
18th May 2010, 23:12
which clearly not allow 25p or 30p as combination.
It doesn't say that per se. It says frame_mbs_only must be zero. This makes it possible to write progressive frames (i.e. all frames are progressive in PAFF mode)
poisondeathray
18th May 2010, 23:40
But has anyone seen it actually work in a hardware player? (encoding 25p/30p as 50i/60i)
TinTime
19th May 2010, 00:58
I've come across a couple of blu-rays that are nominaly 50i but are sped up films and so 25p. "Brick" and "The Reader" are both like that, in the UK anyway. Both were MBAFF I think.
kieranrk
21st May 2010, 15:21
The new fake-interlaced mode should encode 25p and 30p streams in a Blu-Ray compliant manner.
poisondeathray
21st May 2010, 15:26
The new fake-interlaced mode should encode 25p and 30p streams in a Blu-Ray compliant manner.
Interesting; is this a new patch ?
Can you provide more details on which switches or syntax to use to activate it?
rack04
21st May 2010, 15:30
Interesting; is this a new patch ?
Can you provide more details on which switches or syntax to use to activate it?
http://git.videolan.org/gitweb.cgi?p=x264.git;a=commit;h=1b48874d06c5927808554a3c869e6fd01db238bc
--fake-interlaced
Flag stream as interlaced but encode progressive. Makes it possible to encode 25p and 30p Blu-Ray streams. Ignored in interlaced mode.
poisondeathray
21st May 2010, 15:31
^ thanks for the clarification :)
mp3dom
23rd May 2010, 23:02
If you add the transfer characteristics/color primaries/colormatrix (to bt709) you also need (or, it's better) to add also the videoformat 'ntsc' if you're encoding at 30/60/23.98/24 fps. The pro-encoders do this (you can not add the information, but if you add them also the NTSC video format is specified). I haven't tested it, but probably for 25/50 fps the 'pal' video format is added.
Sagittaire
3rd June 2010, 10:01
Thanks shon3i for the charts.
Question: I've been using --keyint 24 and 15000/15000 for all "BD"-on-DVD work, and given my bitrates are typically in the low 3500-7000 range should I really be using --keyint 48 instead to minimize "pulsing" at GOP changes?
yes will work for all scenario ... and GOP 48 vs GOP 24 produce ~2% better compression efficiency.
laserfan
3rd June 2010, 15:08
... and GOP 48 vs GOP 24 produce ~2% better compression efficiency.Thanks a lot for this--while I'm unlikely to notice this type of improvement, I have changed my default to 48 keyint and the results work in my player! :)
MadMonkey57
4th June 2010, 12:49
And what about --min-keyint ? Does it have to be set with regards to --keyint or x264 default (auto) is blu ray compliant ?
Anyone ?
rack04
4th June 2010, 13:08
Anyone ?
I don't know whether it needs to be set but I error on the side of caution. If I know that something needs to be set I don't rely of a default/preset/tune to set it for me.
MadMonkey57
4th June 2010, 13:38
I agree. That's why I always set --min-key-int to 2 (which most of us use) for my 23.976p encodes.
Still I am wondering for other encodes especially 50p and 25i...
shon3i
4th June 2010, 15:29
Just leave default x264 setting. From revision r1537 x264 automaticly calculate min-keyint with keyint/10. so with Shot GOP min-keyint will be 2 with long 4, wich is just fine.
btw i am currently work to complete this stuff, be patient few more days with all need explanations :)
MadMonkey57
4th June 2010, 16:06
All right.Thanks.
Sharc
4th June 2010, 18:57
Will --fake-interlaced produce blu-ray compliant 576 encodes
of a progressive PAL DVD source? Or do I have to set --tff?
kieranrk
4th June 2010, 19:05
Will --fake-interlaced produce blu-ray compliant 576 encodes
of a progressive PAL DVD source? Or do I have to set --tff?
--fake-interlaced should work. You will need --pic-struct of course.
Sharc
4th June 2010, 19:48
Thanks, and for reminding me of the --pic-struct.
kieranrk
10th June 2010, 05:18
I wrote a simple guide for the most common Blu-Ray scenarios. See my sig.
Lyris
10th June 2010, 22:20
Much appreciated, Kieran, good to know my tests have been BD compliant.
Can you advise me (and others) here - are the following encode settings also good?
16:9 "NTSC" 720x480 Secondary Video stream
I know the max bit rate here is quite conservative, that is my intention.
x264 --bitrate 3000 --pass 1 --preset veryslow --weightp 0 --bframes 3 --me umh --merange 24 --partitions all
--subme 10 --trellis 2 --rc-lookahead 60 --direct auto --ref 6 --nal-hrd vbr --vbv-maxrate 4000 --vbv-bufsize 6000
--level 3.2 --keyint 24 --b-pyramid strict --slices 1 --aud --colorprim "smpte170m" --transfer "smpte170m"
--colormatrix "smpte170m" --sar 40:33 infile.avs -o outfile.avc
x264 --bitrate 3000 --pass 2 --preset veryslow --weightp 0 --bframes 3 --me umh --merange 24 --partitions all
--subme 10 --trellis 2 --rc-lookahead 60 --direct auto --ref 6 --nal-hrd vbr --vbv-maxrate 4000 --vbv-bufsize 6000
--level 3.2 --keyint 24 --b-pyramid strict --slices 1 --aud --colorprim "smpte170m" --transfer "smpte170m"
--colormatrix "smpte170m" --sar 40:33 infile.avs -o outfile.avc
Standard Definition Primary video (for bonus features, etc)
I gather that since 23.976fps is not allowed for SD material on BD, we need to add some sort of 3:2 pulldown flag. Is the way X264 does this BD compliant?
shon3i
10th June 2010, 22:40
Can you advise me (and others) here - are the following encode settings also good?
Everything look good to me. Just advice about vbv, keep both value near each other. You can use --keyint 48 aslo.
Standard Definition Primary video (for bonus features, etc)
I gather that since 23.976fps is not allowed for SD material on BD, we need to add some sort of 3:2 pulldown flag. Is the way X264 does this BD compliant? Yes but need to be interlaced aslo. If you sourtce is 23.976p you can use fake interlaced with 3:2 pulldown.
kieranrk
11th June 2010, 04:19
Yes but need to be interlaced aslo. If you sourtce is 23.976p you can use fake interlaced with 3:2 pulldown.
I'm not 100% sure that will pass some verifiers. It's a very strict interpretation of the spec.
shon3i
11th June 2010, 06:55
I'm not 100% sure that will pass some verifiers. It's a very strict interpretation of the spec.
As long is 29.97i should pass, but if someone send me a sample i can verify
EDIT: i create my own 23.976p sample, encoded using fake interlaced and puldown 32 to produce 29.97i stream, but this file will not pass mui generator.
Blue_MiSfit
11th June 2010, 08:50
Maybe just forget about fake interlaced and only use pulldown??
Derek
mp3dom
11th June 2010, 08:57
23.98p to 29.97i via 3:2 pulldown is allowed. Probably the fake-interlaced is not needed in this case.
shon3i
11th June 2010, 08:57
Maybe just forget about fake interlaced and only use pulldown??
Derek
it's ok for secondary video, but for primary 720x480 must be interlaced (or fake interlaced)
mp3dom
11th June 2010, 09:16
Doesn't the pulldown already flag the stream as interlaced?
shon3i
11th June 2010, 09:20
Doesn't the pulldown already flag the stream as interlaced?
No, why should?
mp3dom
11th June 2010, 09:32
Because it's based on field repetition. At least, with MPEG-2 a progressive stream when a pulldown is applied, becomes interlaced with RFF.
kieranrk
11th June 2010, 15:11
Because it's based on field repetition. At least, with MPEG-2 a progressive stream when a pulldown is applied, becomes interlaced with RFF.
The underlying stream is still coded progressively with soft pulldown.
EDIT: i create my own 23.976p sample, encoded using fake interlaced and puldown 32 to produce 29.97i stream, but this file will not pass mui generator.
I also tried and it seemed to pass.
shon3i
12th June 2010, 12:20
I also tried and it seemed to pass. It's my mistake :p
Sharktooth
8th July 2010, 18:58
just a question... for what resolutions/frame rates combinations is --pic-struct required?
kieranrk
8th July 2010, 19:26
just a question... for what resolutions/frame rates combinations is --pic-struct required?
Anything interlaced (that includes --fake-interlaced). It can't harm to put it on anyway though.
mp3dom
8th July 2010, 19:48
Personally I always set pic-struct even for progressive contents as some verifiers complains about its absence.
Sharktooth
8th July 2010, 19:59
Thanks. One more question. If i have a 480p24 source how can i produce a blu-ray compatible stream? i mean, should i convert the framerate to 29,976? in that case how should i set the --pulldown option?
shon3i
8th July 2010, 20:01
you need to use pulldown with fake interlaced or interlaced
Sharktooth
8th July 2010, 20:04
ok, so i should set something like --pulldown 32 --fake-interlaced --pic-struct ... etc.
shon3i
8th July 2010, 20:08
ok, so i should set something like --pulldown 32 --fake-interlaced --pic-struct ... etc.
yes, but you maybe need first assume 24000/1001, because pulldown 32 on 24p source will more that 29.970fps.
Sharktooth
8th July 2010, 20:14
the problem is more like 24fps and 23.976 fps are usually referred as 24 fps...
so that's more a user problem than mine (i asked all those questions coz im creating megui presets for BD encoding).
Avisynth_challenged
22nd July 2010, 20:28
Hi all,
I have a Huffyuv YV12 avi (1920x1080p @23.976fps) that I wish to encode to H.264 using x264. I'm interested in Blu-ray compliance, so looked around the forum and found this page:
http://sites.google.com/site/x264bluray/
I'm thinking of using the command line:
x264 --bitrate XXXXX --preset veryslow --tune film --weightp 0 --bframes 3
--nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 24
--b-pyramid strict --slices 4 --aud --colorprim "bt709" --transfer "bt709"
--colormatrix "bt709" --sar 1:1 --pass 1 -o out.264 input.file
I have a several questions:
1. I recall that for MPEG2 standard def encodes, a rule-of-thumb for bitrate is...
Avg: 6000 Kbps, Max: 8000 Kbps, Min: 2000 Kbps (...assuming 720x480p @23.976fps)
What rule-of-thumb bitrates are used for high-def H.264 encodes (1920x1080p @23.976fps)?
2. When encoding MPEG2 for DVD authoring, 23.976fps sources need to include pulldown flags to set the framerate to 29.97fps (soft-telecine) in NTSC-land. Does an H.264 encode need to have pulldown flags to achieve soft-telecine as well? Does the command line need to be revised to invoke pulldown?
3. MPEG2 encoders can often be configured to have the MPEG2 output be either in dropframe timecode format or non-dropframe timecode format. Does x264 have this capability available as a command line switch?
Thank you very much for your help.
mp3dom
22nd July 2010, 21:12
1. There's no general rule for bitrate. You can go up to 40 Mbps if necessary, but you need to adhere to VBV. For 23.98p if you have a lot of space to waste, you can have an average bitrate of 35 Mbps and a max of 40 Mbps (just as example)
2. For HD sources, 23.98/24p are allowed without any soft-pulldown (this doesn't depends by h.264, but BD specs. You can have the same using MPEG2 or VC1 sources). For SD primary-video you need soft pulldown because only 50i/59.94i are allowed.
I have a several questions:
1. I recall that for MPEG2 standard def encodes, a rule-of-thumb for bitrate is...
Avg: 6000 Kbps, Max: 8000 Kbps, Min: 2000 Kbps (...assuming 720x480p @23.976fps)
What rule-of-thumb bitrates are used for high-def H.264 encodes (1920x1080p @23.976fps)?
I'd rather use rule-of-thumb CRF. Generally 20 is a good value to start with. If there's a need to fit the video within limited space, derive the necessary average bitrate from the allowed file size and video length.
2. When encoding MPEG2 for DVD authoring, 23.976fps sources need to include pulldown flags to set the framerate to 29.97fps (soft-telecine) in NTSC-land. Does an H.264 encode need to have pulldown flags to achieve soft-telecine as well?
Blu-ray supports straight 24000/1001 fps 1080p video without pulldown flags.
3. MPEG2 encoders can often be configured to have the MPEG2 output be either in dropframe timecode format or non-dropframe timecode format. Does x264 have this capability available as a command line switch?
Drop frame timecodes are an NTSC nuisance, not HD.
video_magic
24th July 2010, 05:39
....
1. I recall that for MPEG2 standard def encodes, a rule-of-thumb for bitrate is...
Avg: 6000 Kbps, Max: 8000 Kbps, Min: 2000 Kbps (...assuming 720x480p @23.976fps)
What rule-of-thumb bitrates are used for high-def H.264 encodes (1920x1080p @23.976fps)?
....
Select a range of say, 1500 frames, from your source video (i.e. by using the trim command from avisynth in your .avs script), to use as a test to choose your bitrate but so you don't have to spend the time doing your entire video repeatedly until you find the bitrate (and other settings you might tweak and test); try and select the range from a fairly typical or even quite challenging part of your video.
I suggest for 1920x1080p , 23.976fps you try 7000 bitrate, and also do another encode at 10000 (both with exactly the same settings). Compare them with each other and with the source. Try increments of 2000 after that; but in addition to bitrate of course you could consider any other x264 settings or what you might have going on processing-wise before x264 encodes it.
Sharc
6th August 2010, 23:49
According to the first post in this thread the SAR for 720x576 resolution should be 16:11. My standalone (SONY 360) plays it back at 64:45 however, i.e. a picture with a SAR of 16:11 and flagged as 16:11 in the stream is slighly sqeezed on playback.
It's not a big issue, but has anyone seen a Blu-Ray standalone player which really obeys the SAR as signalled in the stream?
kieranrk
7th August 2010, 02:48
According to the first post in this thread the SAR for 720x576 resolution should be 16:11. My standalone (SONY 360) plays it back at 64:45 however, i.e. a picture with a SAR of 16:11 and flagged as 16:11 in the stream is slighly sqeezed on playback.
It's not a big issue, but has anyone seen a Blu-Ray standalone player which really obeys the SAR as signalled in the stream?
There is an aspect ratio flag in the HDMV extensions of the TS container that might be set wrong.
Sharc
7th August 2010, 09:21
There is an aspect ratio flag in the HDMV extensions of the TS container that might be set wrong.
Ah, the container. How can I check if this flag is set? Can tsMuxer set this flag? I didn't find an option.
A.Fenderson
31st August 2010, 20:36
I see --mvrange 511 set on a lot of blu-ray profiles: is this strictly necessary, or does it just seem to improve compatibility on some players?
shon3i
1st September 2010, 13:37
I see --mvrange 511 set on a lot of blu-ray profiles: is this strictly necessary, or does it just seem to improve compatibility on some players?
That is because earler version of x264 are not limit mvrange to 511.75, which is now default value, and it's fine for Blu-Ray.
MasterNobody
1st September 2010, 18:16
That is because earler version of x264 are not limit mvrange to 511.75, which is now default value, and it's fine for Blu-Ray.
This was changed almost 3 years ago in revision 697 (http://git.videolan.org/gitweb.cgi?p=x264.git;a=commit;h=a2db19e6ca89f40b2523f6964832c69369a3ee29) which anyway wasn't Blu-Ray compatible so I don't see the reason why it still appears in Blu-Ray profiles.
Ulf
16th September 2010, 21:39
Encoding 720p25 or 720p29.97 with "--pulldown double" and 480p23.976 with "--pulldown 32 --fake-interlaced --pic-struct" will yield Bly-ray compatible streams (assuming the rest of the settings are OK). The question is what the maximum setting for "--keyint" would be in these cases for a 1s GOP? Is "--keyint" referring to the original frame rate or the pulldown framerate, i.e. to 25 or to 50 in the case of 720p25?
Sharc
16th September 2010, 22:01
Encoding 720p25 or 720p29.97 with "--pulldown double" .....
Have you been successful with 720p25 --pulldown double? I get jerky playback on my BD standalone unless I encode without b frames.
Ulf
17th September 2010, 09:09
I get jerky playback on my BD standalone unless I encode without b frames.
Have you seen a significant difference in playback of a 720p25 clip encoded with "--pulldown double" and the same clip with frame duplication done before encoding, i.e. AssumeFrameBased().ComplementParity().SelectEvery(1,0,0) ?
kieranrk
17th September 2010, 12:45
Encoding 720p25 or 720p29.97 with "--pulldown double" and 480p23.976 with "--pulldown 32 --fake-interlaced --pic-struct" will yield Bly-ray compatible streams (assuming the rest of the settings are OK). The question is what the maximum setting for "--keyint" would be in these cases for a 1s GOP? Is "--keyint" referring to the original frame rate or the pulldown framerate, i.e. to 25 or to 50 in the case of 720p25?
I'm not actually 100% sure. I always thought a GOP had to have actual frames in it so --keyint 50 would be correct for 720p25.
Sharc
17th September 2010, 23:54
Have you seen a significant difference in playback of a 720p25 clip encoded with "--pulldown double" and the same clip with frame duplication done before encoding, i.e. AssumeFrameBased().ComplementParity().SelectEvery(1,0,0) ?
I did frame duplication like:
AssumeFieldBased().AssumeTFF()
FieldDeinterlace().ChangeFPS(50)
which was ok.
I believe that the problem with b-frames and --pulldown double in my case is that the re-ordering of the b-frames for playback is not done. Maybe a problem of the decoder.
Added:
I tried your script. It works as well. No jerkiness.
Unfortunately the file size for same crf becomes 50% larger with the frame-doubling.
I still have problems with '--pulldown double' and b-frames. It works with MPC-HC but fails (i.e. jerky playback) with VLC and with my standalone - unless I encode without b-frames.
Midzuki
18th September 2010, 14:42
I still have problems with '--pulldown double' and b-frames. It works with MPC-HC but fails (i.e. jerky playback) with VLC and with my standalone - unless I encode without b-frames.
Does it make a difference if you set --bframes to 2 or to 1 http://forum.doom9.org/images/icons/icon5.gif
Or if you use --b-adapt 0 :confused:
Sharc
18th September 2010, 17:24
Does it make a difference if you set --bframes to 2 or to 1 http://forum.doom9.org/images/icons/icon5.gif
Or if you use --b-adapt 0 :confused:
Yes, it makes a difference.
--bframes 2 removes the backward-and-forward jerkiness. The playback is however still choppy in VLC. I didn't test on the standalone yet.
--bframes 1 is about the same
--b-adapt 0 does not make a difference.
Midzuki
18th September 2010, 18:23
Thanks for the clarification.
Now, what about:
for n b-frames, --keyint = integer multiple of n+1 ;
N.B., 25 is not an integer multiple of 4, 3, or 2. http://forum.doom9.org/images/icons/icon3.gif
--b-adapt 0 does not make a difference.
OK, but it won't hurt (much) if you use it, I guess. :)
Sharc
18th September 2010, 23:06
Thanks for the clarification.
Now, what about:
for n b-frames, --keyint = integer multiple of n+1 ;
N.B., 25 is not an integer multiple of 4, 3, or 2. http://forum.doom9.org/images/icons/icon3.gif
OK, but it won't hurt (much) if you use it, I guess. :)
I normally use --bframes 3 and --keyint 24, which actually does comply with your proposal: 3+1=4 6x4=24. Similar for --bframes 2: 2+1=3 8x3=24. So --keyint 24 should be ok.
Removing --b-pyramid strict seems to help. No backward/forward jerkyness, but still choppy (means progressive, but not very fluent).
Ulf
19th September 2010, 12:11
I'm not actually 100% sure. I always thought a GOP had to have actual frames in it so --keyint 50 would be correct for 720p25.
If --keyint refers to actual encoded frames, wouldn't --keyint 25 be correct for 720p25 even when applying soft telecine (for a 1s GOP)? Is any x264 programmer around to enlighten us?
nm
19th September 2010, 12:19
Is any x264 programmers around to enlighten us?
IIRC, kieranrk is responsible for x264's pulldown support. :)
mp3dom
19th September 2010, 20:45
I have a question for people that have the BD specs on their hands:
I need to encode to BD with (relatively) low max bitrate (about 21 Mbps, but surely not over 24 Mbps) because I've a lot of lossless/PCM audio tracks to use. To gain a little, my idea is to encode as L4.0 to have the possibility to use 1 slice only. The specs says that L4.0 allow a maxrate of 24 Mbps which is perfectly fine for my job. The question is: the BD allows me with a L4.0 video to have a total BD bitrate of 48 Mbps (21 Mbps video + 27 Mbps audio) or with L4.0 my max BD bitrate is more limited?
shon3i
19th September 2010, 21:17
Video level bitrate restriction has nothing with overall bitrate which always stay to 48mbps if data rate is least 54mbps. Data rate dictates maximum allowed bitrate for disc. In normal case you always have 48mbps, and lowering video or audio max rate will not change that, only will make more space for other streams.
mp3dom
19th September 2010, 21:29
Thank you very much!
Sharc
21st September 2010, 20:18
IIRC, kieranrk is responsible for x264's pulldown support. :)
His guides are here (http://sites.google.com/site/x264bluray/home/720p-encoding) :)
(I still have no luck with --pulldown double and b-frames, but this is perhaps just me ....)
shon3i
21st September 2010, 20:31
His guides are here (http://sites.google.com/site/x264bluray/home/720p-encoding) :)
(I still have no luck with --pulldown double and b-frames, but this is perhaps just me ....)
What you use as BD muxer?
EDIT: btw max keyint must be on real fps not pulldowned, so for 720p25 is 25 not 50, 50 is valid for 2 sec GOP
Sharc
21st September 2010, 21:54
ok, I may have found my problem:
I have to delete '--b-adapt x' from the command line.
I tried
'--b-adapt 0' => jerky
'--b-adapt 1' => jerky
'--b-adapt 2' => jerky
removing '--b-adapt ... ' helped. Playback ok with MPC-HC and with VLC.
Now I still have to test with my standalone. I will report back.
And thanks shon3i for the clarification about the --keyint with pulldown.
shon3i
21st September 2010, 22:05
@Sharc it's Tsmuxer problem. Obviously has a problem with pulldown streams.
I do a simple test, i encode video with pulldown, i muxed it with scenarist and tsmuxer. tsmuxer's stream show jerky playback, while scenarist play smooth.
Sharc
21st September 2010, 22:15
@shon3i
Now I understand. Yes, I am using tsmuxer. So let's hope that they will fix it some time.
Until then it's better to skip b-frames, or to double the frames (I don't prefer because it increases files size), or to slowdown to 23.976.
Thanks for clarification. It's good to know the cause of the problem.:thanks:
shon3i
21st September 2010, 22:23
I think that slowdown to 23.976 or even to 24 will be more optimal.
Sharc
21st September 2010, 22:32
Yes, I did it successfully with 23.976. Video, audio and subtitles are all synchronous.
sneaker_ger
24th September 2010, 20:46
ok, I may have found my problem:
I have to delete '--b-adapt x' from the command line.
I tried
'--b-adapt 0' => jerky
'--b-adapt 1' => jerky
'--b-adapt 2' => jerky
removing '--b-adapt ... ' helped. Playback ok with MPC-HC and with VLC..
Are you sure? Not specifying "--b-adapt" should be exactly the same as "--b-adapt 1". :confused:
Sharc
24th September 2010, 22:33
Are you sure? Not specifying "--b-adapt" should be exactly the same as "--b-adapt 1". :confused:
Yes, you are right, of course :o
--b-adapt 2 => jerky (picture jumping backward/forward)
--b-adapt 1 => jerky (just somewhat different from --b-adapt 2)
--b-adapt 0 => jerky (much the same as --b-adapt 2)
My conclusion remains that --pulldown with b-frames and muxing with tsmuxer doesn't produce useful results - at least not here.
Dogway
22nd October 2010, 03:06
yes, but you maybe need first assume 24000/1001, because pulldown 32 on 24p source will more that 29.970fps.
My source is 1080 24p, so I guess I need to set those flags, but as Im talking about a music clip, will it get out of sync if I use assumefps?
Whatever I do all I get is a libgfl201.dll error it seems to ignore and then x264 warning me source is interlaced and encoding to 12/1 1920x2160i
Other than that are there important flags I must take special care when encoding non-compliant HD (as opposed to SD) ?
Biggiesized
23rd October 2010, 08:00
Sonic recommends to use SD frame sizes for secondary video to ensure the widest compatibility since not all players can decode full HD frame sizes in the secondary decoder.
newsky
24th October 2010, 16:58
I in despair. Encore CS4, CS5, Sony DVD Architect don't want to create Blu-ray a disk with a file having here such data:
Format : BDAV
Format/Info : Blu-ray Video
File size : 1.02 GiB
Duration : 5mn 2s
Overall bit rate : 28.9 Mbps
Maximum Overall bit rate : 35.5 Mbps
Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Duration : 5mn 2s
Bit rate mode : Variable
Bit rate : 27.4 Mbps
Maximum bit rate : 40.0 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.528
Stream size : 987 MiB (95%)
Writing library : x264 core 105 r1724 b02df7b
Encoding settings : cabac=1 / ref=4 / deblock=1:-2:-1 / analyse=0x3:0x133 / me=umh / subme=9 / psy=1 /
psy_rd=1.00:0.00 / mixed_ref=1 / me_range=26 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 /
chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / slices=4 / nr=0 / decimate=0 / interlaced=fake / constrained_intra=0 /
bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=0 / keyint=25 / keyint_min=2 /
scenecut=40 / intra_refresh=0 / rc_lookahead=25 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 /
vbv_maxrate=40000 / vbv_bufsize=30000 / crf_max=0.0 / ip_ratio=1.40 / aq=1:1.00 / nal_hrd=vbr
Color primaries : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
Transfer characteristics : BT.709-5, BT.1361
Matrix coefficients : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177
Please, prompt, where an error that it is necessary to correct, what parameters (to change, remove, add) what to receive a file corresponding to specification Blu-Ray.
Forgive for my English, I use a site the translator.
poisondeathray
24th October 2010, 17:07
@newsky - try adding --sar 1:1 it looks to be missing
or another approach would be to slowdown video & audio to 24p (or 23.976)
nixo
24th October 2010, 17:20
There are some things that mediainfo will not show ("--sar 1:1", "--pic-struct" and "--aud").
It would be easier if you posted a command line.
--
Nikolaj
kieranrk
24th October 2010, 17:25
I in despair. Encore CS4, CS5, Sony DVD Architect don't want to create Blu-ray a disk with a file having here such data:
DVD Architect has problems with bpyramid so use --b-pyramid none.
newsky
24th October 2010, 17:42
There are some things that mediainfo will not show ("--sar 1:1", "--pic-struct" and "--aud").
It would be easier if you posted a command line.
--
Nikolaj
video codec:
x264
video cli:
--crf 18.0 --level 4.1 --bframes 3 --ref 4 --deblock -2:-1 --merange 26 --slices 4 --aud --nal-hrd vbr --b-pyramid strict
--trellis 2 --no-fast-pskip --no-dct-decimate --keyint 25 --aud --partitions all --subme 9 --me umh --vbv-bufsize 30000
--vbv-maxrate 40000 --weightp 0 --fake-interlaced --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1
kieranrk
24th October 2010, 17:44
video codec:
x264
video cli:
--crf 18.0 --level 4.1 --bframes 3 --ref 4 --deblock -2:-1 --merange 26 --slices 4 --aud --nal-hrd vbr --b-pyramid strict
--trellis 2 --no-fast-pskip --no-dct-decimate --keyint 25 --aud --partitions all --subme 9 --me umh --vbv-bufsize 30000
--vbv-maxrate 40000 --weightp 0 --fake-interlaced --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1
needs --pic-struct
laserfan
24th October 2010, 17:51
needs --pic-structAnd as stated before --b-pyramid none
newsky
24th October 2010, 18:26
And as stated before --b-pyramid none
Added option for DVD Architect --b-pyramid none does not work, continue: File name: STREAM/00001.m2ts
Status: TSWrapper.dll::CTSWrapper::ProcThreadMain::This program has a bug. - m_ptsOfNextGOP is empty.
For the first time after you add the --pic-struct Encore CS4 didn't return the error:
Blu-Ray Error: "Device error", Code: "3", Note: "File can not open......... .ves"
and finished creating disk! The truth on a very small file, I'll try to encode large file and try again. Thank you so much! Can my settings still has to change something, I would be grateful for your great tips.
shon3i
24th October 2010, 18:53
Added option for DVD Architect --b-pyramid none does not work, continue: File name: STREAM/00001.m2ts
Status: TSWrapper.dll::CTSWrapper::ProcThreadMain::This program has a bug. - m_ptsOfNextGOP is empty.
For the first time after you add the --pic-struct Encore CS4 didn't return the error:
Blu-Ray Error: "Device error", Code: "3", Note: "File can not open......... .ves"
and finished creating disk! The truth on a very small file, I'll try to encode large file and try again. Thank you so much! Can my settings still has to change something, I would be grateful for your great tips.
m_ptsOfNextGOP is empty error is known for intelaced streams, actually is bug in muxer, DVD Architect currently is not good soultion for Blu-Ray if stream is not 1080p24. I hope they will soon update Architect.
--b-pyramid will not affect on muxing stage, but will prevent to not produce jittering.
newsky
24th October 2010, 19:11
To me the main thing that the Encore set up Blu-ray disc and DVD Architect I was hoping for a long time this error just once it came to DVD Architect decided to try again. I will try more files in the Encore, only need to create them again. And BTW DVD Architect files with --keyint 2 successfully creates a Blu-ray but these files are very large in size and as I understand it, does not meet specifications.
shon3i
24th October 2010, 19:35
Well --keyint 2 is completly by bd specs, but is ridiculous.
Emulgator
24th October 2010, 20:17
BTW, Sony DVD-A 5.2 is out, the error report about "m_ptsOfNextGOP is empty" is still there.
What I wonder is: The three x264 test streams reportedly encoded by version 1538+1 (BBB, ED, TallShip)
which were exposed some months ago to test for authoring did indeed mux fine in DVD-A 5.0b Build 180 without this error.
So my question is: What had been done to make these streams muxable ? The commandline was not exposed to full extent,
only recovered by others, and in the recovered commandline some arguments were passed more than once, so a bit suspicious to me.
I can not repeat any muxing success in DVD-A 5.0b Build 180 nor 5.2 Build 124 with 720x576x25i, other resolutions yet to be tested,
but no time now on my side...
P.S. Got it immediately after writing: All test streams were progressive.
Thanks shon3i.
kieranrk
26th October 2010, 17:14
I can not repeat any muxing success in DVD-A 5.0b Build 180 nor 5.2 Build 124 with 720x576x25i, other resolutions yet to be tested,
but no time now on my side...
If you can please report it to Sony.
henryho_hk
6th November 2010, 03:32
"15000 is max i you want use 2 sec GOP besides you use DVD or BD" == "15000 is max i you want use 2 sec GOP, no matter it is DVD or BD" ??
Lyris
6th November 2010, 03:53
For what it's worth, I gave up on DVD Architect after it produced a buggy SD DVD. With MPEG-2 SD video from TmpgEnc and also Cinema Craft SP2, the discs DVDA was producing would freeze up in certain Toshiba DVD and HD DVD players, and also some high end Pioneer Elite and Denon machines. (This was without any warning or errors reported by DVDA).
I sent Sony Creative all the info they'd need to fix it and they did look into it, but I moved over to DVD Studio Pro where the same assets worked perfectly. Just in case anyone is using DVDA for replication jobs, I thought I'd point this out.
shon3i
6th November 2010, 10:36
"15000 is max i you want use 2 sec GOP besides you use DVD or BD" == "15000 is max i you want use 2 sec GOP, no matter it is DVD or BD" ??
I made a typo, but goal is the same. If you use maximum bitrate that not exceed 15000, you can use whatever 1 or 2 sec GOP, on media you want DVD or Blu-Ray, rule are same
newsky
6th November 2010, 14:30
Prompt please, for video 1280x720p 50fps for record on DVD5 or DVD9 what value will be correct?
--vbv-maxrate 15000 --vbv-bufsize ????? --keyint 50?
--vbv-maxrate 15000 --vbv-bufsize ????? --keyint 100?
And what "correct" and "best" on quality?
shon3i
6th November 2010, 14:41
--vbv-maxrate 15000 --vbv-bufsize 15000 --keyint 50
--vbv-maxrate 15000 --vbv-bufsize 15000 --keyint 100
and both are correct for DVD5/9, and BD25/50 too.
Emulgator
9th November 2010, 16:51
For what it's worth, I gave up on DVD Architect after it produced a buggy SD DVD
Thanks Lyris, I am also not too sure where to go after DVDLab seems so have met its development end.
Not too much of authoring right now on my side, restoration eats most of my time...
So I am sometimes only digging around in DVD-A in hope it would be the future for DVD and Blu-ray in one app.
But the sony forum has many posts with troubles I thought would have been soved long time ago...
DVDBob
12th November 2010, 00:05
What is the best AVC Level for PAL DVD???
3.1, 3.2 or 4.1 ???
laserfan
17th November 2010, 18:45
I made a typo, but goal is the same. If you use maximum bitrate that not exceed 15000, you can use whatever 1 or 2 sec GOP, on media you want DVD or Blu-Ray, rule are sameRegarding BD-on-DVD5/9 bitrates, it seems to me I read here somewhere that one shouldn't use a bitrate which, when multiplied by 2x, exceeds the max bitrate/maxrate/bufsize (one or some of these anyway). So I have determined for 2-pass targets never to exceed 7500kbps as a target average bitrate. Is this correct?
Lyris
18th November 2010, 00:39
What is the best AVC Level for PAL DVD???
3.1, 3.2 or 4.1 ???
DVD? Can you clarify the question? This is a thread for Blu-ray Disc.
Or are you talking about BDMV/Blu-ray burned onto a standard DVD disc?
If so, see: http://sites.google.com/site/x264bluray/home/576i-pal
laserfan
23rd November 2010, 15:21
Regarding BD-on-DVD5/9 bitrates, it seems to me I read here somewhere that one shouldn't use a bitrate which, when multiplied by 2x, exceeds the max bitrate/maxrate/bufsize (one or some of these anyway). So I have determined for 2-pass targets never to exceed 7500kbps as a target average bitrate. Is this correct?
If shon3i doesn't know, maybe someone else here? 7500kbps maximum average bitrate when encoding BD for DVD disc?
nm
23rd November 2010, 15:26
If shon3i doesn't know, maybe someone else here? 7500kbps maximum average bitrate when encoding BD for DVD disc?
The BD on DVD5/9 limits are described in the tables and the text in the first post:
Maximum allowed bitrate. Depend of destination media, for normal BD Media, maximum settings is allowed (40000), while for DVD Media (eg BD-5 or BD-9) there is no maximum per Blu-Ray specification, but is strongly recommended that use less or equal to 15000, since DVD reading is slower.
Maximum allowed buffer, buffer size is in relation with maxrate. Since STD Buffer Delay for Blu-Ray allows maximum 1 second. This mean to divide buffer with maxrate and see if result is less or equal to 1, if not, buffer is need to be reduced to lower value that meet 1 second STD. For BD media, maximum settings is allowed (30000), but if not meet STD Buffer Delay, then need to be reduced to lower value. For DVD media there is no maximum in Blu-Ray specification, but is strongly recommended that use less or equal to 15000, and again need to meet STD delay of 1 second.
laserfan
23rd November 2010, 15:43
How does that answer my question: is that saying you can set (in x264) the average anywhere up-to 15000 and bufsize/maxrate will accommodate it?
nm
23rd November 2010, 15:45
How does that answer my question: is that saying you can set (in x264) the average anywhere up-to 15000 and bufsize/maxrate will accommodate it?
Bufsize and maxrate stay where you set them. Average can be set to anything up to maxrate.
shon3i
23rd November 2010, 17:39
If shon3i doesn't know, maybe someone else here? 7500kbps maximum average bitrate when encoding BD for DVD disc? I not saw your post :) sorry, well should not be a problem to use any bitrate if VBV of encoder work like should. DVD generally allow up to 18mbps of data, so you allready leave room for other streams.
laserfan
24th November 2010, 15:44
Bufsize and maxrate stay where you set them. Average can be set to anything up to maxrate.
...should not be a problem to use any bitrate if VBV of encoder work like should.
Thanks a lot; I'm a little slow but it's clear to me now! :)
rack04
8th December 2010, 01:32
Can someone confirm that the following x264 settings will create a compliant Blu-ray Disc?
The source is 720x480p23.976 DAR 16:9
C:\Program Files\x264\x264.exe --preset veryslow --tune film --pass 1 --bitrate 4000 --stats E:\Work\test.stats --level 4.1 --ref 6 --bframes 3 --keyint 60 --vbv-bufsize 15000 --vbv-maxrate 15000 --slices 4 --aud --sar 40:33 --pulldown 32 --fake-interlaced --b-pyramid strict --nal-hrd vbr --open-gop bluray --aq-mode 2 --colorprim smpte170m --transfer smpte170m --colormatrix smpte170m --output NUL E:\Work\test.avs --qpfile E:\Work\test.txt
C:\Program Files\x264\x264.exe --preset veryslow --tune film --pass 2 --bitrate 4000 --stats E:\Work\test.stats --level 4.1 --ref 6 --bframes 3 --keyint 60 --vbv-bufsize 15000 --vbv-maxrate 15000 --slices 4 --aud --sar 40:33 --pulldown 32 --fake-interlaced --b-pyramid strict --nal-hrd vbr --open-gop bluray --aq-mode 2 --colorprim smpte170m --transfer smpte170m --colormatrix smpte170m --output E:\Work\test.h264 E:\Work\test.avs --qpfile E:\Work\test.txt
shon3i
8th December 2010, 08:48
It seem ok.
jpsdr
8th December 2010, 09:54
Why stay in 4.1 ? If you go down to 4.0, you'll keep all the parameters, and can avoid the slices, and gain a little quality.
So, may advice would be to use --level 4.0 and remove --slices 4.
As you use --fake_interlaced, from what i've read, you need --pic-struct.
sneaker_ger
8th December 2010, 14:19
--pulldown implies --pic-struct.
So, the combination of --pulldown and --fake-interlaced is allowed/wise?
rack04
8th December 2010, 14:33
--pulldown implies --pic-struct.
So, the combination of --pulldown and --fake-interlaced is allowed/wise?
I assume the combination is allowed/wise since according to the standard 720x480 requires a fps of 29.970i. The question I have is that according to kieranrk, tsMuxeR doesn't work with x264's pulldown. Since this is the only authoring application that I have access to is there some other way to mux the stream? What about encoding without the pulldown and applying the pulldown using DGAVCPulldown? Would tsMuxeR mux this stream?
shon3i
8th December 2010, 15:32
It will produce same behavior. Pulldown <> Tsmuxer for all.
So, the combination of --pulldown and --fake-interlaced is allowed/wise? it's allowed fine.
sneaker_ger
8th December 2010, 20:29
Do you need to specify --fake-interlaced for Blu-Ray and soft 3:2 pulldown, then? I always thought that a 3:2 pulldown would inherently result in an interlaced stream. :confused:
shon3i
8th December 2010, 21:07
Do you need to specify --fake-interlaced for Blu-Ray and soft 3:2 pulldown, then? I always thought that a 3:2 pulldown would inherently result in an interlaced stream. :confused:
no, pulldown has nothing with interlaced.
Sharc
11th December 2010, 13:36
Should --fullrange be used for backups from blu-ray discs?
I understand that --fullrange is "off" by default.
shon3i
11th December 2010, 16:34
from bd specs..
video_full_range_flag shall be set to 0.
rapscallion
15th December 2010, 17:49
The first post describes when --pic-struct is required, but what exactly is that option and what does it do ?
kieranrk
15th December 2010, 17:58
The first post describes when --pic-struct is required, but what exactly is that option and what does it do ?
It writes extra syntax elements signalling the display type of the frame (e.g. 2 fields, frame, doubling, tripling) in the picture timing sei.
rapscallion
15th December 2010, 18:03
Thanks for the fast response ! Although not required for a BD progressive encode, that post states that it can't hurt and that some BD verification tools look for it in the stream.
From your response it sounds like including the option would slow a x264 encode somewhat ?
kieranrk
15th December 2010, 18:36
From your response it sounds like including the option would slow a x264 encode somewhat ?
Not at all.
rapscallion
15th December 2010, 18:39
Not at all.
Terrific! Thank you again.
rapscallion
20th December 2010, 17:35
I've read in this thread that x264 can utilize all 4 cores of a Core2 Duo Quad CPU.
However, will it utilise 2 separate Core2 Duo cpu's, totalling 4?
nm
20th December 2010, 18:30
However, will it utilise 2 separate Core2 Duo cpu's, totalling 4?
Only if the CPUs are on an SMP motherboard and the OS sees them all. x264 doesn't support clustering, so to run it across separate machines, you'd need to use/code additional tools.
rapscallion
20th December 2010, 18:43
Only if the CPUs are on an SMP motherboard and the OS sees them all. x264 doesn't support clustering, so to run it across separate machines, you'd need to use/code additional tools.
I should have been specific that the 2 cpus are on the same machine/motherboard. So yes, it's SMP.
This is the configuration of a PC that I'm considering, an HP XW8400 that has X2 Xeon Core 2 Duo @ 3.0 ghz .
nm
20th December 2010, 18:45
This is the configuration of a PC that I'm considering, an HP XW8400 that has X2 Xeon Core 2 Duo @ 3.0 ghz .
Yes, that's an SMP system and x264 works directly on both CPUs.
rapscallion
20th December 2010, 18:58
Yes, that's an SMP system and x264 works directly on both CPUs.
Great, thanks so much for the response !
kieranrk
26th February 2011, 00:35
Whilst I know other discs have been encoded with x264, "Keeper'n til Liverpool" (english: The Liverpool Goalie ) is the first confirmed disc that has been fully encoded with x264.
Lyris
26th February 2011, 01:34
Great news! I hope to add another to that list this year.
shon3i
26th February 2011, 22:34
Nice! Finaly!!
someone dump m2ts with mediainfo and:
Writing library : x264 core 112 r1834 a51816a
Encoding settings : cabac=1 / ref=4 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=24 /
chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=36 / sliced_threads=0 /
slices=4 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 /
weightb=1 / open_gop=0 / weightp=1 / keyint=24 / keyint_min=2 / scenecut=40 / intra_refresh=0 / rc_lookahead=24 / rc=cbr / mbtree=1 /
bitrate=38000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=51 / qpstep=4 / vbv_maxrate=38000 / vbv_bufsize=30000 / ip_ratio=1.40 / aq=1:1.00 / nal_hrd=vbr
preset veryslow, tune film, but 36 threads means that they have a very very ..... :)
mp3dom
27th February 2011, 14:16
They've used a 38Mbps CBR with a 'vbr' nal-hrd. Is it right?
As for 36 threads, they've a dual hexa-core which is not uncommon for companies that author BD :)
kieranrk
27th February 2011, 14:20
They've used a 38Mbps CBR with a 'vbr' nal-hrd. Is it right?
As for 36 threads, they've a dual hexa-core which is not uncommon for companies that author BD :)
Yes, you don't want strict CBR with stuffing data on Blu-rays.
nm
27th February 2011, 14:46
As for 36 threads, they've a dual hexa-core which is not uncommon for companies that author BD :)
More like dual dodeca-core, or quad hexa-core to get up to 36 / 1.5 = 24 cores.
Edit: yep with HT it could be 2x6. I started to think about AMD and forgot the HT Xeons.
kolak
27th February 2011, 14:52
I can bet it's 2 times x56xx Xeons machine. With HT on it's 24 cores and very common machine for heavy processing.
Andrew
Stereodude
27th February 2011, 20:32
I wrote a simple guide for the most common Blu-Ray scenarios. See my sig.Is there a reason why you omitted --ref 4 from your 1080p suggestions (http://www.x264bluray.com/home/1080i-p)?
x264 --bitrate XXXXX --preset veryslow --tune film --weightp 1 --bframes 3 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 24 --b-pyramid strict --slices 4 --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o out.264 input.file
x264 --bitrate XXXXX --preset veryslow --tune film --weightp 1 --bframes 3 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 24 --b-pyramid strict --slices 4 --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 -o out.264 input.file
Also, what about --open-gop bluray?
:thanks:
shon3i
27th February 2011, 22:21
Is there a reason why you omitted --ref 4 from your 1080p suggestions?It's because ref 4 is limit for 1080p resolution and level 4.1 (avc or bluray) so everything you use manually will be overridden
Also, what about --open-gop bluray?You can use it. The page will be updated.
sneaker_ger
27th February 2011, 23:19
It's because ref 4 is limit for 1080p resolution and level 4.1 (avc or bluray) so everything you use manually will be overridden
Actually the ref count set by preset, tuning and level will be overwritten by --ref. It does not matter for 1080p but should be kept in mind for 720p. (you probably know that, just for the silent readers out there)
Stereodude
28th February 2011, 01:49
Actually the ref count set by preset, tuning and level will be overwritten by --ref. It does not matter for 1080p but should be kept in mind for 720p. (you probably know that, just for the silent readers out there)So, what does --veryslow set for the --ref level?
sneaker_ger
28th February 2011, 02:15
16, which is in turn lowered by --level 4.1 to 4 for 1080p.
Stereodude
28th February 2011, 03:32
16, which is in turn lowered by --level 4.1 to 4 for 1080p.:thanks:
Is there a guide / documentation somewhere that lists what settings are integrated into the various presets ?
sneaker_ger
28th February 2011, 03:55
x264 --fullhelp > fullhelp.txt
Ulf
28th February 2011, 14:24
--ref bluray wanted
I would like to see a --ref bluray option in x264 that ensures that the setting for reference frames never exceeds the Blu-ray standard.
E.g. --preset slower --level 4 --ref bluray
should lower --ref from 8 to 6 for 720p material
kieranrk
1st March 2011, 12:57
--ref bluray wanted
I would like to see a --ref bluray option in x264 that ensures that the setting for reference frames never exceeds the Blu-ray standard.
E.g. --preset slower --level 4 --ref bluray
should lower --ref from 8 to 6 for 720p material
Patches welcome for --device bluray. Come on #x264dev if you want to add it to the current --device patch.
laserfan
1st March 2011, 16:14
Patches welcome for --device bluray. Come on #x264dev if you want to add it to the current --device patch.
Yeah but it's even hairy-er than that if you throw-in the distinction between "Blu-ray on BD disc" and "Blu-ray on DVD disc".
shon3i
1st March 2011, 16:32
Patches welcome for --device bluray. Come on #x264dev if you want to add it to the current --device patch.
I didn't know that devices exist? I would update patch (since should not be difficult). Btw it will be good to before encode, encoder check all settings, and if input resolution not match for example or combination of resolution and fps or other combinations, that encoder correct if mirror or stop encoding if some major issue.
Yeah but it's even hairy-er than that if you throw-in the distinction between "Blu-ray on BD disc" and "Blu-ray on DVD disc".Not only this, there is choose between Primary or seconadary video aslo
Overdrive80
3rd March 2011, 21:24
Hi guys, today is the first time that i have bluray material in my hands ^^. However, the source is 1080i @29.97; is anime Ghost Hound.
My question is if i can convert 1080i video to 1080p. I imagine, that I should deinterlacing to 23.976 before of encoding to x264, as with DVD interlacing material. Isn´t it?
Thanks-
mp3dom
3rd March 2011, 21:45
Watch closely the source. Is the animation 24p+3:2 pulldown? Is the animation a true 30p? Is the animation a mixture of the above (or contains true 60i footage?). Depending by how the animation was done you can do or can't do the conversion.
Also, are you making another BD or something else like MKV? If the former, you should stay at 60i if the animation is not fully 24p, if the latter, you can do variable framerate videos that exactly cover these kind of problems.
Overdrive80
3rd March 2011, 22:45
In mediainfo windows it can see this:
General
ID : 0 (0x0)
Complete name : E:\GHOST HOUND DISC 3\BDMV\STREAM\00002.m2ts
Format : BDAV
Format/Info : Blu-ray Video
File size : 4.58 GiB
Duration : 25mn 7s
Overall bit rate : 26.1 Mbps
Maximum Overall bit rate : 48.0 Mbps
Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : VC-1
Format profile : AP@L3
Codec ID : 234
Duration : 25mn 7s
Bit rate : 21.2 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 29.970 fps
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.340
Stream size : 3.71 GiB (81%)
I dont still analyse source for saying if its telecined, hybrid. My question was if I would have deinterlacing.
The project is for matroska file. However, I like know because i would have let video @ 60i if its for reencoding to BD. I imagine that you refer to bob deinterlacing, dont you?
mp3dom
4th March 2011, 00:19
On BD at a resolution of 1080, only 24p/23.976p is supported as a "progressive" framerate. 60 and 50 are supported only in interlaced mode (50p or 60p only available at 1280x720).
Your stream is flagged as interlaced but this doesn't tell anything (it's exactly the same as with dvds and mpeg-2). Since the BD at that framerate is 'forced' to be 60i, at the end you can have:
1) A 24p stream with 3:2 pulldown (you can remove the 3:2 with IVTC)
2) A 30p stream, encoded as progressive but flagged (forced) as interlaced (BD standard)
3) A combination of the above plus some parts at true 60i (rolling credits for example or some crossfades or two different scenes mixed together with a fieldshift or fades to black/white that was made not in the original animation, but later as post-production)
In the 1) case, you can avoid deinterlacing, just IVTC to obtain a true 24p stream. This anyway is quite strange because 24p is a native BD framerate, so there's no real reason to have a 24p stream with 3:2 pulldown on BD. This lead me to think that probably not the entire video is 'clean'.
In the 2) case, you don't need to deinterlace anything, since the frames are already progressive (only flagged as interlaced).
In the 3) case, you need special treatment (IVTC for the 24p+3:2 pulldown parts, deinterlace for true 60i parts and no deinterlace for 30p parts).
You should analyze the stream to made the proper choice.
Overdrive80
4th March 2011, 10:29
On BD at a resolution of 1080, only 24p/23.976p is supported as a "progressive" framerate. 60 and 50 are supported only in interlaced mode (50p or 60p only available at 1280x720).
Your stream is flagged as interlaced but this doesn't tell anything (it's exactly the same as with dvds and mpeg-2). Since the BD at that framerate is 'forced' to be 60i, at the end you can have:
1) A 24p stream with 3:2 pulldown (you can remove the 3:2 with IVTC)
2) A 30p stream, encoded as progressive but flagged (forced) as interlaced (BD standard)
3) A combination of the above plus some parts at true 60i (rolling credits for example or some crossfades or two different scenes mixed together with a fieldshift or fades to black/white that was made not in the original animation, but later as post-production)
In the 1) case, you can avoid deinterlacing, just IVTC to obtain a true 24p stream. This anyway is quite strange because 24p is a native BD framerate, so there's no real reason to have a 24p stream with 3:2 pulldown on BD. This lead me to think that probably not the entire video is 'clean'.
In the 2) case, you don't need to deinterlace anything, since the frames are already progressive (only flagged as interlaced).
In the 3) case, you need special treatment (IVTC for the 24p+3:2 pulldown parts, deinterlace for true 60i parts and no deinterlace for 30p parts).
You should analyze the stream to made the proper choice.
Now the main problem, is that megui dont load source VC-1 but I got load by tricks. However, I cant analyse properly.
Extract material HD in mkv, and with mkvextractgui, save stream video as avi. After, load avi video in adobe premiere and encode as h264. Now i can work with video. Do you know why megui dont cant load this source or how i could load it?
If BD source was hybrid i know only use animeivtc. I will tried use, time ago:
First, analysis pass.
TFM(mode=1, output="tfm.txt")
TDecimate(mode=4, output="stats.txt")
Second pass, filtered with rendering pass. After encode h.264.
TFM(mode=1,input="tfm.txt")
TDecimate(mode=5, hybrid=2, dupthresh=1.0, input="stats.txt", \
tfmin="tfm.txt", mkvout="timecodes.txt")
However the areas (credits) with true interlacing, not properly deinterlaced. Maybe is necesary to use trim command for specify areas as with animeivtc? If was it, could you put any code example, please?
latet
6th March 2011, 13:38
I just tested this:
PlayStation3 won't play BD disk encoded as AVC: 1280x720p25. The sound is fine, but the screen is black.
So this ALLOWED RESOLUTIONS/FRAMERATES guide: http://forum.doom9.org/showthread.php?t=154533 has to be taken very seriously and one really has to prepare 1280x720p50
But the frame doubling trick proposed here: http://sites.google.com/site/x264bluray/home/720p-encoding is a problematic solution, because of tsMuxer limitations.
I solved the problem by making "hard" 25p-->50p conversion. It won't affect the size of the compressed AVC video.
latet
QBhd
6th March 2011, 16:40
I just tested this:
I solved the problem by making "hard" 25p-->50p conversion. It won't affect the size of the compressed AVC video.
latet
So what settings did you use to "hard" encode your conversion... I am very curious since I have been banging my head over a similar problem
QB
sneaker_ger
6th March 2011, 16:52
AviSynth: ChangeFPS(50) ?
latet
6th March 2011, 17:53
So what settings did you use to "hard" encode your conversion... I am very curious since I have been banging my head over a similar problem
QB
I used VirtualDub's
Video/Frame rate/Frame rate conversion/Convert to: [50] fps.
Of course it required "Full processing mode". But it was no problem for me as I could do it on the source .avi/huffyuv files. I think you can do the same on every kind of source file, if you use VirtualDub's AviSynth plugin.
The output was true 50p, no tricks, no hacks, no pulldown flags. VirtualDub simply "cloned" (or doubled) each frame, just like that:
ABCDEF... ---> AABBCCDDEEFF...
And then I did AVC encoding:
x264 --bitrate XXXXX --preset veryslow --tune film --weightp 1 --bframes 3 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 50 --b-pyramid strict --open-gop bluray --slices 4 --ref 6 --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o out.264 input.file
x264 --bitrate XXXXX --preset veryslow --tune film --weightp 1 --bframes 3 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 50 --b-pyramid strict --open-gop bluray --slices 4 --ref 6 --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 -o out.264 input.file
It plays perfect on PS3.
However, I consider re-encoding the source once again using lower --ref (perhaps 3 instead of 6). The reason for that is a problem playing it on PowerDVD8. I described the problem here: http://forum.doom9.org/showthread.php?t=159913 but I'm not sure it has anything to do with ref frames.
I also don't know if I can simply change --ref 6 to --ref 3 without changing any other settings.
Previously I tried this "hack":
Frame doubling to comply 720p25 with the Blu-Ray specification:
x264 --bitrate XXXXX --preset veryslow --tune film --weightp 1 --bframes 3 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 25 --b-pyramid strict --open-gop bluray --slices 4 --ref 6 --aud --pulldown double --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o out.264 input.file
But tsMuxer couldn't generate a proper .m2ts file out of this.
Stereodude
6th March 2011, 17:55
But the frame doubling trick proposed here: http://sites.google.com/site/x264bluray/home/720p-encoding is a problematic solution, because of tsMuxer limitations.What exactly is the limitation? I tried a 1080p25 encode using that method and got choppy playback from the M2TS. But I got the same choppy playback from a MKV with the same x264 video encode also. But using that method at 24.975FPS (25000/1001) plays back nicely regardless of container (though I believe not a compliant blu-ray disc).
FWIW, I am in the US using 60Hz equipment.
shon3i
6th March 2011, 21:41
What exactly is the limitation? I tried a 1080p25 encode using that method and got choppy playback from the M2TS. But I got the same choppy playback from a MKV with the same x264 video encode also. But using that method at 24.975FPS (25000/1001) plays back nicely regardless of container (though I believe not a compliant blu-ray disc).
FWIW, I am in the US using 60Hz equipment.
Limitation is that you describe "choppy playback", which should not happen. Only muxers that follow specs like scenarist, blu-print, output pulldowned stream correctly and result is smooth playback.
QBhd
7th March 2011, 00:17
I used VirtualDub's
Video/Frame rate/Frame rate conversion/Convert to: [50] fps.
Of course it required "Full processing mode". But it was no problem for me as I could do it on the source .avi/huffyuv files. I think you can do the same on every kind of source file, if you use VirtualDub's AviSynth plugin.
Thanks for the point in another direction, I have been trying many things to get a 3 hour 4476 MB 720p @ 29.970 fps MKV converted to a BD-5. I have the x264 presets down, I have the proper authouring down, but I could not get it to a compliant frame rate for 720p. This was something new.
So this is what I did:
Used an AVS script creator (MeGUI's) to load the mkv and changed audio= from false to true. I then loaded the AVS into VirtualDubMod and converted the fps to 59.940 (as per your ponter). I then selected "Direct Steam Copy" instead of "Full Processing Mode" since any other setting seemed to generate an ENORMOUS file... as it is the MKV generated was 417 GB... yes GB
The video is YUV and the audio is PCM... Currently encoding with x264 (RipBot264) with the proper preset for 720p60 Blu-Ray compliance to fit on a single layer DVD.
My question to anyone reading this... Is there a better to do this without generating such a MASSIVE file with VirtualDubMod? All I want to do is double the framerate of my source (29.970==>59.940) with keeping the same time and keeping the audio in sync.
QB
sneaker_ger
7th March 2011, 01:05
As I said above, use ChangeFPS.
Add the following line to the end of the script:
ChangeFPS(60000,1001)
latet
7th March 2011, 01:29
My question to anyone reading this... Is there a better to do this without generating such a MASSIVE file with VirtualDubMod? All I want to do is double the framerate of my source (29.970==>59.940) with keeping the same time and keeping the audio in sync.
QB
Another approach (no need for Virtualdub, no need for frame doubling, no need for super-large free hdd space) is this: resize the video to 1920x1080 and re-encode it using the "fake interlace" setting. This will allow you to keep the 29,970p. Just as described here:
http://sites.google.com/site/x264bluray/home/1080i-p
I don't know the exact command line settings of x264.exe that will do the high-quality upscaling, but they must exists and you will surely find them.
Or - maybe even better - you can use resizing capability of AviSynth in .avs script (I've never done it myself but it should be easy).
BTW:after demuxing the MKV file there is .264 video stream file, and I don't know how to use it for re-encoding, because I can't make an .avs script for it (I try to do it using "AVS Script Creator" from "Tools" menu in MeGUI). Also - I can't play it with no software I have. So probably you should create .avs file for the source .mkv file without demuxing, and later use demuxing just to extract the soundtrack.
Let us know how it goes..
QBhd
7th March 2011, 01:59
As I said above, use ChangeFPS.
Add the following line to the end of the script:
ChangeFPS(60000,1001)
I am pretty sure I tried that and the length of the clip gets changed... so in this case the clip would be 6 hours. I will try again and let you know.
QB
Edit:
Well it seems to have worked. I have an issue with MeGUI doing a terrible job on bitrate calculations so my file was 23MB oversized.... grrr. Back to RipBot264... But the file was 720p59.940, it was in sync and it was still 2 hours 57 min. So the simple solution works. I must have done something wrong the last time I tried the ChangeFPS script. Thanks to all.
Stereodude
7th March 2011, 02:19
Limitation is that you describe "choppy playback", which should not happen. Only muxers that follow specs like scenarist, blu-print, output pulldowned stream correctly and result is smooth playback.But why would the same x264 encoded stream be choppy on playback when put in a .mkv container (no pulldown)? :confused:
shon3i
7th March 2011, 23:53
Well i don't know what is problem for you, but here is what i am talking about.
Source 720p25, pulldown to 720p50 to be BluRay compilant.
http://www.mediafire.com/?96cdi4sy749fy10 - mkv, playback smooth
http://www.mediafire.com/?4ovi24uc6p0e4l2 - scenarist, playback smooth
http://www.mediafire.com/?u2np6z3jooz12wm - tsmuxer, choppy playback
latet
8th March 2011, 00:00
Well i don't know what is problem for you, but here is what i am talking about.
Source 720p25, pulldown to 720p50 to be BluRay compilant.
http://www.mediafire.com/?96cdi4sy749fy10 - mkv, playback smooth
http://www.mediafire.com/?4ovi24uc6p0e4l2 - scenarist, playback smooth
http://www.mediafire.com/?u2np6z3jooz12wm - tsmuxer, choppy playback
Could you please tell us what tool you used to mux the mkv file?
Thanks a lot,
latet
shon3i
8th March 2011, 00:03
last version of mkvmerge only header compression is disabled.
latet
8th March 2011, 00:27
Well i don't know what is problem for you, but here is what i am talking about.
Source 720p25, pulldown to 720p50 to be BluRay compilant.
http://www.mediafire.com/?96cdi4sy749fy10 - mkv, playback smooth
http://www.mediafire.com/?4ovi24uc6p0e4l2 - scenarist, playback smooth
http://www.mediafire.com/?u2np6z3jooz12wm - tsmuxer, choppy playback
What a nice sample. Is it from a movie?
The tsmuxer version plays choppy on every softplayer except Splash Lite. All 3 samples play smoothly on Splash!
What do you mean by "only header compression is disabled"? Is it this: Muxing mode: Header stripping. What does it mean? Is it a problem?
latet
shon3i
8th March 2011, 00:39
What a nice sample. Is it from a movie?
The tsmuxer version plays choppy on every softplayer except Splash Lite. All 3 samples play smoothly on Splash!
What do you mean by "only header compression is disabled"? Is it this: Muxing mode: Header stripping. What does it mean? Is it a problem?
latet
It's test video "parkjoy" you can download it from http://media.xiph.org/video/derf/
Their decoder probably do magic, probably have some workaround for bad streams, but key is that tsmuxer sample aslo fails on hw players.
EDIT: Header compression removal is option in mkvmerge that is incompatible with some hw players, and can reproduce completely unplayable stream (black screen)
latet
8th March 2011, 10:03
It's test video "parkjoy" you can download it from http://media.xiph.org/video/derf/
Thanks, what a great sample source. But what exactly are .y4m files that most samples there are like that? Do I have to convert .y4m to something else in order to tsMux or MKV it?
Edit:
I've been testing your 3 samples and I'm a bit confused. I know that the original is 50 fps, but did you prepare them to be 25fps slow-motion 20-sec. clips + frame-doubling flag?
Because they played this way:
1. On my PC: they all play 25fps, lasting 20 sec. each. (Exception: any of them won't play on PowerDVD8 - which normally plays .m2ts files. A problem with frame-doubling flag?).
2. On my Samsung TV via USB stick (only mkv works) it's 25fps, 20 sec. (And the TV makes a very nice "motion plus" effect. Wonderful to watch).
3. On my Ferguson Ariva 210 player - they all play too fast - 50 fps - thus lasting 10 sec. each. But all 3 play smoothly, even tsmuxer.m2ts. I guess this hw player gets totally confused by the frame-doubling flag.
But what exactly are .y4m files that most samples there are like that? Do I have to convert .y4m to something else in order to tsMux or MKV it?
y4m is yuv4mpeg, a raw video format with headers that specify the framerate, width, height and some other information. You need to encode the raw video with x264 for Blu-ray output. x264 can read .y4m files directly.
latet
8th March 2011, 11:36
y4m is yuv4mpeg, a raw video format with headers that specify the framerate, width, height and some other information. You need to encode the raw video with x264 for Blu-ray output. x264 can read .y4m files directly.
I see. Thanks.
I've already downloaded one of the samples and I can't play or open it with anything, so - as you say - all I can do is encode it with x264 directly.
But tell me one more thing, please. Apart from different resolutions, many samples are in a couple of versions called: "4:4:4", "4:2:2", "4:2:0". I know it's "chroma subsampling" but I don't know what to do with this information. It is OK if I download only 4:2:0 versions?
I've looked into media-info log of many AVC-encoded video files I have (from different sources: blu-ray movies, raw camera dumps, my own tests) and they are all 4:2:0.
So I'm guessing I shouldn't be interested in 4:4:4 and 4:2:2 versions? They are much bigger too.
Would x264 read them properly anyway?
thank you.
But tell me one more thing, please. Apart from different resolutions, many samples are in a couple of versions called: "4:4:4", "4:2:2", "4:2:0". I know it's "chroma subsampling" but I don't know what to do with this information. It is OK if I download only 4:2:0 versions?
Yes, 4:2:0 is enough (unless you plan to do some filtering or editing where a higher chroma resolution might be useful). x264 only supports YUV 4:2:0 encoding and will convert any other formats to that.
shon3i
8th March 2011, 18:04
but did you prepare them to be 25fps slow-motion 20-sec. clips + frame-doubling flag? Yes.
1. On my PC: they all play 25fps, lasting 20 sec. each. (Exception: any of them won't play on PowerDVD8 - which normally plays .m2ts files. A problem with frame-doubling flag?).
2. On my Samsung TV via USB stick (only mkv works) it's 25fps, 20 sec. (And the TV makes a very nice "motion plus" effect. Wonderful to watch).
3. On my Ferguson Ariva 210 player - they all play too fast - 50 fps - thus lasting 10 sec. each. But all 3 play smoothly, even tsmuxer.m2ts. I guess this hw player gets totally confused by the frame-doubling flag. Expected behavior, pulldown is not for "normal" use or play out of required specs. So only rules are working for BD players, otherwise you should not use pulldown at all.
latet
9th March 2011, 01:04
Expected behavior, pulldown is not for "normal" use or play out of required specs. So only rules are working for BD players, otherwise you should not use pulldown at all.
How about "fake interlaced", recommended here: http://sites.google.com/site/x264bluray/home/1080i-p
Is it also so "dirty" hack and something one should not use, unless there is no other way?
shon3i
10th March 2011, 13:36
This site and this thread is how to encode for Blu-Ray (BD-R or DVD) with pure Blu-Ray structure, and if your target is not BD structure, or it's mkv or something else, you should not use any of these options.
kieranrk
10th March 2011, 13:59
This site and this thread is how to encode for Blu-Ray (BD-R or DVD) with pure Blu-Ray structure, and if your target is not BD structure, or it's mkv or something else, you should not use any of these options.
Yes, you will have timecode problems if you try and use pulldown with mkv, mp4 etc.
dvdboy
14th March 2011, 17:12
Despite having successfully encoded Blu-ray streams with x264 before, all of my attempts since Friday have produced "buffer underrun" errors in both Scenarist BD 5.1.3 and 5.2.
I've tried using both MeGUI and the commandline directly:
Open GOP
"C:\Software\AVC Encoding\MeGUI_1911_x86_WithoutInstaller\tools\x264\x264.exe" --bitrate 28000 --preset medium --tune film --weightp 1 --bframes 3 --nal-hrd vbr --vbv-maxrate 38000 --vbv-bufsize 30000 --profile high --level 4.1 --keyint 30 --b-pyramid strict --open-gop bluray --slices 4 --tff --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o "E:\DVD Department\output.264" "E:\DVD Department\input.avs"
"C:\Software\AVC Encoding\MeGUI_1911_x86_WithoutInstaller\tools\x264\x264.exe" --bitrate 28000 --preset medium --tune film --weightp 1 --bframes 3 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --profile high --level 4.1 --keyint 30 --b-pyramid strict --open-gop bluray --slices 4 --tff --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 -o "E:\DVD Department\output.264" "E:\DVD Department\input.avs"
Closed GOP
"C:\Software\AVC Encoding\MeGUI_1911_x86_WithoutInstaller\tools\x264\x264.exe" --bitrate 28000 --preset medium --profile high --tune film --weightp 1 --bframes 3 --nal-hrd vbr --vbv-maxrate 38000 --vbv-bufsize 30000 --level 4.1 --keyint 30 --b-pyramid strict --open-gop none --slices 4 --tff --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o "E:\DVD Department\output.264" "E:\DVD Department\input.avs"
"C:\Software\AVC Encoding\MeGUI_1911_x86_WithoutInstaller\tools\x264\x264.exe" --bitrate 28000 --preset medium --profile high --tune film --weightp 1 --bframes 3 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 30 --b-pyramid strict --open-gop none --slices 4 --tff --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 -o "E:\DVD Department\output.264" "E:\DVD Department\input.avs"
The reason I (tried) to add the --profile high lines, was I was concerned that the streams were being incorrectly flagged as Main Profile. :stupid:
The input file is a Quicktime via QTInput.
x264 core:114 r1913 5fd3dce
Just noticed a mismatch in the vbv maxrate on each pass, so I will run another test.
shon3i
14th March 2011, 17:56
what is resolution and fps of source video ?
dvdboy
14th March 2011, 18:15
what is resolution and fps of source video ?
1080i30 (29.97). Audio is exported WAV via Quicktime.
Format : MPEG-4
Format profile : QuickTime
Codec ID : qt
File size : 17.2 GiB
Duration : 11mn 31s
Overall bit rate : 214 Mbps
Encoded date : UTC 2011-03-10 19:02:28
Tagged date : UTC 2011-03-10 19:18:26
Writing library : Apple QuickTime
Media/UUID : 5AE9027B-9FFD-47E6-92A7-FD752340BA3D
Video
ID : 1
Format : ProRes
Format profile : High
Codec ID : apch
Duration : 11mn 31s
Bit rate mode : Variable
Bit rate : 212 Mbps
Width : 1 888 pixels
Original width : 1 920 pixels
Height : 1 062 pixels
Original height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 29.970 fps
Color space : YUV
Chroma subsampling : 4:2:2
Bits/(Pixel*Frame) : 3.525
Stream size : 17.1 GiB (99%)
Language : English
Encoded date : UTC 2011-03-10 19:02:28
Tagged date : UTC 2011-03-10 19:18:26
Audio
ID : 2
Format : PCM
Format settings, Endianness : Big
Format settings, Sign : Unsigned
Codec ID : in24
Duration : 11mn 31s
Bit rate mode : Constant
Bit rate : 2 304 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Bit depth : 24 bits
Stream size : 190 MiB (1%)
Language : English
Encoded date : UTC 2011-03-10 19:02:28
Tagged date : UTC 2011-03-10 19:18:26
JK1974
14th March 2011, 21:58
This site and this thread is how to encode for Blu-Ray (BD-R or DVD) with pure Blu-Ray structure, and if your target is not BD structure, or it's mkv or something else, you should not use any of these options.
Sorry, maybe I got something wrong, but I don´t understand this. I encoded 1080p24 as well as 1080i50 with the settings mentioned and made MKVs out of it for the following reasons:
1) I believe(d) that if I use a BD like encoding, I get higher compatibility as decoder chips are "optimized" for playing BD and AVCHD compliant video material.
2) I am open to demux and reauthor it as BD in case I want advanced features like menus, PiP etc. in case that those features are available in affordable BD authoring tools in the next few years and Blu-ray media become more widespread.
I was able to play back at least the 1080i50 encodings as AVCHD discs (tsmuxer) with my PS3, the 1080p24 encodings I did so far also made no problems with network media players (Sigma Designs/Realtek chipsets).
But maybe my situation is different as I don´t use any pulldown features...
shon3i
14th March 2011, 22:52
@dvdboy, did you try mux without audio ? can be audio problem.
@JK1974,
1) yes
2) no, because if you mux BD compatible stream to MKV, you will destroy some data which is irrevocable.
btw fake intelaced is less important as pulldown, i mean it will not effect on decoding process.
latet
15th March 2011, 00:32
2) no, because if you mux BD compatible stream to MKV, you will destroy some data which is irrevocable.
What exactly? Can you please write more about it?
Thank you.
shon3i
15th March 2011, 15:11
What exactly? Can you please write more about it?
Thank you.
There is significant difference between containers. Not all containers require same, and encoding process is different depending on container.
JK1974
15th March 2011, 15:23
There is significant difference between containers. Not all containers require same, and encoding process is different depending on container.
Still more details?
I am sure that I demuxed an MKV, made an AVCHD disc with TSMuxer and played it back flawlessly on the PS3. However, it might work as TSMuxer as well as the PS3 don´t check more details in the stream.
However, I am still a little concerned about my encodings as I just started editing and encoding my AVCHD camcorder recordings and wanted to use an open format like MKV instead of the uncomfortable and feature-poor AVCHD disc format.
shon3i
15th March 2011, 16:13
Still more details?Calculations for AUD and NAL data is different for specified container, therefore nal-hrd command will be different for different container, but aslo muxing raw stream to container (MKV, MP4) will be aslo strip some of this data without backing it on demux.
In real world, only few BD chips currently care of this (it will not play that stream). And there is BD Verification tools that will not approve stream, so if you don't care about 100% compliant stream then this should not bothering you.
latet
15th March 2011, 20:01
And there is BD Verification tools that will not approve stream
Could please write the name of such tool?
Thanks,
latet
shon3i
15th March 2011, 20:22
Could please write the name of such tool?
Thanks,
latet
Sony Verifier, Panasonic Verifier and many more BD disc verifiers, used in studios.
Sagittaire
16th March 2011, 14:26
Despite having successfully encoded Blu-ray streams with x264 before, all of my attempts since Friday have produced "buffer underrun" errors in both Scenarist BD 5.1.3 and 5.2.
I've tried using both MeGUI and the commandline directly:
Open GOP
Closed GOP
The reason I (tried) to add the --profile high lines, was I was concerned that the streams were being incorrectly flagged as Main Profile. :stupid:
The input file is a Quicktime via QTInput.
x264 core:114 r1913 5fd3dce
Just noticed a mismatch in the vbv maxrate on each pass, so I will run another test.
During encoding you change maxrate to 38000 for 40000 Kbps between first and second in your profil ... ???
IMO change maxrate at 35000 for mux compatibility (main stream PCM 5.1 and secondary stream AC3 5.1 ~ 5 Mbps)
With average near max it's perhaps better to make 3 pass for better HRD compatibility and peak bitrate quality.
kieranrk
16th March 2011, 15:23
1080i30 (29.97). Audio is exported WAV via Quicktime.
Make sure the framerate x264 reports is 30000/1001 and not anything else.
PM if you want to post any non-public information.
Rudde
18th March 2011, 03:03
Hey, I'm building a FreeBSD server and was wondering if there is any x264 build for FreeBSD that actively get updated?
dvdboy
21st March 2011, 16:45
@kieranrk @sagittaire
Thanks for the responses, sorry for not replying. I've been doing a number of tests with small pieces of footage that I felt happy posting samples from, but they all muxed in Scenarist fine! I then substituted the input in my 'good' commandline with the source material I was having issues with above, and this failed to mux.
Now this footage is side-by-side 3D footage, and I assume x264 doesn't 'care' about the contents of the footage, but to confirm I stretched the left eye back out to 1920, but it still failed. I kicked off a full program, which I haven't had a chance to drop into Scenarist yet.
@Saggitaire - yeah I noticed the mismatched max values and corrected that in my subsequent tests. I'll try both 3-pass and a lower max bitrate, although I though I was being quite conservative with 28Mbps Average, 38Mbps Max...
@kieranrk - I will give that a go in case the footage is funky - I assume a AssumeFPS line in the AVISynth will do the trick?
Many thanks for your help.
pepelugil
2nd April 2011, 08:15
I have some of these "1080i25" blu-rays, that have frames encoded progressively but to be standard compliant are flagged as interlaced and I want to backup them on BD-25.
I've added/changed these settings from my usual 100% 23,976 blu-ray compliant backups: --no-interlaced --fake-interlaced --keyint 25 --fps 25000/1000
Scenarist correctly accepts and muxes the resulting x264 stream without any error, but MediaInfo says that the resulting m2ts has 25 fps progressive while the original is correctly detected as 25fps MBAFF.
Do I have to worry about my 100% blu-ray compliant 1080i25 backups using x264 with the settings I'm using?
Greetings
MediaInfo says that the resulting m2ts has 25 fps progressive while the original is correctly detected as 25fps MBAFF.
Then the original is MBAFF and not fake-interlaced. With x264 the latter is significantly more efficient, at least until we get adaptive MBAFF.
Do I have to worry about my 100% blu-ray compliant 1080i25 backups using x264 with the settings I'm using?
Nope. AFAIK, there shouldn't be problems with --fake-interlaced. The guide (http://sites.google.com/site/x264bluray/home/1080i-p) suggests --pic-struct with it.
mp3dom
2nd April 2011, 13:31
pic-struct is mandatory for interlaced, fake-interlaced or pulldowned streams and optional for progressive stream.
Your file is accepted by Scenarist but this is not safe. Scenarist made only some minor checks so you should use a BD Verifier if you want to be 100% sure.
pepelugil
2nd April 2011, 14:13
I always use --pic-struct (even for progressive stream) so one less "problem".
As for BD verifiers, I have Elecard StreamEye Studio, but if I not wrong it doesn't check BD specification, so it seems that I'll have to trust Scenarist.
shon3i
2nd April 2011, 14:29
I always use --pic-struct (even for progressive stream) so one less "problem".
As for BD verifiers, I have Elecard StreamEye Studio, but if I not wrong it doesn't check BD specification, so it seems that I'll have to trust Scenarist.
You should not worry, becuase stream is progressive and it's marked as interlaced while frames are still frames not fields. Mediainfo and other tools just use header to examine data. Your stream must be interlaced or marked as interlaced (fake interlace) or will not be BD compilant.
mp3dom
2nd April 2011, 14:59
Shon3i, just out of curiosity, have you checked a fake-interlaced 25p with Sony Verifier? Because I've made a 25p with fake-interlaced just now to test. Scenarist accepts and mux (and identify the stream as interlaced) but my verifier (BDQuest) shows one error. It identify the stream as progressive while streams from pro-encoders (that allows the same thing, input a 25/30 progressive stream, encode as progressive and only flag as interlaced) are OK.
The error from BDQuest is (just for reference):
"invalid combination of horizontal size of frame (1920), vertical size of frame (1088), pic_width_in_mbs_minus1(119), pic_height_in_maps_units_minus1(33), frame_mbs_only_flag(0), framerate (25), and scanning type (progressive) for 1920x1080"
"frame_mbs_only_flag" is 0 and "mb_adaptive_field_frame_flag" is 0. 1920x1080 video (field) is expected to contain 8/9/8/9 rows in slices. Found 17/17/17/17
We know that BDQuest is not fully reliable, but who knows this time. Anyway CineVision (which supports the same thing as x264, set progressive source and flag as interlaced) flag the stream as MBAFF.
A.Fenderson
2nd April 2011, 17:07
I've added/changed these settings from my usual 100% 23,976 blu-ray compliant backups: --no-interlaced --fake-interlaced --keyint 25 --fps 25000/1000
I'm not finding any info on the --no-interlaced option on mewiki (http://mewiki.project357.com/wiki/X264_Settings)or x264 --fullhelp. Mewiki has one reference to --interlaced, but it tries to link back to a non-existent entry on the same page. What does this switch do?
kemuri-_9
2nd April 2011, 17:12
I'm not finding any info on the --no-interlaced option on mewiki (http://mewiki.project357.com/wiki/X264_Settings)or x264 --fullhelp. Mewiki has one reference to --interlaced, but it tries to link back to a non-existent entry on the same page. What does this switch do?
--no-interlaced causes the input to be treated as progressive, even if it were detected as interlaced.
Phil_L
2nd April 2011, 17:35
Hi
After a lot of trial and errors and reading tips here about x264 I finally settled on using MeGUI, and can successfully encode to 1080i/50 for Blu-ray. That is the good.
The bad is finding authoring software that will accept the output so looking for pointers. This is what I have found:
Sony DVD Architect, get tswrapper errors as it doesn't like MBAFF, so that's out.
Corel MovieFactory 7 - test clips I had success, clips accepted without re-rendering, perfect. But then when I tried some longer footage I got DVD engine errors, it would get so far then fail during mux'ing. I found the part mux'd mts file and so could see where it was failing. After some checking I found x264 was encoding with some high peak bit-rates of 50+, when MovieFactory got to something above ~45 it bombed. After some more trial and error I found reducing the buffer size the high peaks were reduced, with a buffer of 15000 I managed to get a clip almost mux'd in MovieFactory before it bombed out, it still managed to peak at one point.
I'm encoding with target bitrate of 36,000, and the max is the preset 40,000. The same bitrate settings via MainConcept's H264 I have no problems with, and when I check bit-rates it doesn't peak hardly above 40,000.
Now I gather with the buffer then peaks above 50,000 are valid for Blu-ray.
So my issue is how to author a Blu-ray disc with the x264 output?
I've also tried Cyberlink software, that wouldn't even recognise the files and I tried TMPGEnc Authoring Works 4, but it only wants MPEG2 for Blu-ray.
I have had success with MultiAVCHD, but I'm not entirely happy with the menu creation options, it's great for a free tool, but doesn't lend itself to more fancy graphical menus, unless I just haven't discovered that functionality.
I've also seen mention of Blu-ray verifiers, where would you get those so I can test the output is okay?
Any help or pointers appreciated.
Regards
Phil
shon3i
2nd April 2011, 18:16
Shon3i, just out of curiosity, have you checked a fake-interlaced 25p with Sony Verifier? Because I've made a 25p with fake-interlaced just now to test. Scenarist accepts and mux (and identify the stream as interlaced) but my verifier (BDQuest) shows one error. It identify the stream as progressive while streams from pro-encoders (that allows the same thing, input a 25/30 progressive stream, encode as progressive and only flag as interlaced) are OK.
The error from BDQuest is (just for reference):
"invalid combination of horizontal size of frame (1920), vertical size of frame (1088), pic_width_in_mbs_minus1(119), pic_height_in_maps_units_minus1(33), frame_mbs_only_flag(0), framerate (25), and scanning type (progressive) for 1920x1080"
"frame_mbs_only_flag" is 0 and "mb_adaptive_field_frame_flag" is 0. 1920x1080 video (field) is expected to contain 8/9/8/9 rows in slices. Found 17/17/17/17
We know that BDQuest is not fully reliable, but who knows this time. Anyway CineVision (which supports the same thing as x264, set progressive source and flag as interlaced) flag the stream as MBAFF.
Yep i checked it several times. Btw update your bdquest to lastest version they had bug with decoder.
dvdboy
5th April 2011, 14:59
Make sure the framerate x264 reports is 30000/1001 and not anything else.
PM if you want to post any non-public information.
A belated update but this in the end appears to be the problem - I added AssumeFPS(30000,1001) to the AVISynth script and Scenarist muxed the file fine.
I ran into a similar problem with an After Effects rendered Top Menu Background - even though everything said 23.976fps, I was getting the Buffer Underrun error. When I watched the x264 log go through, I noticed the framerate was being interpreted as 2997/125 rather than 24000/1001. Again AssumeFPS did the trick.
Many thanks for your help.
kolak
10th April 2011, 23:18
I always use --pic-struct (even for progressive stream) so one less "problem".
As for BD verifiers, I have Elecard StreamEye Studio, but if I not wrong it doesn't check BD specification, so it seems that I'll have to trust Scenarist.
Scenarist check is quite basic- has not much to do with strict BD compliancy.
Andrew
lutinor
14th April 2011, 18:58
that's sad that there isn't an accessible real bd check :(
iSeries
15th April 2011, 08:28
Could the first post be updated with the new --bluray-compat option for those of us (mainly me lol) who are a bit confused as to how to use it please?
shon3i
15th April 2011, 13:48
yes, it will be updated asap ;)
sneaker_ger
15th April 2011, 15:47
Could you also make a remark at the top that says that these settings are for creating 100% compliant Blu-Ray structures, not for encoding from Blu-Ray sources or to matroska/mp4? I see a lot of people crippling their settings for no need.
shon3i
15th April 2011, 16:40
Could you also make a remark at the top that says that these settings are for creating 100% compliant Blu-Ray structures, not for encoding from Blu-Ray sources or to matroska/mp4? I see a lot of people crippling their settings for no need.
Done :P
sneaker_ger
15th April 2011, 16:49
Great work. Thx.
laserfan
15th April 2011, 19:38
This is discussion about settings that are for creating 100% compliant Blu-Ray structures, not for encoding from Blu-Ray sources to matroska/mp4 or other media, if you encode to those skip this nightmare :)
And I thought it was just me who felt this way! ;)
Thanks for updating.
kieranrk
15th April 2011, 20:32
EDIT never mind
rapscallion
15th April 2011, 20:46
@shon3i
First page, 1080i example command line doesn't include --pic-struc ? Is that because it's only "required" for fake interlaced?
Also, your example assumes tff. Doesn't x264 encode @ MBAFF ?
What if the source is MBAFF, do you assume --tff command or something else?
mp3dom
15th April 2011, 21:23
@shon3i
First page, 1080i example command line doesn't include --pic-struc ? Is that because it's only "required" for fake interlaced?
It's required for interlaced and pulldown too, but in that case the pic-struct parameter is on by default, so no need to explicitly set.
Also, your example assumes tff. Doesn't x264 encode @ MBAFF ?
MBAFF is a way to encode interlaced footage (the other is PAFF). This refers to encoding, but the source footage still is tff or bff interlaced. MBAFF is not yet 100% implemented in x264. Currently it lacks the 'adaptive' part.
What if the source is MBAFF, do you assume --tff command or something else?
With AviSynth you can see which is the fieldorder and set x264 accordingly (with --tff or --bff)
rapscallion
15th April 2011, 22:16
@mp3dom
Thank you ! Very concise answers and just what I was looking for.
I opened w/avisynth via VirtualDub and I don't see the fieldorder in the file info.
Please advise how I do that. Thanks
mp3dom
15th April 2011, 22:36
AssumeTFF()
SeparateFields()
If the preview have jerky movements (watch in dynamic zones) then your video is BFF, otherwise is TFF. (You can do the opposite, AssumeBFF().SeparateFields() and if you have jerky motion your video is TFF, otherwise is BFF)
shon3i
15th April 2011, 22:53
BIG UPDATE: After kieranrk point me to part of source, --bluray-compat do some magic aslo beside only hacks.
Basically will reduce some of options to BD compliant ones. Here what will do:
automatically will down b-pyramid to strict, weightp to 1, bframes to 3, reference frames to 4 or 6 for 720/480/576 res, enable aud and nalhrd vbr.
so command line is pretty short now :)
rapscallion
15th April 2011, 22:57
AssumeTFF()
SeparateFields()
If the preview have jerky movements (watch in dynamic zones) then your video is BFF, otherwise is TFF. (You can do the opposite, AssumeBFF().SeparateFields() and if you have jerky motion your video is TFF, otherwise is BFF)
Thanks again mp3dom.
That worked, the vid is tff.
mp3dom
15th April 2011, 23:04
Isn't better to include in the bluray-compat also pic-struct? Considering that it's mandatory for fake-interlaced, pulldown and interlaced and is optional (but doesn't create problem and resolve some warnings coming from some BD verifiers) for progressive... It will never create problems on BD side.
shon3i
16th April 2011, 00:49
Now is mandatory for (interlaced, fakeinterlaced and pulldown) using bluray compat, since r1938 or r1939. Is not for progressive and not will be because is not in specs (yes i know)
jpsdr
16th April 2011, 07:48
weightp to 1
Yek ??? Oh no !! I must redo my encode and add weightp 2 in the commande line (it was in the preset before)... :(
laserfan
16th April 2011, 14:34
BIG UPDATE: After kieranrk point me to part of source, --bluray-compat do some magic aslo beside only hacks.
Basically will reduce some of options to BD compliant ones. Here what will do:
automatically will down b-pyramid to strict, weightp to 1, bframes to 3, reference frames to 4 or 6 for 720/480/576 res, enable aud and nalhrd vbr.
so command line is pretty short now :)
Thanks for this--you shon3i are a beacon of light in the x264 sea of Dark-ness! ;)
jpsdr
17th April 2011, 08:18
Now is mandatory for (interlaced, fakeinterlaced and pulldown) using bluray compat, since r1938 or r1939. Is not for progressive and not will be because is not in specs (yes i know)
r1938/r1939...???
According x264.nl, we are still on 1937...
shon3i
17th April 2011, 10:54
r1938/r1939...???
According x264.nl, we are still on 1937...
Just be patient, there is more commits so probably will be much higher revision than 1938 is coming.
Stereodude
30th April 2011, 15:27
Why does x264 sometimes whiff the target bitrate on a 2pass encode so badly?
Most of the time I've found it gets within a few kbit/sec (usually on the low side) when I'm encoding at a target bitrate to fill a Blu-Ray disc. However, I've found that ocassionally x264 will miss the bitrate by a lot more, generally on the low side but not always.
Here's the command line I used:x264.exe --bitrate 19110 --preset veryslow --tune film --weightp 1 --bframes 3 --ref 4 --bluray-compat --b-adapt 2 --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 --qpfile ___.chp -o NUL ___.AVS
x264.exe --bitrate 19110 --preset veryslow --tune film --weightp 1 --bframes 3 --ref 4 --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 --qpfile ___.chp -o ___.264 ___.AVSI asked for a bitrate of 19110kbit/sec and I got a file with a bitrate of 19067.15kbit/sec. :confused: It's not the end of the world, but I'm curious.
laserfan
30th April 2011, 15:56
Why does x264 sometimes whiff the target bitrate on a 2pass encode so badly?
I know you're not kidding, but... You're kidding, yes? That's 0.22%! :eek:
Stereodude
30th April 2011, 17:14
I know you're not kidding, but... You're kidding, yes? That's 0.22%! :eek:Ehh... poor choice of words there.
I'm just curious, not intended to be a whining complainer. It nails the bitrate as close as can be expected most of the time. Sometimes it less precise than it usually is. I'm wondering what causes the difference.
laserfan
30th April 2011, 17:49
Ehh... poor choice of words there.
No, it was a very careful choice of words. :p
Rejoice--0.22% is amazingly good, and in no way should be considered a "whiff" of the target.
rapscallion
30th April 2011, 18:30
It nails the bitrate as close as can be expected most of the time. Sometimes it less precise than it usually is. I'm wondering what causes the difference.
I imagine the complexity of the video source, the length, the quality and the amount of light vs dark scenes all play a role. I'm sure there are others as well. Considering it's VBR, it amazes me that it gets it as close a it does.
Stereodude
30th April 2011, 18:44
Rejoice--0.22% is amazingly good, and in no way should be considered a "whiff" of the target.Okay, let me reword so we can all be friends again... :p
Most of the time in my experience x264 hits the target bitrate within ~0.02%, which is fantastic. Sometimes it only hits the target bitrate within ~.20% which is still very good, but can be a little problematic when you're used to the typical .02% and are trying to use nearly every MB on a Blu-Ray. What factors affect this?
I imagine the complexity of the video source, the length, the quality and the amount of light vs dark scenes all play a role. I'm sure there are others as well. Considering it's VBR, it amazes me that it gets it as close a it does.Isn't that what the first pass is sorting out though? Where to allocate the bitrate on the 2nd pass to hit the desired target bitrate while maintaining a constant perceived image quality across the whole clip (within the max and minimum bitrates allowed)?
laserfan
30th April 2011, 20:14
Most of the time in my experience x264 hits the target bitrate within ~0.02%, which is fantastic.
Indeed. I have never (ever) seen it that close; maybe it has to do with your "veryslow" preset which I have only used once or twice.
In any case IMO even 0.2% will get lost in the muxing i.e. it seems audio type/bitrate and subs are what make it tricky to try to "fill a disc to the edge" and not x264.
EDIT: Ok I found an old encoding where I'd used "veryslow" and it was accurate to 0.036% so I'll assume your numbers are correct and are owed to your settings. I tend to use normal settings and get a (wonderful) "0.11-0.12% below" result most of the time. BTW I dunno what this has to do with the thread topic. :confused:
sneaker_ger
1st May 2011, 15:27
http://forum.doom9.org/showthread.php?p=1410022
Stereodude
1st May 2011, 19:49
http://forum.doom9.org/showthread.php?p=1410022Thanks for the link.
Sagittaire
2nd May 2011, 09:19
Why does x264 sometimes whiff the target bitrate on a 2pass encode so badly?
Most of the time I've found it gets within a few kbit/sec (usually on the low side) when I'm encoding at a target bitrate to fill a Blu-Ray disc. However, I've found that ocassionally x264 will miss the bitrate by a lot more, generally on the low side but not always.
Here's the command line I used:I asked for a bitrate of 19110kbit/sec and I got a file with a bitrate of 19067.15kbit/sec. :confused: It's not the end of the world, but I'm curious.
If you want best possible target (and constant quality), you must use the best possible accurate stat pass and for that only one solution: 3 pass encoding ...
Stereodude
2nd May 2011, 22:56
If you want best possible target (and constant quality), you must use the best possible accurate stat pass and for that only one solution: 3 pass encoding ...Wouldn't a --slow-firstpass do the same thing in 2 passes?
sneaker_ger
2nd May 2011, 23:18
The question is: is investing time in more than 1 or 2 passes a good idea?
Might be better to spend it on filtering or otherwise slower/better encoding settings.
And I'm not even sure whether a third pass results in increased accuracy - has anyone tested that?
Stereodude
3rd May 2011, 03:12
And I'm not even sure whether a third pass results in increased accuracy - has anyone tested that?FWIW on my single test, a --slow-firstpass actually resulted in an even lower bitrate. It yielded 19050kbit/sec. :scared:
I don't have any plan to try a 3 pass encode. The encodes are close enough to the target size to not spend 12-16 hours doing them again.
Audionut
3rd May 2011, 03:42
Why does x264 sometimes whiff the target bitrate on a 2pass encode so badly?
I don't have any plan to try a 3 pass encode. The encodes are close enough to the target size to not spend 12-16 hours doing them again.
:confused: Which one is it?
Stereodude
3rd May 2011, 03:57
:confused: Which one isit?It's whichever one you want it to be. :rolleyes:
I asked why x264 sometimes doesn't nail the bitrate. I never asked anyone to fix it claiming it was broken. I also never said I was re-encoding files because of the variance. Would I rather x264 nail the bitrate all the time? Sure. My statements are in no way contradictory. Why does everyone have to be so contentious on forums these days. :confused:
Audionut
3rd May 2011, 07:59
Why does everyone have to be so contentious on forums these days. :confused:
Try searching and not taking a thread off-topic next time.
iSeries
22nd May 2011, 18:41
Hi,
I have quite a few mkv's which I have ripped from my blu rays. I'm looking to re-encode to save space. Reading through this thread I have learned that the encoded stream needs to be muxed into a blu ray structure to retain compliance (and not to mkv). My question is can I encode a blu ray compliant stream from an mkv or do I have to re-rip? (I think I can, just need some reassurance!)
My question is can I encode a blu ray compliant stream from an mkv or do I have to re-rip? (I think I can, just need some reassurance!)
You can encode compliant streams from MKVs, just like from any other source.
Sharc
14th August 2011, 12:07
Does --sar 64:45 for 720x576 break blu-ray specs? Do I have to use --sar 16:11 always for blu-ray compliance?
I am asking because many 16:9 PAL DVDs come with a PAR of 64:45. I would prefer avoiding a slight resizing and keep the par as is (64:45 in this case) for my backups.
shon3i
14th August 2011, 16:03
Does --sar 64:45 for 720x576 break blu-ray specs? Do I have to use --sar 16:11 always for blu-ray compliance?Yes. Should not be a big difference to eye.
Sharc
14th August 2011, 16:47
ok, thanks.
My standalone player+TV will directly map it to 16:9 anyway for playback and not follow the --sar. Only the software player (MPC-HC) applies the --sar for playback, unless I force it to use 16:9.
newsky
28th September 2011, 16:26
I think that I'm doing wrong :(. Please confirm or disprove my doubts. Encoding the home video shot with Canon 5D Mark II (1920x1080, 29,97fps) in these settings Xvid4PSP x264:
--crf 18.0 --level 4.1 --tune film --bluray-compat --open-gop --bframes 3 --ref 4 --deblock -2:-1 --merange 26 --slices 4 --aud --nal-hrd vbr --b-pyramid strict --trellis 2 --no-fast-pskip --no-dct-decimate --keyint 30 --partitions all --subme 9 --me umh --vbv-bufsize 30000 --vbv-maxrate 40000 --weightp 1 --fake-interlaced --pic-struct --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1
1. Is it permissible to encode for Blu-ray in the mode of CRF, or only 2 pass?
2. Save the above settings in x264 MKV demux and then do a tsMuxer (that's probably completely wrong? And this video is not suitable for the Blu-ray? Although Adobe Encore CS5 makes Blu-ray with this file, and plays on the Dune HD Max.
That too much in my settings? What is missing? What are they wrong? That correct?
sneaker_ger
28th September 2011, 17:33
1. Is it permissible to encode for Blu-ray in the mode of CRF, or only 2 pass?
Both CRF and 2pass are allowed.
2. Save the above settings in x264 MKV demux and then do a tsMuxer (that's probably completely wrong? And this video is not suitable for the Blu-ray?
That is not allowed, encode directly to .h264 raw ES.
That too much in my settings?
A few settings are redundant/not needed (but don't hurt anyways):
--bframes 3 --aud --nal-hrd vbr --b-pyramid strict --weightp 1 --pic-struct
What is missing? What are they wrong? That correct?
They should be correct.
See following for good examples, in case you don't have already:
http://www.x264bluray.com
newsky
28th September 2011, 18:09
Thank you so much sneaker_ger!
--bframes 3 --aud --nal-hrd vbr --b-pyramid strict --weightp 1 --pic-struct = --bluray-compat Therefore, these values are unnecessary? yes? or not?
in the presence of --fake-interlaced and without--pic-struct Adobe Encore CS5 an error terminates Authoring
sneaker_ger
28th September 2011, 18:17
Not exactly (http://git.videolan.org/gitweb.cgi?p=x264.git;a=blobdiff;f=encoder/encoder.c;h=b0fc7b907ea55e93ab2903a06e48ba02d71db4bb;hp=fd2c877373a72497e7ee0fe1462b48f547cbbc18;hb=f9e7f531048df7219a44203031c8f79bae6170d0;hpb=f422ec93254ed3f9883acac0bb3f67e3b4ea960c), but yes, "--aud --nal-hrd vbr --b-pyramid strict --weightp 1" will in this case be used because of "--bluray-compat". "--bframes 3" is x264's standard setting and "--pic-struct" should be implied by "--fake-interlaced".
newsky
29th September 2011, 17:09
I heard that when encoding CRF, VBV may extend beyond the established value, and encoding Pass2 not, is it true? And are there any nuances in the use of CRF to Blu-ray?
sneaker_ger
29th September 2011, 17:18
I heard that when encoding CRF, VBV may extend beyond the established value, and encoding Pass2 not, is it true?
No. If VBV limit should get exceeded, x264 would display a warning, but this should very rarely - if ever - happen.
And are there any nuances in the use of CRF to Blu-ray?
You can use CRF for Blu-Ray, just as you can use 2pass. Nothing to look out for.
newsky
29th September 2011, 17:22
low bow to you for help, sneaker_ger!
newsky
4th October 2011, 19:47
Output file must be in raw 264 elementary stream (extension .264) otherwise settings will not applied correctly. DO NOT USE MKV OR MP4.
packed in a container m2ts unacceptable?
shon3i
4th October 2011, 21:39
This is for internal x264 output format, not outside x264.
newsky
11th October 2011, 04:25
Handle a BD player with value --partitions all?
I want to re-encode all my home videos, tell me everything is right and justified in my settings? source: 1920x1080p 29,97
--crf 18.0 --level 4.1 --bluray-compat --ref 4 --deblock -2:-1 --merange 26 --slices 4 --trellis 2 --no-fast-pskip --no-dct-decimate --keyint 30 --partitions all --subme 9 --me umh --vbv-bufsize 30000 --vbv-maxrate 40000 --fake-interlaced --pic-struct --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1
Maybe we should change something for better quality?
Stereodude
21st November 2011, 16:50
Is there any particular reason the suggested x264 command lines on http://www.x264bluray.com don't include --b-adapt 2 as part of the command line?
Kurtnoise
21st November 2011, 16:57
preset veryslow includes --b-adapt 2
Stereodude
21st November 2011, 18:06
preset veryslow includes --b-adapt 2Oh. Thanks. I guess that's what I get for relying on the documentation on http://mewiki.project357.com/wiki/X264_Settings which said the default was 1.
sneaker_ger
21st November 2011, 18:34
1 is the default, but preset veryslow is not, preset medium is.
Use --fullhelp for detailed preset view.
Stereodude
22nd November 2011, 01:20
1 is the default, but preset veryslow is not, preset medium is.Point taken, but IMHO the wiki should note that the --preset setting changes the setting. I'd edit the wiki myself, but it's locked.
Groucho2004
22nd November 2011, 02:34
IMHO the wiki should note that the --preset setting changes the setting
from the wiki (under presets):
For information on what options these settings toggle, check the output of x264.exe --fullhelp
djmasturbeat
10th January 2012, 09:17
images on first page are dead
can we get those rehosted please? =)
or am i just having some issue on my end?
jpsdr
10th January 2012, 09:29
No, no pictures for me also.
shon3i
11th January 2012, 12:12
Pictures work here..
QBhd
11th January 2012, 13:06
They were down here, but as stated above, are now back up...
QB
wiseant
17th January 2012, 02:55
Hi
I just did a transcode to x264 for Blu-ray compatibility on DVD - I am hoping that someone can confirm my encode settings
Here is my commandline:
x264.exe --fps 24000/1000 --force-cfr --level 4 --keyint 48 --crf 18 --vbv-maxrate 15000 --vbv-bufsize 15000 --bluray-compat --sar 1:1 --pic-struct --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" -o xxx.264 xxx.avs
and here is some media info:
Encoding settings: cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=1 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=48 / keyint_min=4 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=15000 / vbv_bufsize=15000 / crf_max=0.0 / nal_hrd=vbr / ip_ratio=1.40 / aq=1:1.00
Buffer size: 1875000
Since I did not use a preset, by default it uses the medium preset - will Blu-ray compatibility still apply if I use fast, faster, veryfast, superfast, or ultrafast?
I am also wondering since presets are "Overridden by user settings", if using any of these presets will cause conflicts/problems with compatibilty?
TIA
sneaker_ger
17th January 2012, 12:48
Do you want "--fps 24000/1001" (=23.976) or "--fps 24000/1000"="--fps 24" (=24.000)? Rest of the settings is fine.
It should still be compatible with the faster presets, though I'm not sure about ultrafast's "--no-cabac". But since CABAC is never mentioned as a requirement, that one is probably also OK.
wiseant
17th January 2012, 19:57
Thanks sneaker_ger
I wanted 24 fps - looks like I should have just used "--fps 24"
It does appear that blu-ray can use CABAC or CAVLC:
from: http://www.mainconcept.com/products/apps-plug-ins/transcoding/reference/blu-ray-codec-bundle.html
"MainConcept Reference Blu-ray Codec Bundle supports all standard and advanced features of the H.264 specifications including Baseline, Main and High Profiles as well as CABAC and CAVLC."
Stereodude
20th January 2012, 01:51
if you're transcoding a commercial Blu-Ray you should use 24000/1001 since that's what on the disc.
chompy
20th January 2012, 08:46
if you're transcoding a commercial Blu-Ray you should use 24000/1001 since that's what on the disc.
Not always, at least here in Europe we have quite blu-rays that are 24 fps.
djmasturbeat
28th January 2012, 00:51
i have seen the rare true 24 fps too
anyhow
thanks for this thread
i come here for reference all of the time
just want to make sure to thank you
sometime I think i might take all this info here and http://www.x264bluray.com/ and make a pdf if that is okay?
certainly would be easier for me.
DiKey
12th April 2012, 19:52
Please, help. I was read all, that I could, but my problem is still here.
I am encoding my video using x264. For example:
x264.exe --bitrate 22500 --tune film --pass 1 --preset slow --bluray-compat
--vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 25 --slices 4 --tff
--colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --ssim --sar 1:1 -
o filename.264 01.avs
x264.exe --bitrate 22500 --tune film --pass 2 --preset slow --bluray-compat
--vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 25 --slices 4 --tff
--colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --ssim --sar 1:1 -
o filename.264 01.avs
Here is no --open-gop because "http://www.x264bluray.com/issues-with-certain-players" says "Adobe Encode CS5 has poor performance when --open-gop is enabled"
But Encore CS5 still can not work with this file. It freezes, hangs and closes.
Of course, 24Gb is very big, but my system is not very old: Core i7-920, 24Gb Ram and so on...
But if I remux this .264 file using tsMuxer to .m2ts - everything is ok. Is it only method, or i can do something else?
Thank you.
P.S. Encore CS5 sometimes works perfectly with --open-gop, but I do not understand, "why", and "when" it happens.
P.P.S. Sorry for my English.
rallymax
12th April 2012, 19:58
CS5.5 fixed some bugs in the 264 decoder - so update to that.
I use the settings you are using and CS5.5 Encore is happy. I also have --open-gop turned on.
A work around would be to change to x264_L-SMASH and output to .m4v* instead of .264. That muxing might help.
* I don't recommend that because I think it might break the blu-ray compatibility. It'll work but it won't pass bluray conformance tests.
But as I said, I have no problem doing exactly what you're doing using CS5.5 Encore.
DiKey
12th April 2012, 20:06
Thank you.
My Encore is 5.1.0.342 it is "CS 5.5" as I see...
I did not understand: soon programmers will be add .m4v export support to x264? Sounds good!
Vurbal
4th September 2012, 20:08
I've looked both here and on the x264 Blu-ray page for a definitive answer to this but haven't come up with anything. If I've just missed it feel free to call me an idiot and point me to the relevant information. :stupid:
I'm encoding 480p24 (720x480 @ 23.976fps) widescreen video. Since this doesn't require a significant bitrate I figure there's no reason not to set vbv-buffer to 15000 so I can also use a 2 second GOP. What I'm not sure about is what (if anything) needs to be adjusted to account for the required pulldown. I see 3 possible answers to this, and perhaps it's something else I haven't considered.
1. I'm over thinking the whole thing. The VBV buffer setting should be 15000 (or anything lower) and the field duplication from pulldown doesn't matter.
2. I need to reduce the VBV buffer by whatever amount is dictated by the duplicate fields because the buffer model comes into play after that point in the decoding process.
3. I need to reduce the VBV buffer even though the duplicated fields don't really have a practical effect on playback because authoring software may still reject them since it can't tell the difference between real fields and fields created using pulldown.
My experience with DVD authoring suggests either #2 or #3 is probably correct so I'm currently assuming I need to lower the buffer. On the other hand if there's one thing I've learned about Blu-ray authoring it's that sometimes you need to forget what you know about DVD to make sense of it.
Theoretically it shouldn't really make any difference because the bitrate should never need to approach 15000kbps for decent quality SD video. I could probably use a buffer size of 8000 most of the time without any visible difference and then pulldown should never matter. However that's at odds with my general philosophy on encoding which is to set the fewest restrictions possible and give the encoder maximum latitude in making its own decisions. Any video encoder that doesn't make better decisions than I would probably isn't worth using. If my video includes an outlier case where x264 just needs to throw more bits at a scene I'd like to make sure it has as much freedom to do that as possible.
sneaker_ger
4th September 2012, 20:28
http://www.x264bluray.com/home/480p-ntsc (720x480 is 480p, 1280x720 is 720p)
Vurbal
4th September 2012, 22:27
http://www.x264bluray.com/home/480p-ntsc (720x480 is 480p, 1280x720 is 720p)
Sorry, that was a typo. I'm working with several files simultaneously and my brain slipped. So basically my question remains. It's a minor thing but it's bugging me.
sneaker_ger
4th September 2012, 22:35
That link was supposed to be the answer: #1
shon3i
5th September 2012, 22:38
And, general rule is that never use maxed out settings, always leave room for some errors. So 15000 is kind max (and prefered in your case), but really if bitrate is not near that value there is no reason to use it, you can use something lower, for example 30-40% higher than target bitrate, is good enough.
And answer is #1, like sneaker_ger suggest
dvdboy
2nd December 2012, 13:57
I was wondering if someone could help me write the required command string to encode 1080p24 content for multi-angle. From what I can tell, I would need to drop open-gop, and also add no-scenecut - are there any other switches I would need to ensure the GOP structures match across both files? I also cannot seem to find any documentation regarding what the max bitrate would be for each angle.
Many Thanks
mp3dom
2nd December 2012, 14:54
The suggested settings for multi-angle are:
- No scene change detection
- Closed GOPs
- Smaller GOPs length
- Strict CBR (meaning that it is preferred that every GOP has the same constant bitrate)
In multi-angle, all the angles should have the GOP headers aligned, so they need to be encoded in the same way. A CBR stream increase the likelihood to have a seamless angle-change. Also, a small GOP (15-18 frames, rather than 24) ensure that the angle streams are aligned properly. There's no more limit on the bitrate like it was for dvd. You can go up to 40 Mbps for each angle.
dvdboy
2nd December 2012, 17:28
Thanks MP3Dom.
How do I set a strict CBR with x264? Is it just a case of setting the bitrate to the same as the max bitrate, so my commandline would be something like:
x264 --bitrate 30000 --preset veryslow --tune film --bluray-compat --vbv-maxrate 30000 --vbv-bufsize 30000 --level 4.1 --keyint 18 --no-scenecut --slices 4
--colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o out.264 input.file
Many Thanks
--EDIT--
Nevermind, that seems to have worked - plays back in WinDVD ok. Many Thanks.
Nico8583
2nd February 2013, 11:01
Hi,
I would like to encode AVC/MVC but I don't know what settings to use for B-Frames (2 or 3 ?) and Reference Frames (3 or 4) ?
Is there a relation between bitrate and B-Frames/Ref Frames ?
Thanks !
sneaker_ger
2nd February 2013, 11:05
Higher limits for B-Frames and Reference Frames result in higher compression. (Better quality at the same bitrate/lower bitrate at same quality)
Stick to the presets and Blu-Ray examples (if you actually want to encode a Blu-Ray structure - not if just your source is a Blu-Ray) if you don't know your way around x264.
Nico8583
2nd February 2013, 11:27
Thanks for your response.
Yes I want to encode a Blu ray structure, so B-Frames = 3 and Ref Frames = 4 will be better than 2 and 3. No problem with this settings to play in a Blu ray player ?
What are impacts on encoding and decoding ?
sneaker_ger
2nd February 2013, 11:57
Yes I want to encode a Blu ray structure, so B-Frames = 3 and Ref Frames = 4 will be better than 2 and 3. No problem with this settings to play in a Blu ray player ?
Yes and yes.
What are impacts on encoding and decoding ?
Raising B-Frames from 2 to 3 has basically no impact on decoding (more than 3 is not Blu-Ray compatible anymore, though), more ref frames can result in incompatibility with many players if you go too high, but 4 is always ok for Blu-Ray.
Since you had to ask about these I highly recommend that you do not set them yourself!
Go here (http://www.x264bluray.com) and just copy the appropriate examples you find on the left side. Only change "--preset veryslow" to a preset of your choice (unless you are fine with the slowness of preset veryslow, of course.) These presets in combination with the rest of the example commands will automatically choose the optimal values for B-frames and ref frames.
Nico8583
2nd February 2013, 15:40
Thanks but I don't use x264, I use Rovi MVC Encoder to encode AVC/MVC :)
You can find my post here about MVC : http://forum.doom9.org/showthread.php?t=166981 (if you have suggestions I'm interested :D)
TheProfosist
25th March 2013, 11:48
there is max bitrate and info for DVDs but what if I wanted to put short specials or clips on a CD? Is this even possible if so what would the VBV settings be?
laserfan
25th March 2013, 12:59
there is max bitrate and info for DVDs but what if I wanted to put short specials or clips on a CD? Is this even possible...
Although I can't seem to find any posts here about it, I do remember making a CD with a BD structure on it and it did work. It was so long ago I can't remember exact settings, but I most probably just used the DVD params to make it.
But then I couldn't rationalize use of CDs given how cheap DVD-Rs had become so it became just a fun exercise.
I should add that it's possible-if-not-likely that certain (many?) standalone players won't like it--mine are are all Sonys.
TheProfosist
25th March 2013, 13:10
Although I can't seem to find any posts here about it, I do remember making a CD with a BD structure on it and it did work. It was so long ago I can't remember exact settings, but I most probably just used the DVD params to make it.
But then I couldn't rationalize use of CDs given how cheap DVD-Rs had become so it became just a fun exercise.
I should add that it's possible-if-not-likely that certain (many?) standalone players won't like it--mine are are all Sonys.
I assumed that the DVD settings would work as well since i would only be doing 480p but wouldnt the VBV buffer and max rate need to be lowered since the read speed of a CD is much lower than even a DVD
Edit: I also was wondering why --pulldown double is recommended for 720p (http://goo.gl/tImdN) instead of --fake-interlaced which is what i know works with 1080p (http://goo.gl/cMihP)
rallymax
25th March 2013, 16:43
720p is 50 and 60 frames per second thus why you double up 25 or 30fps source.
1080 is interlace only thus why you want to encode progressive but set in the parameters that it is interlaced - thus "fake interlaced".
TheProfosist
25th March 2013, 16:48
I assumed that the DVD settings would work as well since i would only be doing 480p but wouldnt the VBV buffer and max rate need to be lowered since the read speed of a CD is much lower than even a DVD
Edit: I also was wondering why --pulldown double is recommended for 720p (http://goo.gl/tImdN) instead of --fake-interlaced which is what i know works with 1080p (http://goo.gl/cMihP)
just realized that the BD spec has no interlaced specification for 1280x720 interlace thats why that needs to be done
anyone have any idea on the VBV if I wanted to make a BD spec CD?
rallymax
25th March 2013, 19:18
I'd take the read speed of the cd and halve it.
eg "x32" read, I'd take as x16.
so...
44100 * 2 * 16 = 1411200 bits/second
(that "x16" number is times the normal read speed of audio off of an audio formatted cd. the audio sample rate of a CD is 44.1khz and is stereo. thus the 44.1k * 2 * read multiplier.
SeeMoreDigital
25th March 2013, 22:02
just realized that the BD spec has no interlaced specification for 1280x720 interlace thats why that needs to be done
Indeed, all you have to do is re-encode each interlaced 'field' into a progressive 'frame'... Job done!
sneaker_ger
29th March 2013, 15:31
Also, is it guaranteed that --vbv-bufsize 30001 --vbv-maxrate 40001 for example would already not be spec compliant any longer?
Well, since those are maximum values it is not guaranteed they'd actually be fully used, I guess.
Ao, if Blu-ray Disc specification can handle --vbv-bufsize 30000 --vbv-maxrate 40000 for Level 4.1, then why is Level 4.0 suddenly restricted to --vbv-bufsize 24000 --vbv-maxrate 24000? I mean, ultimately it's the same hardware.
So, for Level 4.0, shouldn't it rather be --vbv-bufsize 25000 --vbv-maxrate 25000 instead of 24000 (Bufsize not 30000 or 31250 because post #1 says Bufsize greater than Maxrate is not allowed in Blu-ray Disc specification)?
Level 4.1 requires 4 slices for better multi-threading while level 4.0 does not, so the hardware demands can be different.
rallymax
29th March 2013, 16:15
So, if Blu-ray Disc specification can handle --vbv-bufsize 30000 --vbv-maxrate 40000 for Level 4.1, then why is Level 4.0 suddenly restricted to --vbv-bufsize 24000 --vbv-maxrate 24000? I mean, ultimately it's the same hardware.
4.1 you must have slice support (ie you have 4 decoders in the silicon to do each 1/4 of the frame) so I could understand why 4.0, which doesn't have slice as a requirement, would choke above 24Mbps.
Are you just asking out of curiosity or is there some reason you're challenging the br spec - which exists to guarantee any spec compliant decoder will work with your spec compliant encode?
rallymax
29th March 2013, 16:17
Well, since those are maximum values it is not guaranteed they'd actually be fully used, I guess.
That value it put into the header information so any BR verifier worth it's salt would fail it since it's greater than the standard's permissible maximum.
Guest
29th March 2013, 20:51
The spec is publicly available for those with the means to pay for it. I have it through my company, for example.
kieranrk
31st March 2013, 18:13
So how would you (or shon3i) know?
Just wondering ;).
Having worked on this with shon3i in the past, he has the spec for his employment.
kolak
20th June 2013, 22:21
I almost sure that for 2D they are the same.
Fro 3D: L+R max is 60Mbit, buffer don't remember. There were some problems with 1st gen players with B frames (CABAC also) and also older PS3 has problems with peaks at 60Mbit- many studios use way less.
mp3dom
21st June 2013, 08:08
It should be 40Mbps max for the main view and 20Mbps max for dependant.
kolak
22nd June 2013, 14:50
Is it? Not sure if there is such a restriction (thought it does make sense).
paradoxical
25th June 2013, 22:42
Just wondering:
Does anyone here know if the official Blu-ray Disc specifications allow for xvYCC H.264 encoding?
Probably not. Hence why to get the expanded colors of Sony's "Mastered in 4K" discs require playing on their own Bluray players, such as a PS3, and need a Sony TV to support the new color space. HDMI 1.3 added xvYCC support and the PS3 has supported it for quite some time.
kabelbrand
26th June 2013, 10:25
The Blu-ray Spec demands transfer_characteristics to be set to 1 (ITU-R BT.709) for HD video. So setting it to 11 for IEC 61966-2-4/xvYCC wouldn't be compliant.
So Sony might use custom programming/parameters to signal xvYCC support in their "Mastered in 4k" Blu-ray Discs or through this user data SEI:
0x000000E5 H264 SEI {User data unregistered}
User data unregistered()
uuid_iso_iec_11578 = {bb0246a7-a1f8-c04c-a936-48e391dce761}
paradoxical
26th June 2013, 15:04
The Blu-ray Spec demands transfer_characteristics to be set to 1 (ITU-R BT.709) for HD video. So setting it to 11 for IEC 61966-2-4/xvYCC wouldn't be compliant.
And clearly they aren't setting the transfer_characteristics to something else which isn't what I was saying they did. Obviously that would be disallowed. But adding some sort of extension to allow expanding the gamut to xvYCC that would get ignored by any other player is probably not disallowed and that was my point. It really is no different than all the extra copy protections added to DVDs that are not part of the spec but they are still considered valid DVDs and carry the DVD logo.
So Sony might use custom programming/parameters to signal xvYCC support in their "Mastered in 4k" Blu-ray Discs or through this user data SEI:
0x000000E5 H264 SEI {User data unregistered}
User data unregistered()
uuid_iso_iec_11578 = {bb0246a7-a1f8-c04c-a936-48e391dce761}
It's definitely using some sort of custom fields or signalling that only their players read and is ignored by others such that it causes no incompatibility. Their Mastered in 4K discs will play in any Blu-Ray player you just won't get the expanded gamut unless it's a Sony player. Someone would have to analyze a stream from one of the discs to nail down for certain.
rallymax
26th June 2013, 17:25
And clearly they aren't setting the transfer_characteristics to something else which isn't what I was saying they did. Obviously that would be disallowed. But adding some sort of extension to allow expanding the gamut to xvYCC that would get ignored by any other player is probably not disallowed and that was my point. It really is no different than all the extra copy protections added to DVDs that are not part of the spec but they are still considered valid DVDs and carry the DVD logo.
It's definitely using some sort of custom fields or signalling that only their players read and is ignored by others such that it causes no incompatibility. Their Mastered in 4K discs will play in any Blu-Ray player you just won't get the expanded gamut unless it's a Sony player. Someone would have to analyze a stream from one of the discs to nail down for certain.
Is there somewhere that you can download a MTS file that has been authored this way? I'll put it through my h.264 analyzer to find out what they did.
paradoxical
26th June 2013, 17:29
Is there somewhere that you can download a MTS file that has been authored this way? I'll put it through my h.264 analyzer to find out what they did.
Not anything legitimate that I know of. You'd have to buy a disc or go an illegitimate route.
Edited to add:
Obviously I don't support going an illegitimate route.
dvdboy
29th June 2013, 23:18
I asked a while back about encoding multi-angle video, and I was wondering if anyone can answer a related point while I'm waiting for my video to encode.
Do the two angles have to be the same bitrate? I'm not sure how the files are interleaved on the disc, but if they were both CBR, both with the same IDR, no scene detection etc, would it matter if one video was a higher bitrate than another?
dvdboy
1st July 2013, 22:39
Do the two angles have to be the same bitrate?
Yes DVD-BOY, they do:
Error : Seamless_angle_change is invalid, because Video Bit_rate differs between Main Angle and Angle. [PlayItemID:131]
Error : [MUX] Can not write MUX file(s) : Could not create MUX XML File(Invalid [Clip/Stream Data][Scenario Title])
shon3i
15th July 2013, 20:42
@jq963152 false positive (http://www.x264bluray.com/issues-with-certain-analyzers)
detmek
27th July 2013, 11:17
AFAIK, settings are applied correctly but some SEI messages and/or header are lost and muxing software refuses to mux h.264 stream.
Lyris
28th July 2013, 14:21
Forgive me for missing the point, but for what purpose would you ever want to output MKV or MP4 for going into a BD authoring application? You'd have to demux the stream to get it in anyway?
shon3i
28th July 2013, 17:14
Megui is just another GUI for x264 is not official application or even specialized for Blu-Ray encoding. It's very useful but you need know what you are doing if you want 100% compatible BD stream.
detmek
28th July 2013, 19:39
Besides, its "Target playback device", not "Target authoring format". It just limits VBV and DPB because Blu-Ray players are hardware limited.
neil wilkes
29th August 2013, 09:47
You could modify x264 to write frame_mbs_only flag as zero. You'd have to write pic_struct too but the spec isn't clear whether it wants you to signal the frame as two fields or as one frame.
From my limited experience with x264 (a superb encoder, BTW) when I made the mistake of encoding a 25fps piece as PS, as soon as it got multiplexed into DoStudio, the audio played out correctly but the video played out at 2x speed - it took each frame as an interlaced one not a progressive one as at 1920x1080 you cannot, repeat cannot use PS.
Whether or not flagging a PS encode as interlaced will work is - I suspect - dependent on the multiplexing engine used. The Corel one certainly treats even 25p as interlaced when compiling.
The best workaround, if you want to use Progressive scan footage is to shoot at 24. There is no valid reason whatsoever to shoot at 25fps.
jpsdr
31st August 2013, 08:13
I've personnaly used x264 to encode 25fps 576p video using "--fake-interlaced" and "--pic-struct", and mux with scenarist, result was perfectly fine. Never tried other frame size for now.
SeeMoreDigital
12th November 2013, 15:28
Hi Neil,
I've just discovered some of your work on my 'Yes - Close to the Edge' Blu-ray disc, that arrived this morning... There you were in the sleeve notes.
Nice one ;)
Shevach
3rd February 2014, 11:58
Dear experts
According to Blu-Ray spec. (9.5.1.5) buffering period and picture_timing SEI are not mandatory.
If a stream does not contain these SEI messages how a decoder should choose initial_cpb_removal_delay (which is sgnaled in the buffering_period)?
kieranrk
9th February 2014, 21:40
Dear experts
According to Blu-Ray spec. (9.5.1.5) buffering period and picture_timing SEI are not mandatory.
If a stream does not contain these SEI messages how a decoder should choose initial_cpb_removal_delay (which is sgnaled in the buffering_period)?
By using the DTS and PTS along with the PCR which the TS spec defines as being equivalent to the calculations from initial cpb removal delay and friends.
Shevach
14th February 2014, 17:46
So, the first DTS corresponds to the initial_delay_offset counted from the first PCR.
kieranrk
15th February 2014, 02:38
So, the first DTS corresponds to the initial_delay_offset counted from the first PCR.
Not the first PCR but the PCR that's associated with the packet containing the beginning of the first frame. The PCR can pretty much be construed as the arrival time of the data into the buffer. This is explained in more detail in the T-STD part of the MPEG-TS specification.
Shevach
21st February 2014, 16:15
Thanks for your detailed reply.
By the way, is there any Blu-Ray stream analyzer?
kieranrk
23rd February 2014, 16:10
There are a few I believe such as:
http://www.dvdverification.com/public/101.cfm
However, I don't know how low-level they are. I think there is now parity between the BDAV-STD model and the MPEG-TS T-STD model but you'd have to check the related documents. However, most MPEG-TS analysers are designed for CBR whereas Blu-Ray is VBR with a PCR attached to every TS Packet.
Shevach
10th March 2014, 10:28
Dear BluRay practitioners
i have several questions on BDAV-STD.
1)
What the error MUX_SN_E_TS_UNDERFLOW_ERR means?
ERROR: TSWrapper.dll::CTSWrapper::ProcThreadMain::Video buffer underflows. - @8 seconds ::
[MUX_SN_E_TS_UNDERFLOW_ERR]
My conjecture is underflow of MB1 buffer. Am i right?
2) How data enters to MB1 buffer? In T-STD model the data enters to multiplexor buffer according to transport_rate which is derived from successive PCRs. In BDAV-STD each TS packet is extended by the time-stamp. i conjecture that the TS packet in BDAV-STD enters to TB1 according to these timestamps.
Lyris
10th March 2014, 22:56
Sounds like you're using either Scenarist or DVD Architect? Which software are you authoring with?
1: do you have a lot of audio tracks? I'll get this error usually when having a large DTS-HD Master Audio track. The solution is to limit the maxrate from 40000 down to something like 38000 which is usually enough.
2: I'll let someone else answer that.
kieranrk
11th March 2014, 01:29
2) How data enters to MB1 buffer? In T-STD model the data enters to multiplexor buffer according to transport_rate which is derived from successive PCRs. In BDAV-STD each TS packet is extended by the time-stamp. i conjecture that the TS packet in BDAV-STD enters to TB1 according to these timestamps.
No, in T-STD and data enters TB1 at the transport rate - I don't have the spec on me but I would guess the BDAV-STD defines the timestamp to be the entry time into TB1. It then leaves TB1 into MB1 at a rate defined in the spec. For Video this is usually a little higher than the max bitrate to account for PES overhead; audio is hardcoded in the specs.
Alex-Kid
11th March 2015, 15:00
I want to encode my 1080p60 footage that is going to be authored to a AVCHD 2.0 blu-ray disc, as is the only standard that supports this resolution and frame rate. Given that purpose, I did some search and came with these x264 settings:
x264 --bitrate XXXXX --preset veryslow --tune film --bluray-compat --vbv-maxrate 25000 --vbv-bufsize 25000 --level 4.2 --keyint 120 --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 25000 --vbv-bufsize 25000 --level 4.2 --keyint 120 --open-gop --slices 4 --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 -o out.264 input.file
Does these x264 settings conform with AVCHD 2.0 standard on blu-ray media?
A.Fenderson
11th March 2015, 16:46
I'm not sure all the parameters and constraints on AVCHD Progressive/2.0 are well-known, since it's not intended as a distribution format and more intended for use in camcorders, so keep that in mind. Hopefully someone who has tried this before can share their results.
You need to constrain bitrate to under 28000.
If AVCHD 2.0 closely follows Blu-ray constraints, you will need to reduce keyint to 60 (1 second GOP), but this is a guess.
Also, AVCHD format is intended for SD cards and DVD discs, and as seemingly trivial as it would be to support it on Blu-ray discs, not all players seem to do so; maybe try burning to BD-RE first and see if that will play back in the target device. If you want to target all Blu-ray players, consider converting to 1080i, as you'll retain the high-motion aspect (60 Hz) if properly done, and only lose some (maybe acceptably-small) visual fidelity from the interlacing/deinterlacing.
Alex-Kid
12th March 2015, 07:19
I've been doing some more searching and I came up with this (from http://www.sony-asia.com/microsite/cybershot_userguides/DSC-HX200V/eng/contents/08/04/01/01.html):
To create a Blu-ray disc from movies recorded in [AVC HD 28M (PS)], you need to use device that is compliant with an AVCHD format Ver. 2.0. The created Blu-ray disc can be played back only on the device that is compliant with the AVCHD format Ver. 2.0.
My Samsung BD-H6500 user manual says that "the product won't play any content burnt on DVD-R media with any bitrate higher than 10 Mbps" and "the product won't play any content burnt on BD-R media or USB device with a bitrate higher than 25 Mbps". There's no information about AVCHD 2.0 but I already burnt a DVD-R which content was flawlessly played by this player. Software updates maybe?
jpsdr
12th March 2015, 09:35
DVD-R can be understundable because of physical drive limitation (and maybe DVD spec), but BD-R... It's strange... It seems more like a restriction to not allowing to play too much good quality BD-R (preventing for exemple playing even legal copy) than a real physical limit.
Precomposed
13th June 2015, 02:41
I'm about to setup an x264 encode for a still image menu background on a Blu-ray disc.
What parameters would be used to create a single frame Blu-ray compliant .264 file? Input would be 1920x1080 jpeg or png. I was not able to find information on this in any of the guides.
2themax
13th June 2015, 03:54
I've done this once before using avisynth as a source.
ImageSource("%d.png", 0, 0, 24)
You're still would be named 0.png and the script is just saying to read from frame 0 to frame 0 giving one frame. The 24 is the fps.
neil wilkes
15th June 2015, 08:20
I'm about to setup an x264 encode for a still image menu background on a Blu-ray disc.
What parameters would be used to create a single frame Blu-ray compliant .264 file? Input would be 1920x1080 jpeg or png. I was not able to find information on this in any of the guides.
I'm not sure how much help this will be as I use the x264Pro plugin variant of this excellent encoder in Premiere Pro CS2014 and it gets outstanding results.
An important thing to consider with Blu-ray is that even for menus, they are nothing like how we understand them from DVD as in BD everything is a movie, even menus.
How we attack this is to set up a 30 second "film" with the still (please do not use JPEG - use either TIF or BMP and keep those graphics lossless - avoid data reducing forms like JPEG) with your source at 23.976fps at 72DPI if using 10920x1080.
Encode as a regular movie at around 5Mbps CBR using highest quality options, although if you do want to use slideshow tuning this will not hurt but in all honesty I do not think it makes much difference - treat as a movie.
foxyshadis
15th June 2015, 18:41
I'm not sure how much help this will be as I use the x264Pro plugin variant of this excellent encoder in Premiere Pro CS2014 and it gets outstanding results.
An important thing to consider with Blu-ray is that even for menus, they are nothing like how we understand them from DVD as in BD everything is a movie, even menus.
How we attack this is to set up a 30 second "film" with the still (please do not use JPEG - use either TIF or BMP and keep those graphics lossless - avoid data reducing forms like JPEG) with your source at 23.976fps at 72DPI if using 10920x1080.
Encode as a regular movie at around 5Mbps CBR using highest quality options, although if you do want to use slideshow tuning this will not hurt but in all honesty I do not think it makes much difference - treat as a movie.
That's exactly how menus work in DVD, they're all MPEG2. You can use a one-frame still just as easily in BD (set the frame duration appropriately), and you can use the 30-second trick in DVD as well. CBR is just a waste of bits.
Precomposed
15th June 2015, 20:15
I analyzed the m2ts that Adobe Encore creates for a Blu-ray still image background and it is only 1 frame in duration, not 30 seconds. I completely understand that Blu-ray backgrounds need to be videos per the Blu-ray spec, even when they are just still images. This is why I wish to convert my still image (png) background to a single frame video (.264) using x264 or ffmpeg + libx264. I was wondering if there are any special settings I should be using to create a 1 frame .264 file that is Blu-ray compliant or will the normal settings of x264 be compliant for a single frame?
2themax
17th June 2015, 04:20
I analyzed the m2ts that Adobe Encore creates for a Blu-ray still image background and it is only 1 frame in duration, not 30 seconds. I completely understand that Blu-ray backgrounds need to be videos per the Blu-ray spec, even when they are just still images. This is why I wish to convert my still image (png) background to a single frame video (.264) using x264 or ffmpeg + libx264. I was wondering if there are any special settings I should be using to create a 1 frame .264 file that is Blu-ray compliant or will the normal settings of x264 be compliant for a single frame?
I answered that exact question 3 posts above. Use avisynth to feed x264 1 PNG.
kit90
24th January 2016, 08:47
In addition to movie applications (for which the x264 settings given in the first post are valid), Blu-ray also provides timebased and browsable slideshow applications, as given in the white papers (http://www.blu-raydisc.com/assets/Downloadablefile/BD-ROM-AV-WhitePaper_110712.pdf and http://www.blu-raydisc.com/assets/Downloadablefile/BD-ROM_Part3_V3.0_WhitePaper_150724.pdf). An example browsable slideshow is http://www.dvd-logic.com/downloads/examples/DVDLOGICBS.ZIP. The Mediainfo report on BrowsableSlideshow.avc shows Format settings, GOP:N=1. Does anyone know the settings to create timebased and browsable slideshows with x264?
PS: In the first post, the maximum reference frames for 1080 is given as 4. However, this is valid only if b-pyramid is disabled. In the default case in MeGUI (b-pyramid=strict), it is 3.
sneaker_ger
24th January 2016, 09:12
PS: In the first post, the maximum reference frames for 1080 is given as 4. However, this is valid only if b-pyramid is disabled. In the default case in MeGUI (b-pyramid=strict), it is 3.
Using --ref 4 in x264 is totally fine for 1080p BluRay, even with b-pyramid. Note that MediaInfo's "ReFrames" is actually DPB size.
kit90
24th January 2016, 11:01
Using --ref 4 in x264 is totally fine for 1080p BluRay, even with b-pyramid. Note that MediaInfo's "ReFrames" is actually DPB size.
1) Thanks. So if I specify these settings
--level 4.1 --bluray-compat --tune film --pass 2 --bitrate 20000 --stats ".stats" --keyint 24 --open-gop --ref 4 --slices 4 --vbv-bufsize 30000 --vbv-maxrate 40000 --colorprim bt709 --transfer bt709 --colormatrix bt709 --sar 1:1
in x264 (which defaults to b-pyramid=strict), the actual number of reference frames is 4, even though MediaInfo reports
Format settings, ReFrames: 3 Frames
Is it correct?
2) Also, how can we enforce
Format settings, GOP: N=1
to create timebased and browsable slideshows in x264? This is the setting given in the MediaInfo report of the browsable slideshow AVC file in my previous post.
jpsdr
26th January 2016, 09:34
For the Ref frames, it's correct.
For the second part, personnaly, i don't know.
Precomposed
25th February 2016, 23:33
Having an issue with PS4 playback only. Video appears choppy (like every other frame is being displayed) and the image quality is not as good as it should be.
Here are the settings from x264:
x264 --input-res 1920x1080 --fps 24000/1001 --crf 15 --preset slow --tune film --bluray-compat --vbv-maxrate 20000 --vbv-bufsize 20000 --level 4.1 --keyint 24 --open-gop --b-pyramid strict --slices 4 --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1
Muxing is performed with latest version of BD Author (DVDLogic) which muxes to spec.
Muxed video stream passes Sony BD verifier with flying colors, and the disc works fine on every other player, including PS3. Does anyone know if PS4 has problems with b-pyramids? Or is there something else going on here?
poisondeathray
26th February 2016, 01:18
Having an issue with PS4 playback only. Video appears choppy (like every other frame is being displayed) and the image quality is not as good as it should be.
Here are the settings from x264:
x264 --input-res 1920x1080 --fps 24000/1001 --crf 15 --preset slow --tune film --bluray-compat --vbv-maxrate 20000 --vbv-bufsize 20000 --level 4.1 --keyint 24 --open-gop --b-pyramid strict --slices 4 --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1
Muxing is performed with latest version of BD Author (DVDLogic) which muxes to spec.
Muxed video stream passes Sony BD verifier with flying colors, and the disc works fine on every other player, including PS3. Does anyone know if PS4 has problems with b-pyramids? Or is there something else going on here?
DVDLogic muxer had known issue in the past with b-pyramid. I don't know if they ever fixed it.
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.
Precomposed
26th February 2016, 01:28
DVDLogic muxer had known issue in the past with b-pyramid. I don't know if they ever fixed it.
DVDLogic did fix the muxer issue with b-pyramids. I've been working closely with them. It now muxes b-pyramids to spec and passes Sony BD verifier.
Before the muxing issue was fixed with their software, this choppy issue was happening on PS3 as well and the stream was not passing verification. Now it is passing verification, and working great on PS3 and other players. This leads me to believe there is an issue with PS4 not supporting b-pyramids, though I find it hard to believe no other commercial releases use b-pyramids. I do not see an issue with any other movies on PS4. The only difference I can see is that my videos are playing from a BD-R, and commercial releases are from a pressed disc.
benwaggoner
26th February 2016, 19:01
DVDLogic did fix the muxer issue with b-pyramids. I've been working closely with them. It now muxes b-pyramids to spec and passes Sony BD verifier.
Before the muxing issue was fixed with their software, this choppy issue was happening on PS3 as well and the stream was not passing verification. Now it is passing verification, and working great on PS3 and other players. This leads me to believe there is an issue with PS4 not supporting b-pyramids, though I find it hard to believe no other commercial releases use b-pyramids. I do not see an issue with any other movies on PS4. The only difference I can see is that my videos are playing from a BD-R, and commercial releases are from a pressed disc.
B-pyramids may require a longer lookahead read, so if you have dodgy BD-R media, some read errors might cause a problem there.
But the fact that a muxing fix fixed things suggests that commercial discs were created using a different muxer. I certainly have always used B-pyramid strict with any BD encodes I've done. Note the BD spec requires that Strictly Hierarchical Pyramids be used.
Precomposed
26th February 2016, 19:09
B-pyramids may require a longer lookahead read, so if you have dodgy BD-R media, some read errors might cause a problem there.
But the fact that a muxing fix fixed things suggests that commercial discs were created using a different muxer. I certainly have always used B-pyramid strict with any BD encodes I've done. Note the BD spec requires that Strictly Hierarchical Pyramids be used.
What about the vbv buffer? It is my understanding it should never exceed the max rate. Do you think a vbv-bufsize and vbv-maxrate both set at 20000 impact the PS4's ability to load the frames properly?
benwaggoner
26th February 2016, 19:20
What about the vbv buffer? It is my understanding it should never exceed the max rate. Do you think a vbv-bufsize and vbv-maxrate both set at 20000 impact the PS4's ability to load the frames properly?
Those are within spec. But certainly in the DVD-R era we found older players needed peak bitrates significantly below spec when using writable media.
I'm a fan of the Level 4.0 single-slice 2-sec GOP --vbv-maxrate 15000 --vbv-bitrate <=15000 mode encoding for your case. With x265, most content will look good at that bitrate, and being able to use a 2-sec GOP helps quality/efficiency significantly. The specifics should be upthread in various places.
I've been able to get a 2-hour move onto DVD-9 media this way, as an experiment, back when BD-R was expensive and the per-title encryption for replicated BD discs was way high for short-run titles. You could stamp a DVD-9 with a BD payload without needing encryption, and at a much lower price.
sneaker_ger
3rd June 2017, 21:20
I just realized the images are stored externally. Better have backup:
FranceBB
6th June 2017, 01:20
Thank you for this guide.
I gotta make a Bluray out of a PAL XDCAM MXF file and I'm gonna use Avisynth and x264 this time (not to bother AVID).
I need the maximum compatibility and I think these settings should be fine:
avs4x264mod.exe "AVS Script.avs" --x264-binary "x264.exe" --bitrate 25000 --preset medium --ref 4 --level 4.1 --profile High --vbv-bufsize 25000 --vbv-maxrate 25000 --overscan show --keyint 25 --slices 4 --sar 1:1 --videoformat PAL --tff --nal-hrd vbr --bluray-compat --colormatrix bt709 --transfer bt709 --colorprim bt709 --range tv --log-level info --thread-input --opencl --output raw_video.h264
Can you confirm they are fine? Any suggestions?
Sharc
6th June 2017, 08:18
Thank you for this guide.
I gotta make a Bluray out of a PAL XDCAM MXF file and I'm gonna use Avisynth and x264 this time (not to bother AVID).
I need the maximum compatibility and I think these settings should be fine:
avs4x264mod.exe "AVS Script.avs" --x264-binary "x264.exe" --bitrate 25000 --preset medium --ref 4 --level 4.1 --profile High --vbv-bufsize 25000 --vbv-maxrate 25000 --overscan show --keyint 25 --slices 4 --sar 1:1 --videoformat PAL --tff --nal-hrd vbr --bluray-compat --colormatrix bt709 --transfer bt709 --colorprim bt709 --range tv --log-level info --thread-input --opencl --output raw_video.h264
Can you confirm they are fine? Any suggestions?
What is your script?
For blu-ray compliant x264 settings you find references here:
http://forum.doom9.org/showpost.php?p=1399419&postcount=1
https://sites.google.com/site/x264bluray/
jpsdr
6th June 2017, 09:06
You miss the following to be sure :
--b-pyramid strict --min-keyint 1 --mvrange 511 --bframe 3 --aud
I'm not sure if --b-pyramid strict is included with the --bluray-compat, so, it will not hurt to add it.
As you're using --tff it means that your video is not progressive, in that case, you also need :
--pic-struct
You don't need this last one for progressive video.
If you want optimal result, you can add :
--open-gop
And, you can also go up to these values if you want :
--vbv-maxrate 40000 --vbv-bufsize 30000
sneaker_ger
6th June 2017, 10:56
I'm not sure if --b-pyramid strict is included with the --bluray-compat
It is, as are --min-keyint 1, --bframes 3 and --aud. (pyramid and bframes as min(x,y)). Special --mvrange isn't necessary either.
As you're using --tff it means that your video is not progressive, in that case, you also need
--pic-struct is implied by --tff/--bff/--fake-interlaced.
/edit: Oh, he does want to make a Blu-ray out of XDCAM MXF. I didn't read correctly. Personally, I'd just use the examples linked by Sharc. Maybe even use a good deinterlacer like QTGMC to go 720p50.
--sar 1:1 and bt709 are not allowed for PAL. See start post.
benwaggoner
6th June 2017, 18:16
It is, as are --min-keyint 1
Is my dim recollection of --min-keyint 2 being requires/preferable incorrect?
Also, since he's only using 25 Mbps vbv-bufsize/maxrate, he might as well use Level 4.0 and eliminate --slices 4.
Slices are only required with Level 4.1.
sneaker_ger
6th June 2017, 18:23
Is my dim recollection of --min-keyint 2 being requires/preferable incorrect?
It would have always been required by the specs but the x264 developers only noticed it in 2012.
http://git.videolan.org/?p=x264/x264-sandbox.git;a=commit;h=9fb055856a617f5ddca15a0c5745ff1c1486ad9a
jpsdr
6th June 2017, 19:34
--sar 1:1 and bt709 are not allowed for PAL. See start post.
I thought the video was 1080p.
If video is indeed 576i, that's a total another story.
A lot of optimization can be done indeed.
Reduce the level to 4.0 to avoid slices, and reduce buffer/bitrate max to 15000 to have 2s GOP length.
Buffer and bitrate max at 15000 is very largely enough to properly encode a 576i video. This will allow a max keyint of 50, which will produce even better results.
i would suggest for 576i :
--profile high --level 4.0 --vbv-maxrate 15000 --vbv-bufsize 15000 --keyint 50 --ref 6 --open-gop
No need for slices. And as video is only 576i, you can increase ref frames to 6.
The sar is according the video, is it a 4/3 or 16/9 video ?
4/3, you have to use :
--sar 12:11
16/9, you have to use :
--sar 16:11
The color for pal 576i is :
--colorprim bt470bg --transfer bt470bg --colormatrix bt470bg --videoformat pal
FranceBB
8th June 2017, 00:14
It's 1080i, it's not 720p.
My source it's an XDCAM 1080i 50Mbit/s 4:2:2 yv16, interlaced 25fps (50i), 4 audio tracks: CH.1-2 PCM Stereo German Full Mix, CH.3-4 PCM Stereo Music & Effects. It's really interlaced, it's not just flagged as interlaced and I would like to keep it that way.
Source:
General
Complete name : Filemaster.mxf
Format : MXF
Commercial name : XDCAM HD422
Format version : 1.2
Format profile : OP-1a
Format settings : Closed / Complete
File size : 12.0 GiB
Duration : 28mn 56s
Overall bit rate : 59.2 Mbps
Encoded date : 2017-06-03 20:21:00.208
Writing application : Omneon Inc. Omneon Media Subsystem 6.4.1.0.1
Writing library : Omneon Media Api (linux)
Video
ID : 2
Format : MPEG Video
Commercial name : XDCAM HD422
Format version : Version 2
Format profile : 4:2:2@High
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : M=3, N=12
Format settings, picture structure : Frame
Format settings, wrapping mode : Frame
Codec ID : 0D01030102046101-0401020201040300
Duration : 28mn 56s
Bit rate : 50.0 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25 fps
Standard : Component
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.965
Time code of first frame : 00:00:00:00
Time code source : Group of pictures header
Stream size : 10.1 GiB (84%)
Color primaries : BT.709
Transfer characteristics : BT.709
Audio #1
ID : 3
Format : PCM
Format settings, Endianness : Little
Format settings, wrapping mode : Frame (BWF)
Codec ID : 0D01030102060100
Duration : 28mn 56s
Bit rate mode : Constant
Bit rate : 2 304 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Frame rate : 25 fps
Bit depth : 24 bits
Stream size : 477 MiB (4%)
Audio #2
ID : 4
Format : PCM
Format settings, Endianness : Little
Format settings, wrapping mode : Frame (BWF)
Codec ID : 0D01030102060100
Duration : 28mn 56s
Bit rate mode : Constant
Bit rate : 2 304 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Frame rate : 25 fps
Bit depth : 24 bits
Stream size : 477 MiB (4%)
Audio #3
ID : 5
Format : PCM
Format settings, Endianness : Little
Format settings, wrapping mode : Frame (BWF)
Codec ID : 0D01030102060100
Duration : 28mn 56s
Bit rate mode : Constant
Bit rate : 2 304 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Frame rate : 25 fps
Bit depth : 24 bits
Stream size : 477 MiB (4%)
Audio #4
ID : 6
Format : PCM
Format settings, Endianness : Little
Format settings, wrapping mode : Frame (BWF)
Codec ID : 0D01030102060100
Duration : 28mn 56s
Bit rate mode : Constant
Bit rate : 2 304 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Frame rate : 25 fps
Bit depth : 24 bits
Stream size : 477 MiB (4%)
Other #1
ID : 1-Material
Type : Time code
Format : MXF TC
Time code of first frame : 10:00:00:00
Time code settings : Material Package
Time code, striped : Yes
Other #2
ID : 1-Source
Type : Time code
Format : MXF TC
Time code of first frame : 10:00:00:00
Time code settings : Source Package
Time code, striped : Yes
My Avisynth Script:
video=FFVideoSource("Filemaster.mxf")
ch1=WAVSource("ch1.wav")
ch2=WAVSource("ch2.wav")
audio=MergeChannels(ch1, ch2)
AudioDub(video, audio)
Normalize(0.89, show=false)
Converttoyv12(interlaced=true)
f3kdb(range=15, Y=80, Cb=60, Cr=60, grainY=0, grainC=0, keep_tv_range=True, input_depth=8, output_depth=8)
My "new" x264.bat (I added jpsdr suggestions):
avs4x264mod.exe "AVS Script.avs" --x264-binary "x264.exe" --bitrate 25000 --preset medium --ref 4 --level 4.1 --profile High --vbv-bufsize 40000 --vbv-maxrate 30000 --overscan show --keyint 25 --slices 4 -b-pyramid strict --min-keyint 1 --mvrange 511 --bframe 3 --aud --sar 1:1 --pic-struct --videoformat PAL --interlaced --tff --nal-hrd vbr --bluray-compat --colormatrix bt709 --transfer bt709 --colorprim bt709 --range tv --log-level info --thread-input --opencl --output raw_video.h264
If you want optimal result, you can add :
--open-gop
Uhm... I noticed that XDCAM files require closed GOP: M=3, N=12. I'm gonna encode a Bluray, which is different and in H.264, so it's different, but is --open-gop going to be a problem? Will I benefit from it without affecting compatibility?
Maybe even use a good deinterlacer like QTGMC
I know QTGMC, it's my first favorite deinterlacer (the second one is tdeint). Anyway, my source is 1080i, is it really worth deinterlacing? I don't think 1920x1080 25fps progressive is allowed by Bluray, is it?
--sar 1:1 and bt709 are not allowed for PAL. See start post.
Ok. --sar 1:1 it's the one for 1920x1080, right? And BT.709 it's the colormatrix for HD contents, like my source. Also, it seems that it's also suggested as option here: https://sites.google.com/site/x264bluray/home/1080i
Are you sure it's not supported?
jpsdr
8th June 2017, 08:41
Source and target are different. If you target Blu-Ray, you can use open-gop (needs bluray-compat but you've put it, so it's fine), it doesn't matter what source has, this parameter is for the target only.
And as it's HD 1920x1080, the sar is 1:1 and color is BT.709. For me, your command line is good.
About deinterlace and the remark about the sar and color, it's probably because he thought it was 576i.
sneaker_ger
8th June 2017, 09:35
About deinterlace and the remark about the sar and color, it's probably because he thought it was 576i.
Yes, he only mentioned "PAL XDCAM MXF" which I assumed to be 720x576 interlaced. He didn't say anything about 1080i.
I would remove "--videoformat PAL" and "--overscan show", I'm not sure they are allowed or appropriate. (And maybe --opencl if you're targeting production. The minor speedup might not be worth the additional stability risks.)
Sharc
8th June 2017, 11:51
"If something CAN be made complicated, it WILL..." (Murphy).
Why not follow the instructions for blu-ray compliant encoding given in the first post of this thread, and the links to the examples with commandlines provided at the end of the first post of this sticky ... :devil:
FranceBB
8th June 2017, 15:39
Source and target are different. If you target Blu-Ray, you can use open-gop (needs bluray-compat but you've put it, so it's fine), it doesn't matter what source has, this parameter is for the target only.
And as it's HD 1920x1080, the sar is 1:1 and color is BT.709. For me, your command line is good.
About deinterlace and the remark about the sar and color, it's probably because he thought it was 576i.
Got it.
Yes, he only mentioned "PAL XDCAM MXF" which I assumed to be 720x576 interlaced. He didn't say anything about 1080i.
I would remove "--videoformat PAL" and "--overscan show", I'm not sure they are allowed or appropriate. (And maybe --opencl if you're targeting production. The minor speedup might not be worth the additional stability risks.)
Yes, I'm gonna remove them.
Thank you, everyone! :)
mp3dom
8th June 2017, 19:47
Everything can be summarized as:
avs4x264mod.exe "AVS Script.avs" --x264-binary "x264.exe" --bitrate 25000 --preset medium --ref 4 --level 4.1 --profile High --vbv-bufsize 30000 --vbv-maxrate 40000 --keyint 25 --slices 4 --bframe 3 --sar 1:1 --tff --bluray-compat --colormatrix bt709 --transfer bt709 --colorprim bt709 --log-level info --thread-input --output raw_video.h264
and you'll get the same quality.
NOTE: In your command line you've switched the values of bufsize and maxrate. Bufsize needs to be 30 Mbps max, while maxrate can be up to 40 Mbps.
With your values, you'll get out of specs discs. Depending by the authoring software, you can get your file rejected or accepted but with buffer overflows problems during multiplexing or verification process.
Also, can't understand why you're normalizing your audio by peak (that can create weird results). I guess you know there are EBU standards and normalizing by peak will likely alter the audio in a not-standard way. Do you have valid reasons for that?
benwaggoner
8th June 2017, 19:50
And yes, if your source is interlaced, you probably should just leave it like that. Anything else will lose spatial or temporal detail.
Sent from my iPhone using Tapatalk
sneaker_ger
8th June 2017, 20:01
Everything can be summarized as:
--profile High --bframe 3 --log-level info --thread-input could also be dropped, while we're at it (and default is --ref 3). But of course it doesn't make any difference.
As Sharc said people make things too complicated instead of just reading the docs/examples...
FranceBB
9th June 2017, 02:03
Everything can be summarized as:
and you'll get the same quality.
NOTE: In your command line you've switched the values of bufsize and maxrate. Bufsize needs to be 30 Mbps max, while maxrate can be up to 40 Mbps.
With your values, you'll get out of specs discs. Depending by the authoring software, you can get your file rejected or accepted but with buffer overflows problems during multiplexing or verification process.
Also, can't understand why you're normalizing your audio by peak (that can create weird results). I guess you know there are EBU standards and normalizing by peak will likely alter the audio in a not-standard way. Do you have valid reasons for that?
Got it. I'm gonna bring them back to 25Mbit/s just to be 100% sure.
Besides, I need my audio to be as close as possible to -24 LUFS. We generally use a machine called "Sony DP 600" to achieve this. Is there a similar way to achieve this via avisynth?
mp3dom
9th June 2017, 08:40
Besides, I need my audio to be as close as possible to -24 LUFS. We generally use a machine called "Sony DP 600" to achieve this. Is there a similar way to achieve this via avisynth?
As far as I know, no, there isn't. You need a DAW and proper plugins to do that. -24db(-23, depending on the program) LUFS is the standard and is not so loud. If you normalize by peak you can get totally wrong results. Think of an inaudible audio with just a single peak at -3 dB, you'll get your audio boosted by only 2dB. The LUFS in that case will be even lower than -24 (probably -30) so it will be rejected. The other case, a very compressed (by dynamic range) audio where you have plenty of spikes at -5dB, you'll get a boost of 4dB so a very louder audio will be even louder. The LUFS in that case will probably be -18 or even higher. Normalizing by peak is, almost always, a bad choice.
If you can't access to a DAW/plugins, you can get decent results normalizing by RMS, with a target value of -26/-27dB. Still, this may be fine for non-professional jobs, because if you deliver the audio for broadcasting, you need to strictly follow the EBU standard.
imsrk48
1st January 2018, 04:04
where is color correction option in MeGui Latest Version
Sent from my P4 using Tapatalk
DenisRodman
11th March 2018, 17:13
The HDMV Timebased Slideshow is an application to present still pictures. It is same as movie presentation except that a presenting picture is a still picture. A still picture is coded as an MPEG-4 AVC IDR I-frame or an HEVC IDR I-frame. Presentation timing of the still picture is controlled by the associated PTS value and the presentation progresses with predefined timing axis. The stream of the Timebased Slideshow may contain data of Audio, Subtitle and Graphics. The presentation timing of these data is controlled by each PTS value in the stream.
I have 10 pictures 1.png, 2.png, 3.png ... 10.png how can create Timebased Slideshow MPEG-4 AVC IDR I-frame?
Please write the full code Command Line.
Thanks.
Qarmaa
15th May 2018, 10:32
I have 10 pictures 1.png, 2.png, 3.png ... 10.png how can create Timebased Slideshow MPEG-4 AVC IDR I-frame?
Please write the full code Command Line.
Thanks.
There is no way you can do this by using only x264. To create compliant timebased or browsable slideshow you need to integrate AVC SEI metadata:
ct_type: 2
nuit_field_base_flag: 1
counting_type: 4
full_timestamp_flag: 0
discontinuity_flag: 0
cnt_dropped_flag: 0
n_frame: 0
seconds_flag: 1
seconds_value: 1
(From stream produced by Scenarist's Still Image Encoder)
Those parameters can be set via libav's API
WorldOfCrap
23rd August 2018, 04:22
So, as a bit of a side project, I thought I would attempt to start encoding Blu-rays in ffmpeg instead of x264 with AVIsynth. Since ffmpeg natively supports almost any video format, and is 64-bit all the way through, it would offer much faster encoding, not to mention support for Mac and *nix systems.
Since ffmpeg uses libx264, I thought that, once I translated the x264 syntax to ffmpeg syntax, we should be able to get identical results. The Scenarist crew has offered to assist in running some verification checks.
Two minor hiccups so far: First, ffmpeg apparently doesn't enforce the Level 4.0/4.1 limit on reference frames, so that setting has to be manually spelled out in ffmpeg with the flag "-refs 4"
Secondly, interlaced ProRes isn't handled properly by ffmpeg unless you tell it to use interlaced scaling (even if you're not scaling the image at all).
After some trial and error, we have the following command line that, so far, passes Eclipse verification (for 1080p/23.976):
ffmpeg -i "filename" -c:v libx264 -pass 1 -b:v 30000k -tune film -level 41 -g 24 -r 24000/1001 -pix_fmt yuv420p \
-preset veryslow -vf setsar=sar=1/1 -refs 4 -color_primaries bt709 -color_trc bt709 -colorspace bt709 \
-x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=40000:slices=4:open-gop=1:force-cfr=1 -y \
-f rawvideo /dev/null
ffmpeg -i "filename" -c:v libx264 -pass 2 -b:v 30000k -tune film -level 41 -g 24 -r 24000/1001 -pix_fmt yuv420p \
-preset veryslow -vf setsar=sar=1/1 -refs 4 -color_primaries bt709 -color_trc bt709 -colorspace bt709 \
-x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=40000:slices=4:open-gop=1:force-cfr=1 -y \
-f rawvideo "filename.264"
So far, so good. Now I'm working on doing the other formats. One problem is, I can't find any reference on how to pass the x264 "--pulldown 32" flag for encoding 24p SD material. The closest thing I can find is the telecine filter, but that ACTUALLY adds the extra fields to convert 24 to 30 frames, instead of just the RFF flags.
Anyone know how to do that? Thanks!
(Edit: Yes, I already tried adding pulldown=32 to -x264opts, but that didn't work.)
mp3dom
23rd August 2018, 13:08
As far as I know, ffmpeg doesn't support all the parameters of x264cli, so you can also evaluate to use ffmpeg just to read the file and pipe it to x264cli.
kolak
23rd August 2018, 21:43
You can't add soft pulldown with ffmpeg for x264. Use x264 binary.
WorldOfCrap
24th August 2018, 02:51
Thanks mp3dom and kolak! I'll tinker with piping from ffmpeg to x264.
In the mean time, we've passed verification for encoding 1080i on ffmpeg! Even better, I'm getting SIGNIFICANT speed increases -- sometimes nearly 2x -- over just encoding with x264 & AVIsynth.
We've only passed as 29.97i/TFF, but 25i and BFF should work too (we'll check those next week). Just change -g 30 to -g 25 if you're doing 25 fps, and fieldorder=bff if necessary.
I'm not sure if "-flags +ilme+ildct" is still necessary or if those are deprecated, but it passed verification like this, so I'm leaving 'em in for now.
ffmpeg -I input.file -c:v libx264 -pass 1 -b:v XXXXX -tune film -level 41 -g 30 -r 30000/1001 -flags +ilme+ildct -pix_fmt yuv420p -preset veryslow \
-filter_complex scale=interl=1,setsar=sar=1/1,fieldorder=tff -refs 4 -color_primaries bt709 -color_trc bt709 -colorspace bt709 \
-x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=40000:slices=4:open-gop=1:force-cfr=1 -y -f rawvideo /dev/null
ffmpeg -I input.file -c:v libx264 -pass 2 -b:v XXXXX -tune film -level 41 -g 30 -r 30000/1001 -flags +ilme+ildct -pix_fmt yuv420p -preset veryslow \
-filter_complex scale=interl=1,setsar=sar=1/1,fieldorder=tff -refs 4 -color_primaries bt709 -color_trc bt709 -colorspace bt709 \
-x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=40000:slices=4:open-gop=1:force-cfr=1 -y -f rawvideo output.264
Update: 480i/29.97 verified OK too! (Below is for 16x9 video, if you need 4x3 change sar=40/33 to sar=10/11, and also field order if necessary)
ffmpeg -I input.file -c:v libx264 -pass 1 -b:v XXXXX -tune film -level 41 -g 30 -r 30000/1001 -flags +ilme+ildct -pix_fmt yuv420p \
-preset veryslow -filter_complex scale=interl=1,fieldorder=tff,setsar=sar=40/33 -refs 6 -color_primaries smpte170m -color_trc smpte170m \
-colorspace smpte170m -x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=31000:slices=4:open-gop=1:force-cfr=1 -y -f rawvideo /dev/null
ffmpeg -I input.file -c:v libx264 -pass 2 -b:v XXXXX -tune film -level 41 -g 30 -r 30000/1001 -flags +ilme+ildct -pix_fmt yuv420p -preset veryslow \
-filter_complex scale=interl=1,fieldorder=tff,setsar=sar=40/33 -refs 6 -color_primaries smpte170m -color_trc smpte170m -colorspace smpte170m \
-x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=31000:slices=4:open-gop=1:force-cfr=1 -y -f rawvideo output.264"
benwaggoner
28th August 2018, 18:42
In the mean time, we've passed verification for encoding 1080i on ffmpeg! Even better, I'm getting SIGNIFICANT speed increases -- sometimes nearly 2x -- over just encoding with x264 & AVIsynth.
Not surprising. Since you're really encoding 24 progressive frames instead of 30 interlaced frames, there's a lot less work for the encoder to do; fewer frames and no MBAFF.
sneaker_ger
28th August 2018, 19:42
If you get 2x speed increase it means your test is flawed.
benwaggoner
29th August 2018, 00:42
If you get 2x speed increase it means your test is flawed.
They also switched from 32-bit to 64-bit.
WorldOfCrap
26th September 2018, 03:44
Welp, that didn't work. Despite passing both Sony and Panasonic's verifier, we're still getting weird stuttering errors on PS4. So I guess scratch that, gotta stick with full-blown x264.
benwaggoner
26th September 2018, 16:50
Welp, that didn't work. Despite passing both Sony and Panasonic's verifier, we're still getting weird stuttering errors on PS4. So I guess scratch that, gotta stick with full-blown x264.
Are you getting the errors playing on a disc or via USB? As a .ts or a full BD disc image?
If it’s BD-R, it’s possible you might have have a burn/media issue.
mp3dom
27th September 2018, 08:50
Welp, that didn't work. Despite passing both Sony and Panasonic's verifier, we're still getting weird stuttering errors on PS4. So I guess scratch that, gotta stick with full-blown x264.
There are stb players (maybe even PS4 at this point) that try to output progressive video (progressive scan) without using the RFF flags as support (they use their own internal routines in realtime).
I saw jerking movements/stuttering mainly on panning with "still text" on it (so, generally opening/endings). If that's the case, there's a solution, but not with x264 (create a stream with a mixture of soft and hard pulldown).
WorldOfCrap
29th September 2018, 01:06
@ benwaggoner: We always test via BD-R, but we tried multiple burns on multiple players, and got problems in the same general spot of the program. I also doubt it was an I/O issue because the stream that was playing back was NTSC SD with AC3 audio, so the total bitrate was no more than 5500 kbps.
@ mp3dom: This wasn't an interlaced/progressive issue. In fact, it wasn't happening for the entire stream, but randomly in localized parts of the video, for example, within the same minute. The stuttering was unlike anything I'd ever seen before -- we'd get dropped frames and dropped audio, but seldom at the same time, and although it would stutter in the same general area, it wouldn't be in exactly the same frames each time we played it back. We tried with multiple burns on multiple PS4s, and had the same issues in the same general parts of playback.
Here's some cell phone video my QC guy took, sorry for the low quality:
https://www.dropbox.com/s/emrxio2p5vth59h/IMG_5434.MOV?dl=0
I had the Scenarist team take a look, since I initially thought this was a mux problem with their new v8 release, and they were able to reproduce the problem, but had no idea what was causing it. PS3 had some minor hiccups on those discs (same general spot, similar issue), but PS4 was unwatchable. Re-encoding the video with standard x264 fixed everything.
Unfortunately I don't have the ability to keep trying this, so I'll have to give up on ffmpeg for now. I suspect that SOME essential BD-compliant flag isn't getting passed correctly to x264lib, or isn't implemented in that iteration of x264.
mp3dom
29th September 2018, 14:15
Well... the only stuttering I can see from your video is the one on the onscreen text... and it's exactly what I told you before (text from the OP/ED). The very fine/razor text details (especially the razor horizontal border of the text) is making the player go crazy and get fooled because, with its own routines, it still try to output a 60p stream but using the wrong field matching.
You can overcome the problem simply encoding OP/ED with hard-pulldown and the rest with soft-pulldown.
This problem happens using other encoders too, and with other players as well... so it's not a direct x264/PS3-4 problem.
WorldOfCrap
30th September 2018, 23:48
Well... the only stuttering I can see from your video is the one on the onscreen text...
Yeah, not what I was referring to -- I'm aware that there was some interlacing issues there. It's more like full-on drop-outs where the video stops for a good half-second while the audio keeps going, or the audio drops for a half-second or so while the video keeps going. (I'm not sure if that clip captured an incident where the video was affected, but it sure got several incidents with the audio, which was just fine. Again, this cleared after re-encoding the video.)
kolak
29th December 2018, 00:35
Maybe your problematic place is at layer break?
infoeater
19th April 2019, 09:14
Is it possible to use x264 zones with ffmpeg? If so, how?
poisondeathray
19th April 2019, 14:52
Is it possible to use x264 zones with ffmpeg? If so, how?
-x264opts
e.g bitrate multiplier x2 for frames 100-200
-x264opts zones=100,200,b=2
infoeater
19th April 2019, 16:04
Thanks,
I used similar command before and it failed. After you wrote it, it started working. You have great power ;)
WSC4
18th August 2019, 02:13
First of all, I am not "Authoring" a Blu-ray Disc with x264. The disc will be a data disc of just 10 video files. There will be no BDMV, CLIPINF, PLAYLIST OR STREAM FOLDERS. The videos will be in the root directory on the Blu-ray disc.
Is this still OK to encode with x264?
1080p at 25 fps:
x264 --bitrate XXXXX --preset veryslow --tune film --bluray-compat --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 25 --open-gop --slices 4 --fake-interlaced --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 -o out.mkv input.mov
From the first page of this thread:
Output file must be in raw 264 elementary stream (extension .264) otherwise settings will not applied correctly. DO NOT USE MKV OR MP4.
I have to use the MKV extension. Is there a problem with this? Again, the disc will not have menus, chapters et cetera and I am not authoring it with Blu-ray authoring programs.
poisondeathray
18th August 2019, 16:33
I have to use the MKV extension. Is there a problem with this? Again, the disc will not have menus, chapters et cetera and I am not authoring it with Blu-ray authoring programs.
No problem if it's just a data disc
WSC4
19th August 2019, 07:23
Thank you. That is good news.
The videos to be burnt onto the discs are actually from a camcorder. MediaInfo state they are all progressive. Do I have to use the --fake-interlaced option?
Looking at these files from the video camera, MediaInfo also displays --colorprim, --transfer and --colormatrix as "bt709". Do I still need to include those options? My guess is that x264 will copy them anyway.
The discs would be played on current to maybe 9 year old Blu-ray players.
Asmodian
19th August 2019, 08:08
You do need to include those options, x264 will not copy them.
No need for --fake-interlaced.
Bordo32
17th February 2021, 17:45
I was reading trough many different posts on various forums, still did to find a definitive answer on what is recommended by Blu Ray specs Min GOP size (encoding with X264, H264), what min keyint value has to be set to have Blu Ray compliant encoded file?
I know that the Max GOP has to match the bitrate for 4.1 level, hence keint = 60 for 59.94fps video.
But the Min size is a mystery.
I am leaning towards min keyint = 1.
But found other recommendations:
min keyint = 2
min keyint = 0
min keyint = 1
min keyint = fps/2
min keyint = fps/2 + 1
But what is actual value is described by Blu Ray specs, if it is described?
Looking for your comments/advise.
benwaggoner
17th February 2021, 19:54
I was reading trough many different posts on various forums, still did to find a definitive answer on what is recommended by Blu Ray specs Min GOP size (encoding with X264, H264), what min keyint value has to be set to have Blu Ray compliant encoded file?
I know that the Max GOP has to match the bitrate for 4.1 level, hence keint = 60 for 59.94fps video.
It's not about the bitrate. The limitation is 1 second for Level 4.0 and 2 seconds for Profile 4.0 with a --vbv-maxrate of 15000 or less, IIRC. I used that combo burning BD images to DVD-R media way back in the day when BD-R replication wasn't cost-effective for smaller runs due to the requirement to purchase a per-title encryption key.
But the Min size is a mystery.
I am leaning towards min keyint = 1.
But found other recommendations:
min keyint = 2
min keyint = 0
min keyint = 1
min keyint = fps/2
min keyint = fps/2 + 1
But what is actual value is described by Blu Ray specs, if it is described?
It's been a long time since I made an old-school Blu-ray, but my dim memory agrees with --min-keyint 2. Some of the limitations are/have been due to a combination of x264 implementation and BD spec limitations, not strictly the Blu-ray spec itself. For example, open-gop wasn't allowed with --bluray-compat in older versions of x264 even though the spec allowed it. There's a lot fewer parameters changed in --bluray-compat today than in olden times.
MasterNobody
17th February 2021, 22:15
if( h->param.b_bluray_compat )
{
h->param.i_bframe_pyramid = X264_MIN( X264_B_PYRAMID_STRICT, h->param.i_bframe_pyramid );
h->param.i_bframe = X264_MIN( h->param.i_bframe, 3 );
h->param.b_aud = 1;
h->param.i_nal_hrd = X264_MAX( h->param.i_nal_hrd, X264_NAL_HRD_VBR );
h->param.i_slice_max_size = 0;
h->param.i_slice_max_mbs = 0;
h->param.b_intra_refresh = 0;
h->param.i_frame_reference = X264_MIN( h->param.i_frame_reference, 6 );
h->param.i_dpb_size = X264_MIN( h->param.i_dpb_size, 6 );
/* Don't use I-frames, because Blu-ray treats them the same as IDR. */
h->param.i_keyint_min = 1;
/* Due to the proliferation of broken players that don't handle dupes properly. */
h->param.analyse.i_weighted_pred = X264_MIN( h->param.analyse.i_weighted_pred, X264_WEIGHTP_SIMPLE );
if( h->param.b_fake_interlaced )
h->param.b_pic_struct = 1;
}
Link to encoder/encoder.c (https://code.videolan.org/videolan/x264/-/blob/b86ae3c66f51ac9eab5ab7ad09a9d62e67961b8a/encoder/encoder.c#L1002)
Commit (https://code.videolan.org/videolan/x264/-/commit/9fb055856a617f5ddca15a0c5745ff1c1486ad9a) from 2012.
Bordo32
17th February 2021, 23:12
It means has to be set keyint_min = 1 for Blu Ray compliant.
Correct?
MasterNobody
17th February 2021, 23:55
Yes. And it is automatically forced set when --bluray-compat is used i.e. no matter what --min-keyint you set, it still will be 1.
Bordo32
18th February 2021, 00:19
MasterNobody, thanks for your help.
Now is clear, set keyint_min = 1 just be on the safe side.
Richard1485
30th March 2021, 18:02
The images in the first post have disappeared. Good job sneaker made a backup (https://forum.doom9.org/showthread.php?p=1808625#post1808625). Maybe a mod can edit the OP.
Selur
1st April 2021, 18:40
@Richard1485: For me they are still there unless 'Ghostery' is enabled.
Richard1485
1st April 2021, 22:46
I don't have Ghostery, but I've quoted the OP, and the images are indeed still there. Something else must be blocking them. My bad then. It's good to know that they're still there. I went to check something the other day and couldn't see them. Thanks.
Selur
5th June 2024, 04:11
Nowadays, the pictures timeout of me,...
FranceBB
9th June 2024, 18:02
Nowadays, the pictures timeout of me,...
This is weird...
They also wouldn't load on my side on Chrome, however when I quoted the original post and tried to access the image directly at:
http://tom.niko.users.sbb.rs/resolutions.png
it would load and display.
At that point I started wondering: could it be an HTTPS issue?
And sure enough, if I try to load the same page with HTTP instead of HTTPS (namely http://forum.doom9.org/showthread.php?t=154533 instead of https://forum.doom9.org/showthread.php?t=154533) Chrome ignores it and loads the HTTPS version without images anyway. On the other hand, loading the HTTP version on Firefox works and sure enough the images are still there:
https://i.imgur.com/5O4HeIi.png
Funnily enough I have the "Always use HTTPS connections" disabled in my Chrome settings but it looks like the browser is testing and probing each HTTP website you visit to see whether it also support an HTTPS equivalent version and automatically "upgrades" you to HTTPS. At that point, I guess they're blocking plain HTTP elements like images due to a security concern which is why they're visible on Firefox but not on Chrome. Why Google, why...? :(
tebasuna51
17th June 2024, 10:23
I attached the images to avoid the problem.
I let the original url but now a copy of the images are in Doom9 and must be always see.
Selur
17th June 2024, 17:00
Thanks!
javieracdc
11th December 2024, 20:04
Anyone have some backup of the webpage?
http://www.x264bluray.com/home/1080i-p
The webpage is down
I need to compliant a MOV file into blu ray but i'm just learning some fews that i have to know
benwaggoner
12th December 2024, 01:15
Anyone have some backup of the webpage?
http://www.x264bluray.com/home/1080i-p
The webpage is down
I need to compliant a MOV file into blu ray but i'm just learning some fews that i have to know
As in a .MOV with a BD-compatible H.264 bitstream?
javieracdc
12th December 2024, 14:12
As in a .MOV with a BD-compatible H.264 bitstream?
I'm following this webpage to convert from MOV to a blu ray compliant
https://web.archive.org/web/20211016213149/http://www.x264bluray.com/home/1080i-p
However, what about the audio encode? because that command only works with stream video.
I am also experimenting with this command:
ffmpeg -i IMG_0006.mov -c:v libx264 -preset ultrafast -x264opts bitrate=18000:level=4. 2:keyint=60:bluray-compat:slices=4:open-gop:ref=4:open-gop:ref=4:vbv-maxrate=4000000:vbv-bufsize=3000000:weightp=0:b-pyramid=strict:cabac: “fps=60000/1001”:force-cfr -c:a ac3 -b:a 640k -ar 48000 -y out.mkv
Is this correct to encode audio and video at the same time?
quowouldsafa1985
23rd December 2024, 19:08
When encoding video for Blu-Ray using H264/AVC, it's important to follow the Blu-Ray standards to ensure compatibility and quality. The H264 codec is one of the most widely used for Blu-Ray encoding due to its excellent balance between file size and video quality. For Blu-Ray, the encoding settings should comply with the specific profile and level constraints, typically the High Profile with Level 4.1 for HD content.
A few key points to consider include choosing the right bitrate. For 1080p content, a bitrate of around 20-30 Mbps works well, but this can vary depending on the contentÂ’s complexity. If youÂ’re encoding in 4K, youÂ’ll need a much higher bitrate to preserve the quality of the image. Additionally, youÂ’ll want to use 2-pass encoding to optimize the bitrate allocation for the best quality.
Audio is also an important aspect—most Blu-Ray discs use Dolby Digital (AC3) or DTS audio, but you could also use uncompressed formats like LPCM depending on your requirements. Always make sure to check the synchronization between audio and video during encoding.
For more detailed guides and tips, you can refer to this link. It provides a great breakdown of encoding settings and tools you can use to get the best results for Blu-Ray creation.
javieracdc
23rd March 2025, 19:31
When encoding video for Blu-Ray using H264/AVC, it's important to follow the Blu-Ray standards to ensure compatibility and quality. The H264 codec is one of the most widely used for Blu-Ray encoding due to its excellent balance between file size and video quality. For Blu-Ray, the encoding settings should comply with the specific profile and level constraints, typically the High Profile with Level 4.1 for HD content.
A few key points to consider include choosing the right bitrate. For 1080p content, a bitrate of around 20-30 Mbps works well, but this can vary depending on the contentÂ’s complexity. If youÂ’re encoding in 4K, youÂ’ll need a much higher bitrate to preserve the quality of the image. Additionally, youÂ’ll want to use 2-pass encoding to optimize the bitrate allocation for the best quality.
Audio is also an important aspect—most Blu-Ray discs use Dolby Digital (AC3) or DTS audio, but you could also use uncompressed formats like LPCM depending on your requirements. Always make sure to check the synchronization between audio and video during encoding.
For more detailed guides and tips, you can refer to this link. It provides a great breakdown of encoding settings and tools you can use to get the best results for Blu-Ray creation.
Hi
Which is the link url that are you refering to?
excellentswordfight
24th March 2025, 12:43
Hi
Which is the link url that are you refering to?
I think you can ignore that message, looks like a bot respons, so I wouldnt follow any link regardless.
javieracdc
26th March 2025, 00:29
Ok anyway :)
I have a Mac Book Air M2 and I installed the Compressor app, and I noticed that this program (which is similar to Handbrake) has a Blu ray profile to encode a video and export the video in .264 format
https://support.apple.com/es-cl/guide/compressor/cpsr3f00eefa/mac
Has anyone tried this software to encode a video to h264 and test if it complies with Blu ray parameters? will there be any difference versus doing it directly with x264 ?
javieracdc
26th March 2025, 17:33
Edit:
I used a video for testing the Compressor h264 settings and it generated:
Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference : 4 frames
Format settings, GOP : M=3, N=15
Format settings, Slice coun : 4 slices per frame
Bit rate mode : Variable
Maximum bit rate : 35.0 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 29.970 (30000/1001) FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan type, store method : Separated fields
Scan order : Top Field First
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Later I convert this 264 file into m2ts using tsmuxer and I imported into TMPenc authoring works 7 trial and I used The File Checker:
https://i.ibb.co/C57qDHP4/clip-format-checker.png
And it detects that video must be reencoded
cubicibo
26th March 2025, 19:08
Two issues:
- you misconfigured TMPGenc as a PAL project while you want NTSC framerate. You can fix this without re-encoding.
- you must reduce the number of reordered frame to two, or reduce the number of consecutive b-frames. You must change your compressor settings (if possible) and re-encode.
javieracdc
26th March 2025, 21:05
Two issues:
- you misconfigured TMPGenc as a PAL project while you want NTSC framerate. You can fix this without re-encoding.
- you must reduce the number of reordered frame to two, or reduce the number of consecutive b-frames. You must change your compressor settings (if possible) and re-encode.
1) Yes, you are right, I configured now in NTSC and now framerate is passed
2) In Compressor, not possible (At least the option) modify this type of value,
Even here:
https://support.apple.com/es-cl/guide/compressor/cpsr3f00eefa/mac
Doesn´t specific modify the reordering frame
cubicibo
26th March 2025, 22:06
If you can't reduce the maximum number of consecutive b-frames then Compressor cannot be used for your purpose.
javieracdc
1st April 2025, 18:52
Hi
I had retested again about the Blu Ray output in Compressor app in MAC, but now I downloaded a older version of Compressor, version 4.7, which this version is the latest supports for DVD and Blu ray iso creation (Even this version create blu ray with a basic menu), newer Compression version, DVD is deprectated and cant create an iso file ready for blu ray, only creates .h264 files extension video
So I created again the blu ray of my video test and this is the output of m2ts:
Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference : 4 frames
Format settings, Slice coun : 4 slices per frame
Codec ID : 27
Duration : 1 min 5 s
Bit rate mode : Variable
Bit rate : 24.7 Mb/s
Maximum bit rate : 35.0 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 29.970 (30000/1001) FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan type, store method : Separated fields
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.398
Stream size : 194 MiB (96%)
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
And now using Clip Format Checker from TMPEnc AW7 now the video is passed:
https://i.ibb.co/932WxYsv/image.png
In conclusion, Compressor version 4.7 is the "latest"version that full comply with Blu Ray standard.
The version that I was using on my fisrt test was 4.9
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.