On 11/12/2010 04:35 AM, George Smart wrote:
[...]
Frames are read from the webcam by V4L2. init_video_encode is called
with a filename, and sets up the codec, etc. close_video_encode is
called to close the video encoder, finish files, free memory, etc.
video_encode is called with a pointer to a frame of video from V4L2. It
is set as below, inside V4L2. These are the only options which work with
the webcams I have.

fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;

Inside my code, http://www.ee.ucl.ac.uk/~zceed42/ffmpeg.html
<http://www.ee.ucl.ac.uk/%7Ezceed42/ffmpeg.html>, I take data from the
V4L2 pointer, *p, with the av_fill command, and fill picture (AVFrame):
[...]

Why don't you use libavdevice's v4l2 input? That would provide you with
correctly initialised AVPackets, that you can decode in AVFrames, and you
would avoid problems in correctly initialising and filling the AVFrame
structure. The code in ffmpeg.c shows how to use libavdevice as input.


                                Luca
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to