Encode a video stream, and send the video stream over the network

Hi, @mdegans
I want to encode the video streaming using HW encoder of jetson nano, and then send over network with gstreamer + opencv in the efficient way. How I can to do that?


What do you want to view the video on? VLC or a web browser? VLC is probably easiest as the web option requires you to run some sort of web server to serve up the created files.

I want to send the outputs as RTSP and don’t matter show be in VLC or web browser, my final target is to record in NVR.


This is supported with deepstream_app, but I have never been able to figure out a working pipeline string to stream rtsp without using GstRtspServer (also what deepstream_app does) which is not a gstreamer element and can’t be used with VideoWriter.

The only “rtspsink” i know of that exists is a $1500 plugin by ridgerun. Note: there are RTP sinks included with gstreamer but it’s not the same as RTSP and may not work with your NVR.

If you want to see if you can find a working pipeline string, here might be a good google to start with. If you get an example working with a software encoder (eg x264enc) you can then swap it out for a hardware encoder like nvv4l2h264enc.

While workign on a recent social distancing project, we ended up using HLS (hlssink) for output to web, however, this probably won’t connect to an NVR. If your NVR supports other protocols, it might be easier. Streaming RTMP is relatively easy. tcpserversink and udpsink is likewise pretty easy, and vlc will play that.

Please refer to

You may replace matroskamux ! filesink with rtph264pay ! udpsink or mpegtsmux ! hlssink and try.

1 Like