Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th January 2010, 10:53   #1  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
Question : Encoding parameters to be blu-ray compliant

I've first some questions.

Are the ref frames for blu ray more restrictive than HP@L4.1 ?
What i've read needed for blu-ray :
1920x1080 : Ref max 4.
1280x720 : Ref max 6.
But HP@L4.1 allow 9 ref max frame. Is blu-ray still limited to 6 ?
In x264, in case of "strict" b-pyramid, ref frame is decrease of 1, it seems ?

For 1920x1080, for blu-ray, max b-frame is 3. Is it still the same for 1280x720 ? Any others resolutions ?
Is, only in caseof pure HP@L4.1 the max b-frame limited to ref ?

What are, in 1920x1080 and 1280x720, all the progressive frame rate blu-ray compliant ?

I've try to read the T-REC-H.264-200903-I!!PDF-E document.
Have the MaxMvsPer2Mb parameter any link with the --merange parameter of x264 ? If not, is there any parameter related to it ?

Does the fact to put the level at "4.1" and the profile to "high" in x264 assure that all the parameters are compliant with HP@L4.1 ?
Edit : Does it affect the --mvrange parameter wich is at -1 [Auto] by default ?

Now with the nal_hrp patch near to be commited, could it be interesting to gather all the informations necessary to produce blu-ray compliant stream in the same place ?

Could it be interesting to have in x264 a --blu_ray flag, wich will alt the process if the encoding parameters and/or video are not blu-ray compliant ? (Bad ref value, video size incorrect, frame rate supported only in interlace mode, etc...). With of course, an explicit error message telling what is incorrect.

Thanks in advance for the answers.

Last edited by jpsdr; 28th January 2010 at 12:43.
jpsdr is offline   Reply With Quote
Old 28th January 2010, 14:12   #2  |  Link
shon3i
BluRay Maniac
 
shon3i's Avatar
 
Join Date: Dec 2005
Posts: 2,419
Here i made table for allowed combinations, acording bd specs, which are not in public. Btw you can use Main Profile@Level 4.1 and lower with this settings.



One thing i missed that for all resolution if level 4.1 used, slices are required, not only for 1080,720 resoultions like in table.

AVC on BD standrad is little more limited than AVC itself, generaly by the refs, VBV, bframes, resoulutions, GOP.

Quote:
In x264, in case of "strict" b-pyramid, ref frame is decrease of 1, it seems ?
B-pyramid strict is completly Blu-Ray compilant, while normal is not. You don't need worry about refs, you can use --ref 4 and --b-pyramid strict normaly, old x264 b-pyramid is been broken and even rush AVC standard.

Quote:
For 1920x1080, for blu-ray, max b-frame is 3. Is it still the same for 1280x720 ? Any others resolutions ?
Is, only in caseof pure HP@L4.1 the max b-frame limited to ref ?
Max bframes is 3, for all combination, no exceptions.

Quote:
What are, in 1920x1080 and 1280x720, all the progressive frame rate blu-ray compliant ?
For 1080p allowed fps is 23.976 and 24, for 720p is 23.976,24,50,59.97.

Quote:
Have the MaxMvsPer2Mb parameter any link with the --merange parameter of x264 ? If not, is there any parameter related to it ?
x264 default oarametar is compilant with Blu-Ray which is 511.75 IIRC.

Quote:
Could it be interesting to have in x264 a --blu_ray flag
There have been some rumors that x264 will get --device switch. But nothing yet. Anyway i will happy if this switch automaticly correct evey user input that not meet device settings and not start to encode if some other parametar not meet such resolution, not only warn or something.

Quote:
Now with the nal_hrp patch near to be commited, could it be interesting to gather all the informations necessary to produce blu-ray compliant stream in the same place ?
I would like to see same, instead we have tons of same treads with same questions, and same answers.
shon3i is offline   Reply With Quote
Old 28th January 2010, 16:38   #3  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by shon3i View Post
There have been some rumors that x264 will get --device switch. But nothing yet. Anyway i will happy if this switch automaticly correct evey user input that not meet device settings and not start to encode if some other parametar not meet such resolution, not only warn or something.
http://x264dev.multimedia.cx/?p=270
sneaker_ger is offline   Reply With Quote
Old 28th January 2010, 17:16   #4  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
@shion 3 : You're talking about --mvrange, my question is about --merange.
Thanks for your informations.

Another technical question, more about x264 (maybe DS or other coder can answer it) :
If i double for example 29.97fps (file_1) video to 59.97fps (file_2), by duplicating each frame, i insist : duplicate.
Can i assume, that encoding the file_1 and the file_2 with the same bitrate will result in almost the same quality (like 99% identical) ? Having one frame of 2 wich is exactly the same than the previous frame ? (wich result, for this second frame, in absolutely no change, almost no bit necessary).
The idea of course is to try to find a trick to encode in progressive a 29.97fps file without the necessity to increase the bitrate.
jpsdr is offline   Reply With Quote
Old 28th January 2010, 17:23   #5  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 957
Quote:
Originally Posted by jpsdr View Post
@shion 3 : You're talking about --mvrange, my question is about --merange.
Thanks for your informations.
merange controls how far x264 searches. The limit on the length of a vector is mvrange
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.
J_Darnley is offline   Reply With Quote
Old 28th January 2010, 18:26   #6  |  Link
mp3dom
Registered User
 
