How to create a pipeline that reads from an imx device to a loopback sink

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to create a pipeline that reads from an imx device to a loopback sink

1,959 Views
cgregoir
Contributor I

I am on an imx devlopment board trying to run the following gstreamer pipeline after compling and load the v4l2loopback driver.


gst-launch-1.0 -v imxv4l2videosrc device=/dev/video2 ! video/x-raw ! v4l2sink device=/dev/video10

I get the following error.

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0.GstPad:src: caps = video/x-raw, format=(string)UYVY, width=(int)720, height=(int)480, interlace-mode=(string)interleaved, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1
Setting pipeline to PLAYING ...
New clock: GstSystemClock

(gst-launch-1.0:1875): GStreamer-CRITICAL **: Registering meta implementation 'GstImxV4l2Meta' without init function
ERROR: from element /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0: Internal data stream error.
Additional debug info:
../../../../gstreamer-1.12.4/libs/gst/base/gstbasesrc.c(2939): gst_base_src_loop (): /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.069415333
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

the version of the image i am using does not have the newest version of the imx gstreamer plugins that contains the imxv4l2videosink plugin. I am wondering, is there a way to make it work with the older version? Or possibly can i just build the updated gstreamer imx plugins without changing the rest of my image? I am using the 'pyro' branch of the yoco repo to build the base image.

In the end, I am trying to make my program stream to a lookback device so i can server the resulting video stream using the rtsp server like this

gst-variable-rtsp-server  -m "/stream" -p9099 -u "v4l2src device=/dev/video10 ! imxvpuenc_h264 name=enc0 ! rtph264pay name=pay0 pt=96 mtu=800"

If there is some other method that allows me to have custom code (proprietary) server up an rtsp server that would work to, this just seems to be the way i have found that will work thus far.

Thank you.

I am new to bit bake, yocto, and gstreamer, so if you need some specific version information about what i am using please let me know HOW to get that information to you. thanks!

Labels (3)
0 Kudos
2 Replies

1,371 Views
b36401
NXP Employee
NXP Employee

Here you can find a documentation regarding to gstreamer pipelines:

https://community.nxp.com/docs/DOC-93387

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,371 Views
cgregoir
Contributor I

I have been looking through the documentation, I just haven't been able to find the right combination of settings to make this work. I have started making use of the setting the GST_DEBUG environment variable to get more information about what is going on but have yet to figure out why I get invalid pixel format.

This works:

gst-launch-1.0 -v videotestsrc ! v4l2sink device=/dev/video10

and then I can run

gst-variable-rtsp-server  -m "/stream" -p9099 -u "v4l2src device=/dev/video10 ! imxvpuenc_h264 name=enc0 ! rtph264pay name=pay0 pt=96 mtu=800"

and I can see the test video on my dev machine no problem.

 

Now, what I can’t do is this

gst-launch-1.0 -v v4l2src device=/dev/video2 ! v4l2sink device=/dev/video10

 

I get this result:

Setting pipeline to PAUSED ...

Pipeline is live and does not need PREROLL ...

Setting pipeline to PLAYING ...

New clock: GstSystemClock

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.

Additional debug info:

../../../../gstreamer-1.12.4/libs/gst/base/gstbasesrc.c(2939): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

streaming stopped, reason not-negotiated (-4)

Execution ended after 0:00:00.001686666

Setting pipeline to PAUSED ...

Setting pipeline to READY ...

Setting pipeline to NULL ...

Freeing pipeline ...

 

So I tried this:

gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-raw, width=720, height=482 ! videoconvert ! video/x-raw, width=720, height=480 ! v4l2sink device=/dev/video10

 

and that does not work I get

0:00:00.707122000  2696  0x1daebc0 ERROR           GST_PIPELINE grammar.y:721:gst_parse_perform_link: could not link videoconvert0 to v4l2sink0, videoconvert0 can't handle caps video/x-raw, width=(int)720, height=(int)480

WARNING: erroneous pipeline: could not link videoconvert0 to v4l2sink0, videoconvert0 can't handle caps video/x-raw, width=(int)720, height=(int)480

 

But I run:

gst-launch-1.0 -v v4l2src device=/dev/video2 ! imxipuvideotransform ! imxvpuenc_h264 ! v4l2sink device=/dev/video10

I get :

 

Setting pipeline to PAUSED ...

libv4l2: error getting pixformat: Invalid argument

Pipeline is live and does not need PREROLL ...

0:00:00.646754666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2721:gst_v4l2_object_probe_caps_for_format:<v4l2src0> Unknown frame sizeenum type for pixelformat YUYV: 0

0:00:00.647608000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2721:gst_v4l2_object_probe_caps_for_format:<v4l2src0> Unknown frame sizeenum type for pixelformat UYVY: 0

Setting pipeline to PLAYING ...

0:00:00.648338333  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2721:gst_v4l2_object_probe_caps_for_format:<v4l2src0> Unknown frame sizeenum type for pixelformat RGBP: 0

0:00:00.648989333  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2721:gst_v4l2_object_probe_caps_for_format:<v4l2src0> Unknown frame sizeenum type for pixelformat YU12: 0

New clock: GstSystemClock

0:00:00.649932666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2721:gst_v4l2_object_probe_caps_for_format:<v4l2src0> Unknown frame sizeenum type for pixelformat YV12: 0

