View Single Post
Old 20th December 2007, 16:21   #1  |  Link
tetsuo55
MPC-HC Project Manager
 
Join Date: Mar 2007
Posts: 2,317
x264 Known Hardware accelleration problems and solutions

Below you will find the settings to create a file that will work on any hardware decoder.
Current problems will be explained and finally i will explain how you can try to convince an older file to work.

What settings to use to create a universally(L4.1) working fileNOTE1:
Follow these 3 steps

STEP 1: Determine the REF frame in DPB limit:
Code:
8388608 / (Height X Width) = nREF
The value can never be higher than 16 so round it down if its higherNOTE2

STEP 2: Decide if you want to use B-pyramidsNOTE3:
Code:
If B-Pyramids = YES then nREF -1
If B-Pyramids = NO then add "--no-b-pyramid"
STEP 3: Make sure use these commands and never cross the limits, shown here are the highest settings(not marked) or mandatory settings(marked with *):
Code:
--VBVMaxBitrate 40000 (highest possible value)
--KeyframeInterval 24*
level-idc = 4.1*
Profile = High*

NOTE1
If a file created with these settings does not work on your hardware it is either not capable of L4.1 decoding or there is something wrong with the universal settings.
Handheld devices do not support L4.1 i have created an alternative setting below.
NOTE2
Currently there is a bug with DXVA(videocards) on several of the decoders, a REF value higher than 11 will not work on all systems or with all players. (if you want to help fix the bug or want more information see the thread here http://forum.doom9.org/showthread.php?p=1170371)
NOTE3
B-pyramids are "broken" in x264, this is why you need to reduce ref frames by 1 to guarantee that it works, and even then it might not be stable at all. if you want to know more and/or help fix it see this thread: http://forum.doom9.org/showthread.php?t=140223


Not all hardware devices support L4.1, these devices need L3.0 settings(A lot of portable devices use even lower settings, please check the manual and use the correct MEgui profile):
Follow these 2 steps

STEP 1: Determine the REF frame in DPB limit:
Code:
2073600 / (Height X Width) = nREF
The value can never be higher than 16 so round it down if its higherNOTE2

STEP 2: Make sure use these commands and never cross the limits, shown here are the highest/lowest settings(not marked) or mandatory settings(marked with *):
Code:
--vbv-bufsize 10000 (highest possible value)
--vbv-maxrate 12500 (highest possible value)
--KeyframeInterval 24*
level-idc = 3.0*
Profile = High*
--no-b-pyramid*
B-pyramids does not work on most portable devices, so its best to disable it completely.

---

If the file is already encoded but you cannot get it to work you can try the following:

If you have a file that was already encoded, but it doesn't work there are 4 options:
1.Try the file in MPC-HC if it supports you videocard
2.Use h264info to change the header to level3.1 or level4.1 and try your regular player
3.Use a software decoder like coreavc
4.Transcode the file to be Hardware level compliant.

Non-working files usually means that it was encoded with an old version of x264, has too many ref-frames for its resolution/level or was muxed with an old version of mkvmerge.

(The previous post i had here has been archived here: http://forum.doom9.org/showthread.ph...69#post1170369)

EDIT:1 (Added min-keyint 4 to the required settings thanks to the findings in this thread: http://forum.doom9.org/showthread.php?t=140135 )
EDIT:2 (min-keyint 4 removed, x264 already respects these limits by default)
EDIT:3 (Corrected fullhd formula(the incorrectness of the old formula did not effect ref frame caluclation))

Last edited by tetsuo55; 27th September 2008 at 19:09. Reason: Completely re-written to update to current status
tetsuo55 is offline   Reply With Quote