2

I have Kodak PIXPRO SP360 4k camera connected to the Jetson Nano or TX2 via USB cable.

I want to be able to see that video over browser, either with RTSP stream, Webrtc or something else. It doesn't matter how it works in terms of technology, as long as it works. So if you have any ideas or suggestions be free to share them.

I'm currently trying to run the basic setup.

./test-launch "nvarguscamerasrc ! video/x-raw(memory:NVMM), format=NV12, width=1920, height=1080, framerate=30/1 ! nvvidconv ! video/x-raw, width=640, height=480, format=NV12, framerate=30/1 ! omxh265enc ! rtph265pay name=pay0 pt=96 config-interval=1"

and

gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test ! queue ! decodebin ! videoconvert ! xvimagesink

and I'm getting the error saying

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://127.0.0.1:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not get/set settings from/on resource.
Additional debug info:
gstrtspsrc.c(6999): gst_rtspsrc_setup_streams_start (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
SDP contains no streams
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
(test-launch:22440): GLib-GObject-WARNING **: 11:36:46.018: invalid cast from 'GstRtpH265Pay' to 'GstBin'

(test-launch:22440): GStreamer-CRITICAL **: 11:36:46.018: gst_bin_get_by_name: assertion 'GST_IS_BIN (bin)' failed

(test-launch:22440): GLib-GObject-WARNING **: 11:36:46.018: invalid cast from 'GstRtpH265Pay' to 'GstBin'

(test-launch:22440): GStreamer-CRITICAL **: 11:36:46.018: gst_bin_get_by_name: assertion 'GST_IS_BIN (bin)' failed

(test-launch:22440): GLib-GObject-WARNING **: 11:36:46.018: invalid cast from 'GstRtpH265Pay' to 'GstBin'

(test-launch:22440): GStreamer-CRITICAL **: 11:36:46.018: gst_bin_get_by_name: assertion 'GST_IS_BIN (bin)' failed

I have also tried an option that worked for me on PC but I can't get it to work on Jetson. The setup goes as follows.

Download Streameye from https://github.com/ccrisan/streameye and run:

netcat -l 8700 | ./streameye -p 1337

To send the webcam stream I run:

gst-launch-1.0 v4l2src device=/dev/video0 ! decodebin ! videoconvert ! videoscale ! videorate ! jpegenc quality=30 ! tcpclientsink host=127.0.0.1 port=8700

After this I get:

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

Output of this command for my camera is:

v4l2-ctl -d /dev/video1 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'MJPG' (compressed)
    Name        : Motion-JPEG
        Size: Discrete 3840x2160
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 2880x2880
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 2048x2048
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 1440x1440
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 1920x1080
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 1280x720
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 640x360
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
Milos Milunovic
  • 422
  • 2
  • 5
  • 10

2 Answers2

1

run your pipe with -v like this and show me result:

gst-launch-1.0 v4l2src device=/dev/video0 ! decodebin ! videoconvert ! videoscale ! videorate ! jpegenc quality=30 ! tcpclientsink host=127.0.0.1 port=8700 -v
Babak Abgh
  • 11
  • 1
  • ``` Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error. Additional debug info: gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming stopped, reason not-negotiated (-4) ERROR: pipeline doesn't want to preroll. Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ... ``` – Milos Milunovic Nov 29 '19 at 09:36
  • Run with -v: add -v end of your pipeline, then run it. – Babak Abgh Nov 29 '19 at 09:52
  • It has -v at the end, and it returns this. I managet to run it with streameye but it says that jpeg is too large. I used this pipeline $ gst-launch-1.0 v4l2src device=/dev/video1 io-mode=2 ! image/jpeg,width=1280,height=720,framerate=30/1 ! nvjpegdec ! video/x-raw ! xvimagesink Also I figured out that that solution won't work for me, so I need to use gst-rtsp-server. – Milos Milunovic Nov 29 '19 at 13:12
  • if you want send rtp you can use this:gst-launch-1.0 v4l2src device=/dev/video0 ! rtpmjpegpay ! udpsink port=2000 host=127.0.0.1. your src ( v4l2src produce jpeg you don't have to convert to jpeg) – Babak Abgh Nov 29 '19 at 13:46
  • My video is 4k, 3840x2160. When I try to run, firstly I get: no element rtmpjpegpay. When I delete that part I get: WARNING: from element /GstPipeline:pipeline0/GstUDPSink:udpsink0: Attempting to send a UDP packets larger than maximum size (1554753 > 65507) Additional debug info: gstmultiudpsink.c(722): gst_multiudpsink_send_messages (): /GstPipeline:pipeline0/GstUDPSink:udpsink0: Reason: Error sending message: Message too long – Milos Milunovic Dec 02 '19 at 09:15
  • excuse me, gst-launch-1.0 v4l2src device=/dev/video0 ! rtpjpegpay ! udpsink port=2000 host=127.0.0.1 – Babak Abgh Dec 02 '19 at 16:48
1

If you want to stream it, the simplest way will be to use gst-rtsp-launch which is part of GStreamer prebuild binaries:

gst-rtsp-launch '( v4l2src device=/dev/video0 ! videoconvert ! queue ! x264enc tune="zerolatency" byte-stream=true bitrate=10000 ! rtph264pay name=pay0 pt=96 )'

Later on you can tune codec, bitrate, but for me this is enough (playable in VLC - rtsp://127.0.0.1:8554/test)

bialy
  • 193
  • 2
  • 14