[Ffmpeg-devel] Re: problems with v4l2.c

Luca Abeni lucabe72
Mon Sep 25 17:24:01 CEST 2006


(I also added the ffmpeg-devel mailing list to the reply)
On Mon, 2006-09-25 at 10:09 +0800, Fang Ricky wrote:
>    I want to stream the video captured from v4l2, but I met a seg
> fault in memcpy of v4l2.c. I found that in  memcpy(frame,
> s->buf_start[buf.index], buf.bytesused);
>  the buf.bytesused=884736 ,and the s->frame_size=691200, this is why
> seg fault happend. The size parameter I put is -s 720x480 ,and
> -pix_fmt is uyvu422, so the frame_size=691200 is right ,but I have no
> idea why buf.bytesused is 884736?
Thanks for reporting the bug.
Unfortunately, I do not really know what's going on here... I tried to
reproduce the problem on all the machines I can test, but I always get
buf.bytesused == s->frame_size == 691200. The value you get, 884736, is
not even a multiple of 480...

Which drivers are you using? Maybe you are seeing a v4l bug? Can you try
a different version of the driver?

Maybe I am missing something... Can you check what's the value of
fmt.fmt.pix.bytesperline after ioctl(fd, VIDIOC_S_FMT, &fmt) has been
called in device_init()?
Does anyone else have any idea about this?

Anyway, the program should not crash even if v4l is returning strange
values; I'll fix the bug as soon as I have some time.

Copy this in your signature, if you think it is important:
                               N O    W A R ! ! !

More information about the ffmpeg-devel mailing list