Join Date: Jul 2003
Location: Italy
Posts: 1,135
Quote:
Originally Posted by jpsdr View Post
@shion 3 : You're talking about --mvrange, my question is about --merange.
Thanks for your informations.
Another technical question, more about x264 (maybe DS or other coder can answer it) :
If i double for example 29.97fps (file_1) video to 59.97fps (file_2), by duplicating each frame, i insist : duplicate.
Can i assume, that encoding the file_1 and the file_2 with the same bitrate will result in almost the same quality (like 99% identical) ? Having one frame of 2 wich is exactly the same than the previous frame ? (wich result, for this second frame, in absolutely no change, almost no bit necessary).
The idea of course is to try to find a trick to encode in progressive a 29.97fps file without the necessity to increase the bitrate.
59.94fps are supported only at 1280x720. It could be a lot better if it's possible in some way (maybe it's already possible?) to encode like PEP by MS (or CineVision PSE which is quite the same) do. PEP has a compression mode where you specify that your video is truly 29.97p so the encoder analyse and do motion vector with progressive format in mind but at the very end it "flag" the file as interlaced. In this way you don't lose the pros of a progressive encode but also you can import the file in your bluray project. It's the same as with MPEG2, where you can encode a file as full progressive and then open it with ReStream and flag it as interlaced.
mp3dom is offline   Reply With Quote
Old 28th January 2010, 19:48   #7  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
There is in HP@L4.1 spec a parameter called MaxMvsPer2Mb, with a limitation value of 16.
There is in x264 a parameter call merange with default value of 16. I want to know if these two parameters are the same thing,
because in placebo mode merange is set to 32, and if they are the same paramter, it breaks in that case the compliancy with HP@L4.1... Argh... Will i have an answer wich is not out of the question... Is my english so bad ???
jpsdr is offline   Reply With Quote
Old 28th January 2010, 19:59   #8  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by jpsdr View Post
There is in HP@L4.1 spec a parameter called MaxMvsPer2Mb, with a limitation value of 16.
There is in x264 a parameter call merange with default value of 16. I want to know if these two parameters are the same thing
They're not.
Dark Shikari is offline   Reply With Quote
Old 28th January 2010, 21:24   #9  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
Thanks DS.
Any idea about my question in post #4 ?

@mp3dom : I want to encode with x264, wich is supposed to be actualy the best h264 encoder.
jpsdr is offline   Reply With Quote
Old 28th January 2010, 21:26   #10  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Yes you can duplicate every frame. It will not be perfectly free, as it somewhat screws up B-frames, but it won't be too expensive.
Dark Shikari is offline   Reply With Quote
Old 28th January 2010, 22:15   #11  |  Link
shon3i
BluRay Maniac
 
shon3i's Avatar
 
Join Date: Dec 2005
Posts: 2,419
Quote:
PEP has a compression mode where you specify that your video is truly 29.97p so the encoder analyse and do motion vector with progressive format in mind but at the very end it "flag" the file as interlaced.
Well that is possible with x264 too. Just flag progressive video as interlaced, adding --interlace switch. I tested and work fine (scenarist+bdverifier). Maybe is not optimal because x264 interlaced is not implement to work with other stuff like wegihtp, but is definitly better than VC-1

Last edited by shon3i; 28th January 2010 at 22:17.
shon3i is offline   Reply With Quote
Old 28th January 2010, 23:04   #12  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
For the flagging, would the player "know" it was progressive flagged as interlaced? Or would it try to deinterlace the material ? Has anyone actually tested this on a player?

When it's authored is it packaged in a 60i stream? Isn't this 2-2 pulldown ?
poisondeathray is offline   Reply With Quote
Old 29th January 2010, 08:55   #13  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
@shion3 : Have allready tested and verified the fact that --interlace work, in scenarist and all, but, some feature (like weigthp as you said) are not working in interlace mode. So, i'm trying to keep x264 encoding in progressive, to keep all the possible features, and try to see what is the best choice possible.

Thanks DS for your answer, i'll keep it in mind if i encouter 29.97 or 25 "true" progressive material.

