PDA

View Full Version : B frames in X264


funduguy
29th April 2008, 01:50
Hi experts,
i'm new to the encoding world and i came across the X264 video encoder. i'm trying to encode a video and want to know how can i have constant number of B frames between P frames.

i tried using the --no-b-adapt option but it seems to have no change in the selection of B frames.

Basically, i want to fix the number of B frames between P frames, say 2, how do i do that?

:thanks:

Dark Shikari
29th April 2008, 01:55
That's what --no-b-adapt does. Of course, if you're running in twopass mode, it has to be enabled in the first pass too.

funduguy
29th April 2008, 02:04
Thanks for the reply,
This is my command line and i thought i'll get 2B frames consistently, but no so, i got 1B frame also at some locations.

x264 --keyint 180 --min-keyint 30 --scenecut 40 --bframes 2 --b-bias 100 --no-b-adapt --no-cabac --ref 2 --direct spatial --qp 30 --ipratio 1.15 --pbratio 1.15 --partitions all --me umh --merange 16 --subme 1 --no-chroma-me --no-fast-pskip --no-ssim --progress --level 1.3 --fps 30 --frames 300 --threads 4

Any pointers as to what could be the reason?

Regards,

Dark Shikari
29th April 2008, 02:11
Try it without threads.

Either way, those are some really bizarre settings.

funduguy
29th April 2008, 02:34
Thanks for the info.
cool, that works just fine. but why it does not work with more threads?

Regards,

:thanks:

Ranguvar
29th April 2008, 03:33
I think you win the freakiest settings award xD

And I don't know why not using threads will make it work... just spamming :p

audyovydeo
29th April 2008, 07:46
--bframes 2 --b-bias 100

huh ???

try --bframes 2 --b-bias 2. Threads should not matter imo

cheers
audyovydeo

nm
29th April 2008, 09:03
The b-bias range is -90--100 and 100 is a valid setting to enforce more b-frames to be inserted when b-adapt is used. B-bias 2 would be about the same as the default behaviour.

DarkZell666
29th April 2008, 09:35
Why keep the --b-bias anyway if you're going to use --no-b-adapt ? Just remove --b-bias and try again, I suspect --b-bias (when manually set) overrides --no-b-adapt instead of the opposite ... (but I've never read the code right ? just my 0.02€ ^^). Those two settings are mutually exclusive and shouldn't even be allowed to be specified together imho :)

Or is it the threaded part that doesn't take any notice of --no-b-adapt ?

neuron2
2nd May 2008, 07:04
@funduguy

Please don't delete threads after someone else has answered. You can delte your own posts, but it's rude to delete other people's posts. Thank you.

DarkZell666
2nd May 2008, 08:21
So that's why I couldn't find it anymore ? -_-