View Full Version : How to get a specific H.264 Level with x264
Lathe
2nd December 2013, 09:00
Hello!
I just downloaded your program [Simple x264 Launcher] and it looks REALLY nice! I am trying to use it, but I cannot seem to be able to change the Profile Level so that I can play the output on my OPPO Blu-ray player.
I can ONLY play L4.1 or less, and yet no matter WHAT I do, the program keeps starting to encode it at L5, no matter if I have it set at 'High,'Main', 'Baseline', or 'Auto'. I've tried adding --Profile <4.1> to the custom cmd code area, and it just tells me that I cannot use it with the GUI since IT will do it for me :)
Please, if I cannot change the Profile Level, then this excellent program will not help me at all; any suggestions on how, if possible, to do this would be GREAT!
Thank you!
kypec
2nd December 2013, 10:14
I've tried adding --Profile <4.1> to the custom cmd code area, and it just tells me that I cannot use it with the GUI since IT will do it for me :)
Please, if I cannot change the Profile Level, then this excellent program will not help me at all; any suggestions on how, if possible, to do this would be GREAT!
AVC Profiles and Levels are two distinct (although somehow related) things. This is what you need to add to custom command line options:
--level 4.1
I'd suggest to let Profile set to Auto or maybe force it to High to ensure maximum compatibility with your OPPO player.
LoRd_MuldeR
2nd December 2013, 10:51
Also note that H.264 Levels restrict things you can't simply enforce by "--level", such as resolution and framerate!
For example, Level 4.1 supports at most 1280×720 at 68.3 fps or 1920×1080 at 30.1 fps. Anything above that, will require higher Level, no matter what.
Lathe
3rd December 2013, 02:08
AVC Profiles and Levels are two distinct (although somehow related) things. This is what you need to add to custom command line options:
--level 4.1
I'd suggest to let Profile set to Auto or maybe force it to High to ensure maximum compatibility with your OPPO player.
Hi!
Thanks kindly for your helpful reply; so then, I simply add the line EXACTLY as you have shown it here: '--level 4.1' (with spaces and without quotes, right? And then set it to 'High', correct?
I wonder how many parameters I can mess with to tweak the settings a little (assuming of course that I actually can even RUN the dang thing properly :) ) I would usually select 'Slow' I think overall, unless I guess I want to do a faster 2 pass or something. I need to check your 'Help' menu too, because I THINK that you have listed the lines of code for the x264 encoder that you CAN insert in the custom area.
Also, it LOOKS on the surface that you cannot really change very many details that much, so I probably need to look closer to see what parameters in the general GUI are available to change.
I don't know if you can answer this, but looking at the documentation and the updates that you do, I would ASSUME that your program would utilize the newest, up to date, and hopefully the fastest components and such to re-encode HD files. For example, what I've done before when I've had to re-encode something, is I'd put it in a BDMV folder usually using TsMuxer and then run it through BD Rebuilder with the CRF custom set at say '16' and then set it to force the re-encode. But, your program would be more efficient to do this, right? (I USED to use MultiAVCHD which is a bitch'n program, but I'm guessing that it's components are SO out of date that yours would HAVE to be a lot better!)
Any thoughts of yours are very much appreciated!
Cheers!
Lathe
3rd December 2013, 05:31
Yes, I put the line of code in just like you said, and I could tell as soon as the encode started that the program was indeed using the L4.1 setting, so that solves that, thank you!
Just one quickie, if I may please...
I noticed that when I re-encoded my movie file which was about 4 Gigs originally, that the program automatically made the file a little smaller although I didn't see any presets that determined output size.
Basically what I wanted to know is that sometimes I just need to re-encode a file because the parameters are not right or it is not compatible with Blu-ray standards; I do NOT really need to reduce the size of the file. Is there a way where you can just simply have it re-encode at a set CRF rate but WITHOUT whatever settings that limit or further compress the size? Is there some setting that I am missing that automatically does that?
Many times, I do not really care about the file size,especially if I am dealing with smaller files like this,so it would be very nice if I had some kind of control over whether the program necessarily needs to control the resulting output size or not. Is there a way to set it so that all that it considers are the parameters that will result in the highest chosen quality (slow, 1 or 2 pass, etc.) but WITHOUT trying to 'shrink' or compress it further? I don't even mind if the resulting file is larger than the original. For example, with BDRB you can tell it to force the encode at a set CRF and to IGNORE checking what the resulting file size will be.
Thanks again so much!
Lathe
3rd December 2013, 08:19
I am sorry to keep bugging you, but I just now checked out the encodes and they look GREAT with VLC, but sadly they are completely locking up my OPPO Blu-ray player. I tried adding the code 'bluray-compat' in the custom line, which it accepted and shows in the resulting MediaInfo stats, BUT, neither encode will play on my OPPO :(
Here are the 2 MediaInfo logs:
Log 1 (with just the '--level 4.1' added)
cabac=1 / ref=5 / deblock=1:-1:-1 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Log 2 (with both '--level 4.1 --bluray-compat' added)
cabac=1 / ref=4 / deblock=1:-1:-1 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=1 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=1 / keyint=250 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Neither one will play on my OPPO player; I do not understand enough about the x264 codec to figure out WHY or what parameters need to be changed so that encodes using your program will HOPEFULLY play on my hardware player.
Shouldn't your program, even set at it's defaults produce files that will play on a normal stand-alone Blu-ray player? (with L4.1 at least added of course) PLEASE take a look at these resulting media logs and if you could kindly suggest what I need to do to or to change to make SURE that any resulting files WILL play on my OPPO.
Thank you so much for your time and trouble. I REALLY hope I can get this figured out because I frigg'n LOVE your program and even at the 'Slow' setting with CRF16 it STILL is really fast! Probably because your components are so up to date and really optimized to take full advantage of the 64 bit CPUs :)
***EDIT
In looking at the logs here, I notice that in the 2nd one WITH 'bluray-compat' enabled, it is showing 'b_pyramid=1' interestingly the first log shows a value of '2'. Now, to be compatible with Blu-ray, doesn't that either have to be set at None '0', or Strict '2'? A setting of '1' Normal will not play, will it? Weird, it's like the first one HAS the right setting for that, but the second one doesn't. Also, neither log shows 'Slices=4'; shouldn't it have that if it is set at L4.1? Also, in almost all the logs I have looked at, there are buffers and max bitrates set; I don't see any here. Don't you need all that to play in a Blu-ray player?
I think I'm getting more confused... Sorry... :scared:
kypec
3rd December 2013, 10:04
Lathe, I recommend you to read thoroughly this thread (http://forum.doom9.org/showthread.php?t=154533) which focuses on Blu-ray compatible encoding. You didn't mention at all which file container are you trying to play in your BD player: MKV? MP4? M2TS? anything else?
I don't own standalone BD player and I play all my encodes either directly in Samsung TV (USB HDD plugged in) or mostly via Serviio (http://serviio.org/) server installed on my desktop PC. Also, my Tegra3 based tablet with Android and MX Player had no problems whatsoever with playing any of my MP4 or MKV encodes, even in FullHD. Last but not least, make sure that audio muxed in final container is compatible with your OPPO e.g. AC3, DTS, AAC etc.
DVB-Freak
3rd December 2013, 10:11
Hello Lathe,
I use the following lines to encode:
--qcomp 0.5 --sar 1:1 --level 4.1 --weightp 0 --slices 1 --vbv-maxrate 15000 --vbv-bufsize 15000 --keyint 50 --min-keyint 5 --ref 4
For 720p I use "--ref 5". I tested it on several BD-Players and it worked.
I hope, this helps you.
DVB-Freak
Lathe
3rd December 2013, 19:54
Lathe, I recommend you to read thoroughly this thread (http://forum.doom9.org/showthread.php?t=154533) which focuses on Blu-ray compatible encoding. You didn't mention at all which file container are you trying to play in your BD player: MKV? MP4? M2TS? anything else?
I don't own standalone BD player and I play all my encodes either directly in Samsung TV (USB HDD plugged in) or mostly via Serviio (http://serviio.org/) server installed on my desktop PC. Also, my Tegra3 based tablet with Android and MX Player had no problems whatsoever with playing any of my MP4 or MKV encodes, even in FullHD. Last but not least, make sure that audio muxed in final container is compatible with your OPPO e.g. AC3, DTS, AAC etc.
Thanks, I'll check!
Lathe
3rd December 2013, 20:07
Hello Lathe,
I use the following lines to encode:
--qcomp 0.5 --sar 1:1 --level 4.1 --weightp 0 --slices 1 --vbv-maxrate 15000 --vbv-bufsize 15000 --keyint 50 --min-keyint 5 --ref 4
For 720p I use "--ref 5". I tested it on several BD-Players and it worked.
I hope, this helps you.
DVB-Freak
Thanks kindly for these helpful suggestions too; I realize now that most of you more advanced techie guys (such as the developer here :) ) do not use hardware players. I also have that capability and understand the convenience; however, the reason why I have such a collection is both because I have a nice OPPO player that has very high quality rendering, scaling, and D/A audio chips which help me to benefit from using my 50" Plasma and custom theatre setup. Also, if a HDD crashes (unless you have EVERYTHING in redundancy, which I DO except my all of my general Blu-rays and movies) then you lose everything, period. Thus the physical medium (although I DO back up my rarer films and Blu-rays and EVERYTHING else in triplicate)
Anyway, sorry to go on... But, I know that there is a growing chasm between more technologically advanced people getting away from the physical medium, and I fully understand that. But, I am still a bit of a stickler and A/Vphile within my means, so... :)
Sure appreciate all the suggestions though! So far my only TOTALLY safe way to do this is simply use TSMuxer and create a BDMV folder and then use BDRebuilder (which is ALWAYS compliant - which the name and purpose suggests I guess...) with the CRF set where I want and force a re-encode.
Oh, and I DO have that Blu-ray Specification page bookmarked already; I guess I need to keep working my @ss and learn it! Sounds like I just need to keep pounding away at more fully understanding the x264 codec itself. When I am able simply to use a cmd line and write what I want, then I guess I'll be there :)
Also, to answer what resulting format I want; it will ALWAYS be something that I can play with my OPPO. If the AR is compliant with a BDMV structure, then I will create one; if it is not, then MKV would be the resulting file, which I can also play within the players parameters. The one thing that I haven't figured out how to get my player to do, and maybe it just DOESN'T, is to use chapters in a MKV file to be able to step forward and back through a film like you can with a Bluray. It doesn't seem to recognize or use the usual 'Chapter' settings that people include in their encodes, thus if I CAN put the file into a BDMV folder, I can have this capability, but it is not that much of a biggie.
A great program though!
Cheers!
LoRd_MuldeR
3rd December 2013, 22:05
Moved this discussion to a separate thread, because it had become off-topic.
HWK
4th December 2013, 00:09
Good Day, Lathe
Aftering reading your thread may I suggest you use this website for reference to create stream which are 100% blu-ray compatible.
https://sites.google.com/site/x264bluray/
Once you enter website, on left side you will find all available presets.
For example 1080P
x264 --bitrate XXXXX --preset veryslow --tune film --bluray-compat --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 24 --open-gop --slices 4 --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o out.264 input.file
Lathe
4th December 2013, 03:11
Thanks kindly HWK! Yes, I saw that there, but they show so FEW settings, I'm thinking that it was either not complete or extremely outdated. But, it seems that EVERYWHERE I look someone is linking to that site like it is the GOD of blu-ray compatibility information :)
I was THINKING in my lowly ignorant way that there MUST be a LOT more settings (some I've mentioned before here on this thread) that that site never even states anything about at all...!?? I mean, how about B_Pyramid, Trellis, Decimate, Aq,Me, Subme, etc., etc., etc... I mean, I do appreciate I guess that with those seemingly VERY basic settings, sure, the output would likely be fully compliant. But, that doesn't even begin to allow me to do any of these other things to improve the quality of the encode. Do you see what I mean. And, when I've bloody TRIED until my eyes fall out to search for just a bloody straight-forward page that simply lists ALL the settings and parameters that you CAN use and still be compliant with a Blu-ray player, there just doesn't seem to be one.
I mean, just how difficult can it possibly be for SOMEONE somewhere just to post a thread, or page simply stating these things? But, it just doesn't seem to exist. Sooooooo, in the meantime of finding a Holy Grail (however simplistic it is) I'll just keep reading excellent threads and sites like these for hours and hours TRYING my best to absorb little snippets here and there. For example in about 3 hours of reading today I was able to learn from pieces of many different discussions that for Blu-ray compatibility the open_gop should be set at '1', b_pyramid should be set at 'Strict' or 'None'. Stuff like that, but it is frigg'n SLOOOOOOOOOOOOW going :) For another example, after reading for many hours over the last week or so, I've slowly learned that how the bitrate and buffers should be set and that at L4.1 you need to use '4 slices' and a few other things
Then, the other day I stumble upon this nice looking, simple GUI and the first encode I do AT L4.1 STILL doesn't play, so thus my coming here and asking these things. But again, I understand that many here may not use hardware players, so I see why the presets with this program may not take that into consideration. Thus my need to keep reading and looking :) Like I have mentioned before, and I am currently doing this right now as I write, my best bet for 'both' worlds seems simply to use BDRB, force the CRF=n encode and add to the ini config file of the program whatever x264 'Tweaks' I want. That really is not a bad place to start until I learn more about the actual encoding and Blu-ray compatibility.
Thanks so much though for your guys patience; I hope that I haven't been too terribly annoying...
Cheers!
HWK
4th December 2013, 03:50
Lathe, the thing x264 can accept lot of parameters. However all of them are designed for different purpose. It would really helpful to know what you want final output to play on and so one may advise which setting to use.
Level is only part of story, having more info about playback environment would help a lot.
However, if you want to see all available parameters read this website. Be advised not every setting is applicable and some even break playback.
http://mewiki.project357.com/wiki/X264_Settings
Lathe
4th December 2013, 04:37
Lathe, the thing x264 can accept lot of parameters. However all of them are designed for different purpose. It would really helpful to know what you want final output to play on and so one may advise which setting to use.
Level is only part of story, having more info about playback environment would help a lot.
However, if you want to see all available parameters read this website. Be advised not every setting is applicable and some even break playback.
http://mewiki.project357.com/wiki/X264_Settings
Yes sir, I have that one too and I understand what you are saying. It is very simple; as I have said I want ALL of my encodes simply to be able to play on my OPPO Blu-ray player. Period. One environment. So, how hard can it be simply to list WHICH parameters will NOT BREAK playback, but CAN be adjusted / used?
They just simply HAVE to be Blu-ray compliant.
That's all.
Thanks though!
HWK
4th December 2013, 04:52
Good Day, Lathe
Aftering reading your thread may I suggest you use this website for reference to create stream which are 100% blu-ray compatible.
https://sites.google.com/site/x264bluray/
Once you enter website, on left side you will find all available presets.
For example 1080P
Thanks kindly HWK! Yes, I saw that there, but they show so FEW settings, I'm thinking that it was either not complete or extremely outdated. But, it seems that EVERYWHERE I look someone is linking to that site like it is the GOD of blu-ray compatibility information :)
That is because preset add lot of parameter for you, which other wise you have to enter manually. More is not always better :D
sneaker_ger
4th December 2013, 10:19
Also note that the informations on that site are for creating h.264 streams for "professional" Blu-Rays according to the Blu-Ray specs, i.e. with a Blu-Ray folder structure on a Blu-Ray medium with AACS for duplication in a specialized facility. Adhering to these does not necessarily mean they will work in a mkv or mp4 container in a Blu-Ray player (and the other way around: not adhering does not necessarily mean they will not work).
Other things to note:
1. You mentioned the brand of your Blu-Ray player, but not the exact model.
2. It may not necessarily be because of the H.264 stream that the files don't work. It could also have other causes, e.g. the player does not like the way they were muxed into mkv. (Look here (https://trac.bunkus.org/wiki/FAQ%3AImprovingPlaybackCompatibilityWithPlayers#Notusingcertainnewelementsinthecueswith--engageno_cue_durationand--engageno_cue_relative_position), esp. for --engage no_cue_duration and --engage no_cue_relative_position)
Lathe
4th December 2013, 20:15
Also note that the informations on that site are for creating h.264 streams for "professional" Blu-Rays according to the Blu-Ray specs, i.e. with a Blu-Ray folder structure on a Blu-Ray medium with AACS for duplication in a specialized facility. Adhering to these does not necessarily mean they will work in a mkv or mp4 container in a Blu-Ray player (and the other way around: not adhering does not necessarily mean they will not work).
Other things to note:
1. You mentioned the brand of your Blu-Ray player, but not the exact model.
2. It may not necessarily be because of the H.264 stream that the files don't work. It could also have other causes, e.g. the player does not like the way they were muxed into mkv. (Look here (https://trac.bunkus.org/wiki/FAQ%3AImprovingPlaybackCompatibilityWithPlayers#Notusingcertainnewelementsinthecueswith--engageno_cue_durationand--engageno_cue_relative_position), esp. for --engage no_cue_duration and --engage no_cue_relative_position)
Thank you; I very much appreciate you taking the time to clarify that for me. Good point. I have the older OPPO BDP-83 which CAN be a little particular in playing some files, although it's behaved pretty well. It cannot play above L4.1 (without pixelating) and it the reference frames (and I'm GUESSING the B frames) get too high for the resolution, especially in the BDMV format, that will trip it up. It is a little more forgiving for MKVs that way.
That's why I am SO bloody AVID about finding out about these parameters, because sometimes I will get a 'hold' of an MKV file, say for example, and the level looks good and the B frames, Ref frames, etc. and it will lock up my player. So, I will earnestly poor over the MediaInfo file and look through all the coding, so I can bloody LEARN PRECISELY what to do and what NOT to do. So far, I've learned that the general default max buffer and bitrates are pretty commonly constant. B frames can be up to 3, Reference frames can vary a little, but it's best not to push it. B-pyramid can be off or strict. Open_gop can be 0 or 1. Cabac is fine. L4.1 needs 4 slices. Me can be 'hex' at least and Subme can be at least '7'. Looking at BDRB resulting code I can tell that Mbtree is '1', etc. You see, in just a few minutes I've already listed quite a few of the basic parameters, but it's taking me FOREVER to learn all of them. For example, I don't know the acceptable (compatible) limits of using the Psy settings or the qp or aq settings, although I am SLOWLY learning about them by reading so many threads (apparently the aq tends to 'smooth' out things if it is too high, so I won't probably use or increase it) BUT, there are so many others...
So, do you see what I mean, it would take someone maybe, what, like 5 minutes to list ALL the parameters (at least for BASIC, general Blu-ray compatibility - I KNOW that SOME may vary a little because of specific players) and then BAM! You would have a working list. I am just whining and complaining about the hours and hours and hours I have to spend looking at hundreds of places JUST to find out these that I have :)
You see where I'm coning from...?
Okay, now I promise I'll take a Valium and go to bed :cool:
Thank you SO much though for all your suggestions and time; they honestly have been VERY helpful!!! And I will DEFINITELY check into this last reference that you have given me.
Cheers!
Asmodian
7th December 2013, 01:09
A lot of the settings you seem to be worried about have no effect of how compatible the video will be. They are "encode only" settings, trading quality for performance and not changing the way information is stored in the result. For example --me can be anything and it will not change the way motion vectors are stored in the file; only how accurate the motion vectors are and how long they take to find.
The information from x264bluray is complete, that command line is all you need.
Lathe
7th December 2013, 06:06
A lot of the settings you seem to be worried about have no effect of how compatible the video will be. They are "encode only" settings, trading quality for performance and not changing the way information is stored in the result. For example --me can be anything and it will not change the way motion vectors are stored in the file; only how accurate the motion vectors are and how long they take to find.
The information from x264bluray is complete, that command line is all you need.
Hmmm, interesting to know; although I have read that certain settings 'break' playability on hardware players. But, perhaps the ones I mentioned and most of the others do not.
Appreciate the help and input!
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.