Last edited by jpsdr; 29th January 2010 at 08:58.
jpsdr is offline   Reply With Quote
Old 29th January 2010, 09:07   #14  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by jpsdr View Post
@shion3 : Have allready tested and verified the fact that --interlace work, in scenarist and all, but, some feature (like weigthp as you said) are not working in interlace mode. So, i'm trying to keep x264 encoding in progressive, to keep all the possible features, and try to see what is the best choice possible.
The mere fact that interlaced mode is absurdly inefficient on progressive content should be good enough reason to not use it; the missing features are hardly an issue by comparison.
Dark Shikari is offline   Reply With Quote
Old 29th January 2010, 11:41   #15  |  Link
mp3dom
Registered User
 
Join Date: Jul 2003
Location: Italy
Posts: 1,135
Quote:
Originally Posted by jpsdr View Post
Thanks DS.
@mp3dom : I want to encode with x264, wich is supposed to be actualy the best h264 encoder.
I doesn't want to say that PEP/CineVision PSE is better... only that a similar approach could be helpful for x264 too (to be honest I don't know if it's already possible to do that, adding the interlaced flag surely resolve the problem but the encoder itself with that flag works as a "true interlaced footage" source I think).
Regarding the "best encoder", surely x264 is one of the best (especially regarding high quality at lower bitrates) but to be honest we don't have comparatives/demo files regarding other high rank encoder like Sony Blu-Code or CC-HDe. It is also to note that Blu-Code or CC-HDe costs a lot of money so in a quality/cost ratio, x264 is sure the best.
mp3dom is offline   Reply With Quote
Old 29th January 2010, 12:59   #16  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
Quote:
Originally Posted by shon3i View Post
Well that is possible with x264 too. Just flag progressive video as interlaced, adding --interlace switch. I tested and work fine (scenarist+bdverifier). Maybe is not optimal because x264 interlaced is not implement to work with other stuff like wegihtp, but is definitly better than VC-1
Don't forget about chroma sampling scheme for 4:2:0 in case progressive vs. interlaced... changing type is not so simple and affecting few other areas...
pandy is offline   Reply With Quote
Old 29th January 2010, 16:53   #17  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
Another question : I've read for blu-ray that --min-keyint 2 is recommanded, but not an obligation. Can someone confirm it ?
Can --min-keyint 1 be used ?
If a progressive video and encoded in progressive is tagged interlaced, can this leads to "bad" decode results ?

Last edited by jpsdr; 29th January 2010 at 16:56.
jpsdr is offline   Reply With Quote
Old 5th February 2010, 22:16   #18  |  Link
rallymax
Rallymax
 
Join Date: Aug 2009
Location: Santa Clara CA
Posts: 55
Quote:
Originally Posted by shon3i View Post
Here i made table for allowed combinations, acording bd specs, which are not in public. Btw you can use Main Profile@Level 4.1 and lower with this settings.



One thing i missed that for all resolution if level 4.1 used, slices are required, not only for 1080,720 resoultions like in table.
At all resolutions is slices permissible? (ie can I simply leave have "-slices 4" applied for everything?
Also, what is the command argument for the Max Ref Frames? "-keyint"?

Last edited by rallymax; 5th February 2010 at 22:20. Reason: typo
rallymax is offline   Reply With Quote
Old 5th February 2010, 22:50   #19  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by rallymax View Post
At all resolutions is slices permissible? (ie can I simply leave have "-slices 4" applied for everything?
You don't need 4 slices for Level 4.0. Slices reduces encoding efficiency slightly. If you are using DVD5/9 media for an "AVCHD" disc (as your posts in the other thread suggests), it is unlikely you are going to use Level 4.1 anyway. However, you can use 4 slices, but I wouldn't if it wasn't required.

Quote:
Also, what is the command argument for the Max Ref Frames? "-keyint"?
--ref

This will help with some of the command parameters
http://mewiki.project357.com/wiki/X264_Settings

Last edited by poisondeathray; 5th February 2010 at 23:02.
poisondeathray is offline   Reply With Quote
Old 15th February 2010, 17:03   #20  |  Link
Ulf
Registered User
 
Join Date: Sep 2008
Location: Sweden
Posts: 66
The encoding parameters I have been using in order to ensure Blu-ray compliance are:

For Level 4.1:
--profile high --preset <any> --tune <any> --level 4.1 --bframes 3 --keyint <fps> --min-keyint 2 --vbv-bufsize 30000 --vbv-maxrate 40000 --b-pyramid none --slices 4 --aud --nal-hrd

and for Level 4.0:
--profile high --preset <any> --tune <any> --level 4 --bframes 3 --keyint <fps> --min-keyint 2 --vbv-bufsize 30000 --vbv-maxrate 24000 --b-pyramid none --aud --nal-hrd

I thought these settings would ensure Blu-ray compliance for any choice of "preset".
As far as I can tell, it does so for 1080p input.

For 720p input and presets veryslow or placebo one gets ref=9 (reset from 16 by --level 4/4.1) which is higher than the allowed limit of 6.
In this case one have to insert --ref 6 explicitly. Are there any means (in the command line) to set an upper limit for --ref?
Ulf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:21.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.