Hi NXP team,
We are use gstreamer on IMX8QX for stream multi camera with command pipeline
gst-launch-1.0 -v imxcompositor_g2d name=comp \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=320 sink_0::height=240 \
sink_1::xpos=320 sink_1::ypos=0 sink_1::width=320 sink_1::height=240 \
! v4l2jpegenc ! rtpjpegpay ! udpsink host=192.168.60.255 port=5000 \
v4l2src device=/dev/video3 ! "image/jpeg, width=3264, height=2448" \
! v4l2jpegdec ! imxvideoconvert_g2d \
! capsfilter caps="video/x-raw, width=320, height=240, pixel-aspect-ratio=1/1" ! comp.sink_0 \
v4l2src device=/dev/video5 ! "image/jpeg, width=3264, height=2448" \
! v4l2jpegdec ! imxvideoconvert_g2d \
! capsfilter caps="video/x-raw, width=320, height=240, pixel-aspect-ratio=1/1" ! comp.sink_1
This's command hasn't problem when run on shell, But when we need to develop in python code
Normally have function
(python:27527): GStreamer-CRITICAL **: 17:32:04.929: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
(python:27527): GStreamer-CRITICAL **: 17:32:05.081: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
gi.repository.GLib.Error: gst_parse_error: syntax error (0)
Do you have suggestion or how to convert pipeline command to python variable or not?
Regards
Thepnimit
Solved! Go to Solution.
Hi
Thank for suggest
Now we are found solution for streaming, The " (double quote) after source pipeline is main problem when delete, it's work
_pipeline = Gst.parse_launch("""imxcompositor_g2d name=comp
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=320 sink_0::height=240
sink_1::xpos=320 sink_1::ypos=0 sink_1::width=320 sink_1::height=240
! v4l2jpegenc ! rtpjpegpay ! udpsink host=192.168.60.255 port=5000
v4l2src device=/dev/video3 ! "image/jpeg, width=3264, height=2448"
! v4l2jpegdec ! imxvideoconvert_g2d
! capsfilter caps="video/x-raw, width=320, height=240, pixel-aspect-ratio=1/1" ! comp.sink_0
v4l2src device=/dev/video5 ! "image/jpeg, width=3264, height=2448"
! v4l2jpegdec ! imxvideoconvert_g2d
! capsfilter caps="video/x-raw, width=320, height=240, pixel-aspect-ratio=1/1" ! comp.sink_1""")
Thanks
Thepnimit
I can suggest to refer such common examples:
www.programcreek.com/python/example/88576/gi.repository.Gst.parse_launch
Hi
Thank for suggest
Now we are found solution for streaming, The " (double quote) after source pipeline is main problem when delete, it's work
_pipeline = Gst.parse_launch("""imxcompositor_g2d name=comp
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=320 sink_0::height=240
sink_1::xpos=320 sink_1::ypos=0 sink_1::width=320 sink_1::height=240
! v4l2jpegenc ! rtpjpegpay ! udpsink host=192.168.60.255 port=5000
v4l2src device=/dev/video3 ! "image/jpeg, width=3264, height=2448"
! v4l2jpegdec ! imxvideoconvert_g2d
! capsfilter caps="video/x-raw, width=320, height=240, pixel-aspect-ratio=1/1" ! comp.sink_0
v4l2src device=/dev/video5 ! "image/jpeg, width=3264, height=2448"
! v4l2jpegdec ! imxvideoconvert_g2d
! capsfilter caps="video/x-raw, width=320, height=240, pixel-aspect-ratio=1/1" ! comp.sink_1""")
Thanks
Thepnimit