0:00:00.650628666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2721:gst_v4l2_object_probe_caps_for_format:<v4l2src0> Unknown frame sizeenum type for pixelformat BGR3: 0

0:00:00.651372666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2721:gst_v4l2_object_probe_caps_for_format:<v4l2src0> Unknown frame sizeenum type for pixelformat RGB3: 0

0:00:00.652496333  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at YUYV@48x32: 0

0:00:00.653049000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at UYVY@48x32: 0

0:00:00.653594000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at 422P@48x32: 0

0:00:00.654110000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at YU12@48x32: 0

0:00:00.654617000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at YV12@48x32: 0

0:00:00.655123000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at 411P@48x32: 0

0:00:00.655625000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at YVU9@48x32: 0

0:00:00.656136666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at YUV9@48x32: 0

0:00:00.656646333  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at JPEG@48x32: 0

0:00:00.657067666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at MJPG@48x32: 0

0:00:00.657510333  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at dvsd@48x32: 0

0:00:00.658000000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at RGB4@48x32: 0

0:00:00.658495000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at BGR4@48x32: 0

0:00:00.658979333  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at RGB3@48x32: 0

0:00:00.659468000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at BGR3@48x32: 0

0:00:00.659955000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at NV12@48x32: 0

0:00:00.660468000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at RGBQ@48x32: 0

0:00:00.660972666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at RGBP@48x32: 0

0:00:00.661527666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at RGBO@48x32: 0

0:00:00.662032000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at BA81@48x32: 0

0:00:00.662523666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at GBRG@48x32: 0

0:00:00.663010333  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at GRBG@48x32: 0

0:00:00.663504666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at RGGB@48x32: 0

0:00:00.663985000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at GREY@48x32: 0

0:00:00.664482666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at VP80@48x32: 0

0:00:00.664964000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at VC1L@48x32: 0

0:00:00.665455333  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at VC1G@48x32: 0

0:00:00.665944333  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at XVID@48x32: 0

0:00:00.666444333  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at MPG4@48x32: 0

0:00:00.666937000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at MPG2@48x32: 0

0:00:00.667425000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at MPG1@48x32: 0

0:00:00.667931666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at H263@48x32: 0

0:00:00.668416000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at AVC1@48x32: 0

0:00:00.668936666  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at H264@48x32: 0

0:00:00.669432000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at Y16 @48x32: 0

0:00:00.669924000  2707  0x1cc18c0 WARN                    v4l2 gstv4l2object.c:2492:gst_v4l2_object_probe_caps_for_format_and_size:<v4l2sink0> Unknown frame interval type at YVYU@48x32: 0

0:00:00.676629000  2707  0x1cc18c0 WARN          v4l2bufferpool gstv4l2bufferpool.c:546:gst_v4l2_buffer_pool_set_config:<v4l2src0:pool:src> libv4l2 converter detected, disabling CREATE_BUFS

/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)720, height=(int)480, pixel-aspect-ratio=(fraction)1/1, format=(string)I420, framerate=(fraction)30000/1001, interlace-mode=(string)interleaved, colorimetry=(string)bt601

/GstPipeline:pipeline0/GstImxIpuVideoTransform:imxipuvideotransform0.GstPad:src: caps = video/x-raw, width=(int)720, height=(int)480, framerate=(fraction)30000/1001, pixel-aspect-ratio=(fraction)1/1, format=(string)I420, interlace-mode=(string)interleaved

[INFO]  ringBufferEnable 0, chromaInterleave 0, mapType 0, linear2TiledEnable 1

[WARN]               VPU iram is less than needed, some parts don't use iram

/GstPipeline:pipeline0/GstImxVpuEncoderH264:imxvpuencoderh264-0.GstPad:sink: caps = video/x-raw, width=(int)720, height=(int)480, framerate=(fraction)30000/1001, pixel-aspect-ratio=(fraction)1/1, format=(string)I420, interlace-mode=(string)interleaved

/GstPipeline:pipeline0/GstImxIpuVideoTransform:imxipuvideotransform0.GstPad:sink: caps = video/x-raw, width=(int)720, height=(int)480, pixel-aspect-ratio=(fraction)1/1, format=(string)I420, framerate=(fraction)30000/1001, interlace-mode=(string)interleaved, colorimetry=(string)bt601

0:00:00.705404000  2707  0x1cc18c0 WARN          v4l2bufferpool gstv4l2bufferpool.c:759:gst_v4l2_buffer_pool_start:<v4l2src0:pool:src> Uncertain or not enough buffers, enabling copy threshold

0:00:00.818676666  2707  0x1cc18c0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1212:gst_v4l2_buffer_pool_dqbuf:<v4l2src0:pool:src> Driver should never set v4l2_buffer.field to ANY

/GstPipeline:pipeline0/GstImxVpuEncoderH264:imxvpuencoderh264-0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, parsed=(boolean)true, width=(int)720, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30000/1001, interlace-mode=(string)interleaved, colorimetry=(string)bt601, chroma-site=(string)jpeg

0:00:00.839281666  2707  0x1cc18c0 WARN                GST_PADS gstpad.c:4161:gst_pad_peer_query:<imxvpuencoderh264-0:src> could not send sticky events

 

But I can’t get the pipeline for that to play on the rtsp server side.

0 Kudos