GNOME Bugzilla – Bug 139535
[v4lsrc] video size with spider is badly negotiated
Last modified: 2005-07-16 16:00:08 UTC
using : v4lsrc ! ffmpegcolorspace ! xvimagesink => window has the good size using : v4lsrc ! spider ! xvimagesink => video is in a 2cm * 1cm thumbnail so, bad video size renegotiation
Both piplelines have unconstrained caps, i.e., many different formats are equally possible (size, framerate, colorspace). It is up to the application writer to either use filtered caps to get the exact format desired, or use a fixate signal to encourage a good format. Since gst-launch doesn't have such hints, the core pretty much picks a format at random; sometimes it doesn't suck.
v4lsrc (and others) still need fixate functions, I'd say.
Thomas recently added fixate functions to v4lsrc, can you retest?
no luck, it still fails when using spider but it adds the following warnings : (process:9776): GStreamer-CRITICAL **: file gstcaps.c: line 413 (gst_caps_get_structure): assertion `index < caps->structs->len' failed (process:9776): GStreamer-CRITICAL **: file gststructure.c: line 767 (gst_structure_has_field): assertion `structure != NULL' failed (process:9776): GStreamer-CRITICAL **: file gstcaps.c: line 1489 (gst_caps_structure_fixate_field_nearest_int): assertion `gst_structure_has_field (structure, field_name)' failed (process:9776): GStreamer-CRITICAL **: file gststructure.c: line 767 (gst_structure_has_field): assertion `structure != NULL' failed (process:9776): GStreamer-CRITICAL **: file gstcaps.c: line 1489 (gst_caps_structure_fixate_field_nearest_int): assertion `gst_structure_has_field (structure, field_name)' failed
note that with v4l2src, errors are different :ERROR v4l2src( 9822) v4l2src_calls.c(216):gst_v4l2src_set_capture:<v4l2src0> (null) ERROR v4l2src( 9822) v4l2src_calls.c(216):gst_v4l2src_set_capture:<v4l2src0> failed to set pixelformat to 4:2:0, planar, Y-Cr-Cb @ 48x32 for device /dev/video0: Périphérique ou ressource occupé ERROR: from element /pipeline0/v4l2src0: Could not get/set settings from/on resource. Additional debug info: v4l2src_calls.c(216): gst_v4l2src_set_capture: /pipeline0/v4l2src0: failed to set pixelformat to 4:2:0, planar, Y-Cr-Cb @ 48x32 for device /dev/video0: Périphérique ou ressource occupé ERROR v4l2src( 9822) v4l2src_calls.c(369):gst_v4l2src_capture_stop:<v4l2src0> (null) ERROR v4l2src( 9822) v4l2src_calls.c(369):gst_v4l2src_capture_stop:<v4l2src0> Device is not in streaming mode (process:9822): GStreamer-WARNING **: could not PAUSE element "v4l2src0" after error, help! ERROR v4l2src( 9822) v4l2src_calls.c(216):gst_v4l2src_set_capture:<v4l2src0> (null) ERROR v4l2src( 9822) v4l2src_calls.c(216):gst_v4l2src_set_capture:<v4l2src0> failed to set pixelformat to 24 bpp RGB, le @ 48x32 for device /dev/video0: Périphérique ou ressource occupé ERROR: from element /pipeline0/v4l2src0: Could not get/set settings from/on resource. Additional debug info: v4l2src_calls.c(216): gst_v4l2src_set_capture: /pipeline0/v4l2src0: failed to set pixelformat to 24 bpp RGB, le @ 48x32 for device /dev/video0: Périphérique ou ressource occupé "v4l2src device=/dev/video0 ! ffmpegcolorspace ! xvimagesink" works as expected
That's v4l2src. I was talking about v4lsrc. :).
comment #4 is when using v4lsrc comment #5 is when doing the same thing with v4lsrc2 (perhaps another unrelated bug)
Stephane, for #4 I'd like to see a backtrace from running inside gdb with --gst-fatal-warnings, so we can fix the criticals and warnings. Ronald, for #5 maybe you could port over the fixate functions I added, I have no idea how to test v4l2. In general, it might make sense to have a fixate function for ffmpegcolorspace that preserves w/h from the other side, in the same way audioconvert does. ffmpegcolorspace gets added so much that it's really annoying to have it cause an override of negotiations in other parts.
Created attachment 27322 [details] full debug log gst-launch-0.8 --gst-scheduler=basicgthread --gst-fatal-warnings --gst-debug-level=5 v4lsrc device=/dev/video0 ! spider ! xvimagesink
Comment on attachment 27322 [details] full debug log hum, marked it as plain-text, but it is a bz2 archive
Thomas: You mean videoscale. ffcolorspace cannot scale.
Fixed in HEAD, aside from the fact that v4l2src is not yet ported to 0.9. Open a new bug for any bad behavior once it has been ported, tho.