v4l2src with NV12: failed to map video frame

Nicolas Dufresne nicolas.dufresne at collabora.com
Tue Feb 17 06:06:10 PST 2015


Hi Fred,

here I extracted and stripped a small part of the trace.

gst_v4l2_object_set_format:<v4l2src0> progressive video
gst_v4l2_object_set_format:<v4l2src0> Desired format 1280x720, format 
NV12 stride: 1280
gst_v4l2_object_set_format:<v4l2src0> Desired format is 1280x720, format 
NV12, nb planes 1
gst_v4l2_object_set_format:<v4l2src0> stride 1280
gst_v4l2_object_set_format:<v4l2src0> Got format of 1280x720, format 
NV12, nb planes 1, colorspace 3
gst_v4l2_object_set_format:<v4l2src0> stride 1920, sizeimage 1382400
gst_v4l2_object_set_format:<v4l2src0> Desired framerate: 50/1
gst_v4l2_object_extrapolate_info:<v4l2src0> Extrapolated for plane 0 
with base stride 1920: stride 1920, offset 0
gst_v4l2_object_extrapolate_info:<v4l2src0> Extrapolated for plane 1 
with base stride 1920: stride 1920, offset 1382400

As you can see, the driver chose a stride for 1280x720 which is 1920. 
Then it pick a size that only fits the first plane. The selected stride 
is very suspicious in itself, I think it should have been 1280. If I do 
the math with that stride:

    sizeimage = 1280bytes * 720lines + 1280bytes * 360lines = 1382400

My conclusion is that this is a driver bug. I think v4l2-ctl simply 
write sizeimage to disk, ignoring the stride. As mplayer will assume a 
1280 stride, the playback just work, pointing that reported driver 
stride is not correct.

cheers,
Nicolas


More information about the gstreamer-devel mailing list