AnsweredAssumed Answered

Problem with v4l2src and vpuenc

Question asked by Michael Banditt on Apr 14, 2014
Latest reply on May 22, 2014 by AURELIEN BOUIN



I have a quad-core imx6 board. Using Yocto master-next I am experiencing a strange problem with my video cam. The videocam is a Logitech C270.


What is working:


gst-launch v4l2src device=/dev/video0 ! mfw_v4lsink

working nicely, getting highest resolution, low fps, 20-30% CPU usage (one core).


gst-launch v4l2src device=/dev/video0 ! video/x-raw-yuv, width=640,height=480,framerate=25/1 ! mfw_v4lsink


working even better, lower resolution, but nice framerate, again about 20-25% CPU usage.


Now, when I try to encode the video, then I get problems:


gst-launch v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=640,height=480,framerate=25/1' ! queue max-size-buffers=2 ! vpuenc codec=6 ! matroskamux ! filesink location=output.mkv sync=false


Setting pipeline to PAUSED ...

[INFO]    Product Info: i.MX6Q/D/S

vpuenc versions

    plugin: 3.0.10

    wrapper: 1.0.45(VPUWRAPPER_ARM_LINUX Build on Mar 22 2014 11:51:52)

    vpulib: 5.4.20


ERROR: Pipeline doesn't want to pause.

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format

Additional debug info:

/home/michael/matrix-yocto/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer/0.10.36-r2/gstreamer-0.10.36/libs/gst/base/gstbasesrc.c(2830): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

Check your filtered caps, if any

Setting pipeline to NULL ...

Freeing pipeline ...


I can only get that to work if I add a 'ffmpegcolorspace' element after the v4l2src. This, however, gives directly more than 100% CPU usage. It works, but very inefficiently.


Now the question: Am I doing something wrong? How can I get the encode working with normal CPU usage?


Thanks for any help.