Improving performance of Gstreamer pipeline
zingfrid at gmail.com
Fri Jun 26 12:38:58 UTC 2020
For me, it sounds like, it does not have enough hardware resources. Can you
run 'top' upon 3x720p streams and with 2x1080p and compare results. One
more place, to look at is network bandwidth. Stated 100Mbps, not always
means that there are real 100Mbps.
On Fri, Jun 26, 2020 at 2:35 PM kaladin <pausanchez1998 at gmail.com> wrote:
> I'm developing a program based on Gstreamer and webrtc and I've finally got
> something that works, my issue now is improving it's performance.
> The program is divided in two parts, the first one gets the stream from a
> camera through rtsp-h264, this stream is processed through opencv (we
> implemented this manually copying the buffer to avoid appsrc/apsink
> bottlenecks when working with opencv) and then streams this video through
> The second part of the program is a websocket server that using webrtcbin
> grabs that udp stream and sends it to several clients. This was implemented
> using centicular's webrtc examples and libboost/beast for the websocket
> Right now, the first element can run a 1080p video at 30 stable fps
> perfectly fine, but when connecting the second element and trying to stream
> to clients it starts lagging and losing a lot of fps. The best stable
> performance we've archieved is a 720p video which remains stable at +20 fps
> for up to 3 clients.
> We'd like to archieve those 3 stable browser clients at least in 1080p but
> we've run out of ideas to improve the code. If any of you have an advice
> us that would be great! (both in stuff to improve and tools that might help
> us find the bottlenecks and fix them)
> All of this was done in an Nvidia Jetson TX2 with Jetpack 4.4, Opencv 4.1,
> CUDA 10.2 and Gstreamer 1.16.2
> I can't share the whole code but here's the main parts of it:
> This is part of the code that captures the rtsp stream, processes it (there
> isn't much processing in this segment but it would be there) and streams it
> through udp.
> This is the full code for the websocket protocol implementation and the
> webrtc stuff for sending to clients the udp stream.
> Both of them are in the code above but the pipelines used are the
> /"rtspsrc location=rtsp://192.168.0.153:8554/video ! queue ! rtph264depay
> video/x-h264, stream-format=byte-stream ! h264parse ! nvv4l2decoder !
> nvvidconv name=myconv ! video/x-raw(memory:NVMM), format=RGBA ! nvvidconv
> video/x-raw(memory:NVMM), format=NV12 ! nvv4l2vp8enc ! video/x-vp8 !
> rtpvp8pay ! udpsink host=22.214.171.124 port=5000 sync=false
> "udpsrc multicast-group=126.96.36.199 auto-multicast=true port=5000 ! queue !
> framerate=20/1 ! webrtcbin name=sendrecv";/
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gstreamer-devel