I am using imx6q in kernel 4.9.88,which comes from https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-rocko -m imx-4.9.88-2.0.0_ga.xml.
I find the gst-1.0 have v4l2src is : imxv4l2rsrc and which has no "input" as Element Properties;
well I find others imxv4l2videosrc has the "input" element.
my question:
1:what is the diff between imxv4l2src and imxv4l2videosrc;
2:how can I add the imxv4l2videosrc to my gst-1.0;
已解决! 转到解答。
Sollutation:
Add imxv4l2videosrc to gstreamer1.0-plugin can successfully use "input=1" to choose "CSI-MEM" mode,and can get the currect raw data from capture(Using YUYV to simulate raw data format,because the raw data is larger than 1024 witdh...)
Sollutation:
Add imxv4l2videosrc to gstreamer1.0-plugin can successfully use "input=1" to choose "CSI-MEM" mode,and can get the currect raw data from capture(Using YUYV to simulate raw data format,because the raw data is larger than 1024 witdh...)
did you try "imxv4l2src device=$DEVICE ! $INPUT_CAPS" as I mentioned? $INPUT_CAPS should be set to "video/x-raw, format=(string)NV12, width=1920, height=1080,framerate=(fraction)30/1", you can set video/x-raw for raw data capture, pls try it first as I mentioned before, for new bsp, use this command, for more detailed information pls refer to the linux user guide
Fixed my drivers for video0. YUYV/960*480 ==>Get frame_buff_len 960*480*2.
Adding imxv4l2videosrc to gstreamer1.0-plugin,now can use pipeline.such as:
1)\gst-launch-1.0 imxv4l2videosrc device=/dev/video0 num-buffers=1 input=1 ! filesink location=frame.yuv
2)\gst-launch-1.0 imxv4l2videosrc device=/dev/video0 num-buffers=10 input=1 ! queue ! vpuenc_h264 ! queue ! mp4mux ! filesink location=frame.mp4
3)\gst-launch-1.0 imxv4l2videosrc device=/dev/video0 num-buffers=10 input=1 ! queue ! vpuenc_mpeg4 ! filesink location=frame.mp4
That's all OK. Now my question is:
In my drivers, when I fix format is YUV444(V4L2_PIX_FMT_YUV444),and gstreamer will occor err.My camera0 is raw data(1920*480). Why in my driver the format is just only for YUYV?
I don't know what format you add in your driver, if you mean format to vpu, only supports yuv420, if you mean format from camera, which depends what format your camera support, CSI can support yuv422 or yuv444, you need to check how your camera set
for vpuenc_mpeg4, you can use the command like gst-inspect-1.0 xxx to check if current gstreamer supports it or not
Thanks for your reply. We use /dev/video0 as parallel port 8-raw data 2000*480/25fps/csi-mem mode;
1、I tryd gstreamer1.0 with imxv4l2src as follows:
1)、gst-launch-1.0 imxv4l2src device=/dev/video0 ! video/x-raw,format=YUYV,width=640,height=480,framerate=25/1 ! overlaysink
2)、gst-launch-1.0 imxv4l2src device=/dev/video0 ! video/x-raw,format=NV12,width=640,height=480,framerate=25/1 ! overlaysink
3)、gst-launch-1.0 imxv4l2src device=/dev/video0 ! video/x-raw,format=NV12,width=640,height=480,framerate=25/1 ! overlaysink
4)、gst-launch-1.0 imxv4l2src device=/dev/video0 num-buffers=1 ! video/x-raw,width=2000,height=480 ! filesink location=frame.raw
5)、gst-launch-1.0 imxv4l2src device=/dev/video0 num-buffers=1 ! filesink location=frame.raw
all of before are err.such as the warning or error bellows.
WARNING: erroneous pipeline: could not link imxv4l2src0 to filesink0, imxv4l2src0 can't handle caps video/x-raw, width=(int)2000, height=(int)480
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstImxV4l2Src:imxv4l2src0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the fa.
2、Actrually,I have successfully get frame_buffer data from VIDIOC_DQBUF in my test code,without use gstreamer1.0. So I want to use gstreamer1.0 pipeline or appsrc to use imx-vpu/ipu,but no broken in the gstreamer1.0.I have also tryed appsrc,but also met "ERROR: v4l2 capture: mxc_v4l_dqueue() interrupt received" err.
Add imxv4l2videosrc to gstreamer1.0-plugin.I can get framebuffer using pipeline as follows:
"gst-launch-1.0 imxv4l2videosrc device=/dev/video0 num-buffers=1 input=1 ! video/x-raw,format=YUYV,width=2000,height=480,framerate=30/1 ! queue ! avimux ! filesink location=frame.avi"
or "gst-launch-1.0 imxv4l2videosrc device=/dev/video0 num-buffers=1 input=1 ! queue ! avimux ! filesink location=frame.avi"
Those all OK. My questions:
1、in my drivers for /dev/video0. YUYV/2000*480/25fps/csi-mem mode,the video0 is FPGA fake camera and output data is 2000*480. And I get frame_buffer leng is 2000*480*2 = 192000,is the reason for YUYV format?
2、How I can use gstreamer1.0 pipeline to use VPU?
"gst-launch-1.0 imxv4l2videosrc device=/dev/video0 num-buffers=1 input=1 ! queue ! vpuenc_h264 ! queue ! mp4mux ! filesink location=frame.mp4"
this to use VPU directorily will curese err:internel stream err.Shoud I first change queue from capture to YUV420? Using appsrc in codes?
root@Hzncc:/run/media/mmcblk1# gst-inspect-1.0 imxv4l2videosrc
No such element or plugin 'imxv4l2videosrc'
while gst-inspect-1.0 imxv4l2src is ok.
I want to know how can I add the v4l2src "imxv4l2videosrc" to my filesystem.
Really? Because I find imxv4l2videosrc has Element Properties such as "input"|"imx-capture-mode"|"crop".
and I should use "input=1" to select my videosrc.
Well imxv4l2src, I didnot find "input".
Any way to use "input=1" in imxv4l2src?
what does "input=1" stand for? you can use "imxv4l2src device=$DEVICE ! $INPUT_CAPS" to define your input source, $DEVICE can be video0 or video1, which depends on your own case, $INPUT_CAPS should be set to video/x-raw, format=(string)NV12, width=1920, height=1080,framerate=(fraction)30/1. this is an example, you can change the format, resolution and framerate
Thanks for your reply. "input" means Capture-V4L2 ioctl : VIDIOC_S_INPUT.
In imx6q input=0 means csi-ic-mem;input=1 means csi-mem.
Now I will use camera-raw-data,so I use input=1 to choose csi-mem.Well code has been ok,I want to use gstreamer1.0 pipeline to get frame data. How to use $INPUT_CAPS to ioctl-VIDIOC_S_INPUT?