Gstreamer command not working on Jetson Orin Nano while working on Jetson Nano

Device info:

v4l2-ctl -d0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'YUYV' (YUYV 4:2:2)
                Size: Discrete 384x288
                        Interval: Discrete 0.020s (50.000 fps)

Gstreamer command:

gst-launch-1.0 v4l2src device="/dev/video0" ! tee name=t ! queue ! v4l2sink device=/dev/video8 t. ! queue ! v4l2sink device=/dev/video9

this command is able to run on jetson nano but not on Jetson Orin Nano, it reports:

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:
gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.225181056
Setting pipeline to NULL ...
Freeing pipeline ...

Hello @dennis.zhang97,

Can you run the pipe with GST_DEBUG=3,GST_CAPS:5 ?

This might give us a bit more info.

regards,
Andrew
Embedded Software Engineer at ProventusNova

Sure, here is log file
gstreamer.log (75.6 KB)

Hello @dennis.zhang97,

Thanks for providing the output.
It seems like the pipeline is not being to negotiate the CAPS between v4l2src and the t element.
However, it might be cause because a compatibility issue between the caps of the 2 v4l2sink elements and the v4l2src itself.

Would it be possible for you to run the following tests?

  1. gst-launch-1.0 v4l2src device="/dev/video0" ! tee name=t ! queue ! fakesink t. ! queue ! fakesink
  2. gst-launch-1.0 v4l2src device="/dev/video0" ! tee name=t ! queue ! videoconvert ! v4l2sink device=/dev/video8 t. ! queue ! videoconvert ! v4l2sink device=/dev/video9
  3. gst-launch-1.0 v4l2src device="/dev/video0" ! videoconvert ! tee name=t ! queue ! v4l2sink device=/dev/video8 t. ! queue ! v4l2sink device=/dev/video9

Also, could you please provide the output of v4l2-ctl --list-formats-ext for video8 and video9 ?

regards,
Andrew
Embedded Software Engineer at ProventusNova

1 Like

All three commands executes successfully, I haven’t check the output result, but it should be fine, thank you very much!
FYI, video8&9 are virtual devices created by v4l2loopback

Hi @proventusnova,

One more thing to bother you, I have another gstreamer command works on Nano but not on Orin Nano also

gst-launch-1.0 nvarguscamerasrc sensor-id="0" !   'video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1' !   nvvidconv flip-method=0 !   'video/x-raw, width=1280, height=720, format=BGRx' !   queue ! videoconvert !   'video/x-raw, format=BGR' !   tee name=t !   queue ! v4l2sink device=/dev/video4 t. !   queue ! v4l2sink device=/dev/video5

It reports

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
(Argus) Error BadParameter:  (propagating from src/eglstream/FrameConsumerImpl.cpp, function initialize(), line 89)
(Argus) Error BadParameter:  (propagating from src/eglstream/FrameConsumerImpl.cpp, function create(), line 44)
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadInitialize:320 Failed to create FrameConsumer
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:241 (propagating)
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, waitRunning:203 Invalid thread state 3
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:806 (propagating)
Got EOS from element "pipeline0".
Execution ended after 0:00:00.092026816
Setting pipeline to NULL ...
Freeing pipeline ...

Full log can be found here:
gstreamer.log (131.5 KB)

Thank you in advance

It looks like it’s CAPS compatibility issue again but I did videoconvert this time

Hello @dennis.zhang97,

Great to hear that worked for you!

The problem with the last pipeline you share I believe has to do with the fact that you are trying to use nvarguscamerasrc to capture from /dev/video0, which according to your v4l2-ctl --list-formats-ext only provides YUYV which is an unsupported format by nvagurscamerasrc, which only supports NV12.

regards,
Andrew
Embedded Software Engineer at ProventusNova

Hi @proventusnova,

Sorry I forgot to mention that I replaced another camera, here’s its formats

v4l2-ctl -d0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'RG10' (10-bit Bayer RGRG/GBGB)
                Size: Discrete 3280x2464
                        Interval: Discrete 0.048s (21.000 fps)
                Size: Discrete 3280x1848
                        Interval: Discrete 0.036s (28.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 1640x1232
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.017s (60.000 fps)

And for that YUYV device, would you mind teaching me how to do munipulation like following python code using gstreamer? It would be really helping.

ret, frame = cap.read()
if ret:
    smallBits, bigBits = cv2.split(frame)
    image_16bits = cv2.scaleAdd(
        np.uint16(bigBits), np.uint16(256), np.uint16(smallBits)
    )
    image = cv2.normalize(image_16bits, None, 0, 255, cv2.NORM_MINMAX, dtype=cv2.CV_8U)

Hi @proventusnova

The above issue I fixed by Orin Nano error with IMX219 Camera - Jetson & Embedded Systems / Jetson Orin Nano - NVIDIA Developer Forums

Hi @dennis.zhang97,

Sounds good.

What is your end goal? What do you want to achieve with your NVIDIA Jetson system, just out of curiosity?

Also, do you have any other questions? Anything else we can help you with ?

regards,
Andrew
Embedded Software Engineer at ProventusNova

Hi @proventusnova
I still wonder if I can do the manipulation with gstreamer, thanks!
My end goal is using gstreamer split 2 different cameras into 4 streams(one camera for 2 streams), and using those streams to do some AI detection, I have done the imx219 one, I want to know if I can manipulate video with python code or same result using gstreamer.

Hello @dennis.zhang97,

If you need to run inference on a Jetson using GStreamer, I would suggest you to research Deepstream.

Now, to punctually answer your questions:

Yes, you can manipulate video with python code. You can use the appsink element with a GStreamer pipeline to get the buffers into python, grab them with OpenCV and do any processing you need.

There is also the option of writing your GStreamer plugin, which you can write even in python if you want, where you can have all your pre-processing logic.

regards,
Andrew
Embedded Software Engineer at ProventusNova

Hi @proventusnova,

Thanks a lot! I would search Deepstream and appsink, GStreamer plugin won’t be good choice for me since I am not familiar with C/C++ programming. Is there anything I can do to return your help? Maybe a cup of coffee or contributing to the community?

Hey @dennis.zhang97,

Sure, no problem!

Just as a quick hint, you can code GStreamer elements on Python too!! So you are not limited on that regard.

Also if at some point you need help coding your own GStreamer solution or working on other part of your project, please do not hesitate to reach out, we would love to help.

Last but not least, thanks a lot, its really nice of you to want to return the help. If you want to help us a bit, maybe you could helps us subscribing and sharing our LinkedIn page, its new and we are trying to grow our following:

https://www.linkedin.com/company/proventusnova/

regards,
Andrew
Embedded Software Engineer at ProventusNova

1 Like

Thanks! And sure I would subscribe your LinkedIn page and sharing it to my co-workers.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.