Cannot stream 1080p video using GStreamer and appsrc

Hi everyone,
I am using a C++ application with OpenCV on a Jetso Nano .
I want to stream live video from a camera with GStreamer. I use UDP to send the stream to a Windows PC.

This is my GStreamer pipeline on Jetson nano:

        "appsrc"
        " ! videoconvert"
        " ! video/x-raw,format=BGRx"
        " ! nvvidconv"
        " ! video/x-raw(memory:NVMM)"
        ", format=(string)NV12, width=1920,height=1080"
        " ! nvv4l2h264enc bitrate=8000000 maxperf-enable=true insert-sps-pps=true"
        " ! rtph264pay pt=96 config-interval=4"
        " ! udpsink host=192.168.178.203 port=8080"

The application feeds video into this pipeline:
cv::VideoWriter outstream
…
outstream.write(frame) ;

On PC, gst-launch1.0 is used with this pipeline:

gst-launch-1.0 -v
udpsrc port=8080
! application/x-rtp, payload=96
! rtph264depay
! video/x-h264,stream-format=(string)byte-stream,alignment=(string)nal
! h264parse ! avdec_h264
! autovideosink sync=false

Everything works well, if the “frame” (a cv::Mat), that is written to the pipeline, has a format like 1280x720 or smaller.
When I feed frames 1920x1080 into the pipeline, the receiver cannot correctly show the video. The pixel rows are samehow displaced and mixed up.

Strange enough, everything works fine when I use direct stream from camera on the Jetson:

gst-launch-1.0 -v tcamsrc ! tcamdutils ! video/x-raw,format=BGRx,width=1280,height=720,framerate=30/1 ! nvvidconv ! “video/x-raw(memory:NVMM),format=NV12” ! nvv4l2h264enc bitrate=8000000 maxperf-enable=1 insert-sps-pps=true ! rtph264pay pt=96 config-interval=4 ! udpsink host=192.168.178.203 port=8080

I cannot understand, where the difference should be.

I hope that someone can help, thank you in advance …

Hi,
We suggest adjust idrinterval and try again. The default value 256 may not be proper in streaming use-case. Please check
Gstreamer TCPserversink 2-3 seconds latency - #5 by DaneLLL

DaneLLL,
thank you for your response and sorry for late reply.
I can’t find idrinterval property:
erroneous pipeline: no property “idrinterval” in element "nvv4l2h264enc0
Neither gst-inspect nor “Accelerated GStreamer” documentation lists this property.

Solved.
The problem was in mis-configured OpenCV VideoWriter.

1 Like

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