[x264-devel] Re: Questions about x264 encoder apis

Måns Rullgård mru at inprovide.com
Thu Mar 31 03:05:38 CEST 2005


Bill May <wmay at cisco.com> writes:

> Hi,
>
> I'm using x264 as the encoder for our mp4live live encoder for mpeg4ip.
>
> First, I have to say that x264 is amazing work.  The interfaces are
> the best that I've used with this project - by returning each nal,
> you've made it very easy for me to create RTP packets and save it to
> mp4 files.  The x264_encode_headers is likewise a great idea - it makes
> getting the headers for SDP very simple.  I was encoding using the
> apis after only a couple of hours from downloading the package.
>
> So far, I'm not using b frames, but may do that over time.
>
> Now, for my questions:
>
> 1). in x264_picture_alloc, you allocate the YUV space, and have the
> user copy the data into that space.  Do you alter the YUV data ?
> Would it be possible to have a mode where the caller could just set
> the correct data and save potential data copies ?

You don't need to use x264_picture_alloc.  Just fill in the pointers
and strides and it should work.  x264 makes of reference frames
internally.  I suppose it would be possible to modify it to notify the
caller when it's done with the frames, and they can be safely freed,
without ever making any copies.

> I'd be glad to do the work and contribute it back (it seems to work
> with the correct settings, but I need to make sure that the YUV data
> is undisturbed).
>
> 2). Do you have any plans to install the library and include files so
> they could be detected by other projects via configure ?

Nobody is stopping you from copying x264.h and libx264.a to some place
of your liking.

> 3). To force a key frame, is it better to set i_frame_reference or
> i_keyint_max ?  i_frame_reference seems to do the trick, but I'd like
> to make sure.

Those are more or less unrelated.  i_keyint_max specifies the maximum
interval between key (IDR) frames.  i_frame_reference is the maximum
number of reference frames to keep around for prediction.

> 4). I'd like to make it work as fast as possible.  So, I want to set
> b_psnr to 0.  Any other things to make it faster ?

There's the usual tradeoff between speed and quality/bitrate.  You can
experiment with different X264_ANALYSE_* flags, and see how they
affect your encodings.

> 5). i_bitrate is in bits per second ?  If I use b_cbr, what should I
> set the other parameters to ?

i_bitrate is kbits per second.  The other parameters can usually be
left at their default settings.

> 6). Any ideas about which nerd knobs would make sense (b_cabac, etc) ?

Well, they are all there for some reason.  Try them and see which
settings work best with your inputs.

-- 
Måns Rullgård
mru at inprovide.com

-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list