[x264-devel] Encoding frames with libavcodec

Jason Garrett-Glaser jason at x264.com
Thu Nov 29 16:26:19 CET 2012


On Thu, Nov 29, 2012 at 1:27 AM, Dolevo Jay <cmst at live.com> wrote:
> Jason,
>
> So please tell me this process is correct in case of having continuous
> incoming video stream,
>
> 1. Get the first frame,
> 2. Set the configuration for this specific frame. So in this case, I should
> have different settings for I, P and B frame.
> 3. Call the x264_encoder_encode function.
> 4. Get the next frame until reaching the encoded frame number is equal to
> param.i_fps_num (apparently GOP size) and call x264_encoder_encode again .
> 5. When all frames are encoded, pack all the encoded data by reaching
> nals[i] and send it to the decoder.
>
> Does this sound good?

Have you tried reading the documentation and example code?  You need
to encode a frame, copy out the encoded data, repeat.  i_fps_num has
nothing to do with this and is not the GOP size; please at the very
least read the public header.

Jason


More information about the x264-devel mailing list