Stream H265 to PC wih Gstreamer and OpenCV

Hello I’m trying to stream video (h265 encoded) from my Jetson module to PC.

I tried like this:

// Jetson NX code [224.1.1.1:5000]
					streamer.open(("appsrc ! videoconvert ! videoscale ! video/x-raw,format=I420,width=1080,height=720,framerate=30/1 ! videoconvert ! x265enc tune=zerolatency bitrate=2500000 speed-preset=superfast ! rtph265pay ! udpsink host = " + settings.stream.streamIp + " port = " + std::to_string(settings.stream.streamPort) + " auto-multicast=true sync=false").c_str(),
								  cv::CAP_GSTREAMER, 0, 30,
								  frame.size());
// PC code
					cap.open("udpsrc uri=udp://224.1.1.1:5000 auto-multicast=true ! application/x-rtp, media=video, encoding-name=H265 ! rtpjitterbuffer latency=0 max-dropout-time=100 ! rtph265depay ! decodebin ! videoconvert ! video/x-raw, format=BGR ! appsink sync=false",
                             cv::CAP_GSTREAMER);

And it’s working badly - framerate falls under 5FPS, and it sometimes just lags and stops receiving on my PC.
I changed Jetson to my Linux Computer, and stream Linux → Windows PC is working great so it indicates performance issues - Gstreamer commands are fine.

So I tried to change command on Jetson side to use Nvidia HW Acceleration:

// Jetson NX code [224.1.1.1:5000] with HW Acc
					streamer.open(("appsrc ! videoconvert ! videoscale ! video/x-raw,format=I420,width=1080, height=720,framerate=30/1 ! videoconvert ! omxh265enc ! udpsink host = " + settings.stream.streamIp + " port=" + std::to_string(settings.stream.streamPort) + " auto-multicast=true sync=false").c_str(),
								  cv::CAP_GSTREAMER, 0, 30,
								  frame.size());

and that seems to work (successfully opens and no errors show up), but I can’t receive that on PC - it doesn’t see that stream at all.

Is that stream really working, and if so, how do I receive it on my Windows PC?

Hi,
There are samples for UDP streaming. Please refer to the posts and give it a try:
Stream processed video with OpenCV on Jetson TX2 - #5 by DaneLLL
OpenvCV, Gstreamer, Python camera capture/access and streaming to RTP

Both links you provided are about H264, I already know how to stream the H264 video - I need info on how to stream and receive h265 encoding.

Hi,
For h265 encoding, please try

... ! nvv4l2h265enc ! h265parse ! rtph265pay pt=96 config-interval=1 ! ...

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