v4l2src with NV12: failed to map video frame
Frédéric Sureau
frederic.sureau at vodalys.com
Mon Feb 16 09:11:22 PST 2015
Hi !
I am trying to use a v4l2 capture device using v4l2src element.
The device supports YUY2 and NV12 formats, I can get some frames using
v4l2-ctl this way:
v4l2-ctl --device=/dev/v4l/by-path/platform-v4l2cap\@ipu1-video-index4
--set-edid edid=hdmi,pad=0 -i2
v4l2-ctl --device=/dev/v4l/by-path/platform-v4l2cap\@ipu1-video-index4
--set-dv-bt-timings index=4 -i2
v4l2-ctl --device=/dev/v4l/by-path/platform-v4l2cap\@ipu1-video-index4
--set-fmt-video=width=1280,height=720,pixelformat=NV12,field=none,bytesperline=1920
v4l2-ctl --device=/dev/v4l/by-path/platform-v4l2cap\@ipu1-video-index4
--stream-mmap --stream-to=/data/test.raw --stream-count=120
mplayer -idle -fixed-vo -demuxer rawvideo -rawvideo
fps=15:w=1280:h=720:format=nv12 test.raw
However, when I use GStreamer, it works fine with YUY2 format, but not
with NV12.
Here is what I get:
# gst-launch-1.0 -evvv v4l2src
device=/dev/v4l/by-path/platform-v4l2cap\@ipu1-video-index4 !
"video/x-raw,format=NV12,width=1280,height=720,framerate=50/1" ! fakesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps =
"video/x-raw\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)50/1\,\
width\=\(int\)1280\,\ height\=\(int\)720\,\
interlace-mode\=\(string\)progressive\,\
pixel-aspect-ratio\=\(fraction\)1/1"
New clock: GstSystemClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps =
"video/x-raw\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)50/1\,\
width\=\(int\)1280\,\ height\=\(int\)720\,\
interlace-mode\=\(string\)progressive\,\
pixel-aspect-ratio\=\(fraction\)1/1"
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps =
"video/x-raw\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)50/1\,\
width\=\(int\)1280\,\ height\=\(int\)720\,\
interlace-mode\=\(string\)progressive\,\
pixel-aspect-ratio\=\(fraction\)1/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps =
"video/x-raw\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)50/1\,\
width\=\(int\)1280\,\ height\=\(int\)720\,\
interlace-mode\=\(string\)progressive\,\
pixel-aspect-ratio\=\(fraction\)1/1"
0:00:00.302709667 1867 0x15779b0 ERROR default
/home/fred/Projets/vodabox3/poky/build/tmp/work/cortexa9hf-vfp-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/git-r0/git/gst-libs/gst/video/video-frame.c:147:gst_video_frame_map_id:
failed to map video frame plane 1
0:00:00.303003000 1867 0x15779b0 ERROR v4l2
/home/fred/Projets/vodabox3/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0-plugins-good/git-r0/git/sys/v4l2/gstv4l2bufferpool.c:159:gst_v4l2_buffer_pool_copy_buffer:<v4l2src0:pool:src>
could not map buffer
0:00:00.303208333 1867 0x15779b0 ERROR v4l2
/home/fred/Projets/vodabox3/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0-plugins-good/git-r0/git/sys/v4l2/gstv4l2bufferpool.c:1805:gst_v4l2_buffer_pool_process:<v4l2src0:pool:src>
failed to copy buffer
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
data flow error.
Additional debug info:
/home/fred/Projets/vodabox3/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/git-r0/git/libs/gst/base/gstbasesrc.c(2943):
gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason error (-5)
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Interrupt while waiting for EOS - stopping pipeline...
Execution ended after 0:00:01.943978000
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Any idea ?
Thanks
Fred
More information about the gstreamer-devel
mailing list