[Ffmpeg-devel] video4linux2 input for testing

Mat heavensdoor78
Mon Jan 30 10:58:29 CET 2006


Luca Abeni wrote:
>     fd = open(devname, O_RDWR /*| O_NONBLOCK*/, 0);
>     if (fd < 0) {
>         av_log(NULL, AV_LOG_ERROR, "Cannot open video device %s : %s\n",
>                  devname, strerror(errno));
>
> 	return -1;
>     }
>   
// In my v4l2 app I added a memset here...

memset(&cap, 0, sizeof(cap));

> static int device_init(int fd, int width, int height, int pix_fmt)
> {
>     struct v4l2_format fmt;
>
>     memset(&fmt, 0, sizeof(struct v4l2_format));
>     fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
>     fmt.fmt.pix.width = width;
>     fmt.fmt.pix.height = height;
>     fmt.fmt.pix.pixelformat = pix_fmt;
>     fmt.fmt.pix.field = V4L2_FIELD_INTERLACED; 
>   
// I use V4L2_FIELD_ANY here, it should be more flexible

Hope it could help.
I have little experience with V4L2 and FFmpeg but I made a small app 
that works with them and I would like to improve my knowledge so when 
you go on with your module post it here, it is appreciated.

P.S.
Italiano anche tu immagino :)





More information about the ffmpeg-devel mailing list