After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 301718 - assertion when using ffenc_* elements with v4l2src
assertion when using ffenc_* elements with v4l2src
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal normal
: 0.8.10
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-04-23 15:56 UTC by Luca Ognibene
Modified: 2005-06-09 16:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Luca Ognibene 2005-04-23 15:56:42 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.
Comment 1 Ronald Bultje 2005-04-23 16:08:38 UTC
The warning is really definitely needed; this implies a bug in v4l2src.
Comment 2 Luca Ognibene 2005-04-24 12:13:06 UTC
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..
Comment 3 Luca Ognibene 2005-05-03 15:28:23 UTC
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..)
Comment 4 Ronald Bultje 2005-06-09 16:44:05 UTC
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.