GNOME Bugzilla – Bug 301718
assertion when using ffenc_* elements with v4l2src
Last modified: 2005-06-09 16:44:05 UTC
When using this pipeline: gst-launch-0.8 v4l2src ! video/x-raw-yuv,framerate=25.0,width=640,height=480 ! ffenc_mpeg4 ! avimux ! filesink location="file.avi" I have this assertion: ** (process:11928): CRITICAL **: gst_ffmpegenc_chain_video: assertion `frame_size == GST_BUFFER_SIZE (inbuf)' failed These pipeline work fine: gst-launch-0.8 v4l2src ! video/x-raw-yuv,framerate=25.0,width=640,height=480 ! xvimagesink gst-launch-0.8 videotestsrc ! video/x-raw-yuv,framerate=25.0,width=640,height=480 ! ffenc_mpeg4 ! avimux ! filesink location="file.avi" Just removing the assertion in gstffmpegenc.c fixes this for me.
The warning is really definitely needed; this implies a bug in v4l2src.
I've tried to debug this: In gst_v4l2src_capture_init the returned buffer length is [462848] while ffmpegenc expets [460800] (640*480 + 320*240*2 = 460800). If i try to force a different colorspace (like rgb or yuv/YUY2) i have this error: ERROR (0x8050938 - 309540:12:02.740195000) v4l2src(16652) v4l2src_calls.c(259):gst_v4l2src_capture_init:<v4l2src0> Could not get buffers from device "/dev/video0". ERROR (0x8050938 - 309540:12:02.741212000) v4l2src(16652) v4l2src_calls.c(259):gst_v4l2src_capture_init:<v4l2src0> error requesting 2 buffers: Device or resource busy ERROR: from element /pipeline0/v4l2src0: Could not get buffers from device "/dev/video0". dunno why..
I'll try to dig better when i'll have some free time. I'm using v4l2src on a anothers pc and it's working fine.. Can we at least fix the _big_ leak: Change g_return_if_fail (frame_size == GST_BUFFER_SIZE (inbuf)); to if (frame_size != GST_BUFFER_SIZE (inbuf)) { gst_buffer_unref (inbuf); return ; } (not tested code..)
No; that leak is a programming error which should be fixed elsewhere. This warning is the perfect way to notice the programming error. The bug is probably in gstv4l2src.c:910. I fixed that instead. Note that this implies a buggy driver.