You can encode a frame with x264 (http://www.videolan.org/developers/x264.html) folowing this example (https://github.com/hiccupzhu/x264-example/blob/master/yuv2h264/yuv2h264.c).
The encoder receive a YV12 image (not RGB) with is 50% the size of a RGB image (width*height*1.5). You will write the frame in the lines: memcpy(pic_in.img.plane[0], data, widthXheight); memcpy(pic_in.img.plane[1], data + widthXheight, widthXheight >> 2); memcpy(pic_in.img.plane[2], data + widthXheight + (widthXheight >> 2), widthXheight >> 2); The plane[0] receive a image width*height. The plane[1] and [2] receive 1/4 the size of the Y. You get the encoded frame in "nal[0].p_payload" and "i_frame_size". -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-encoding-h264-tp4658906p4659276.html Sent from the libav-users mailing list archive at Nabble.com. _______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
