High/unreasonable CPU utilization when RTP loopback of video & audio streams together on the same machine.

Nicolas Dufresne nicolas at ndufresne.ca
Fri Jul 19 12:48:25 UTC 2019


Le mercredi 17 juillet 2019 à 23:32 -0500, jy a écrit :
> env: gstreamer-1.16, Windows 10, Dell XPS desktop, cpu: i7.
> 
> I'm running RTP video & audio tests.
> Both server & client are run on the same machine.
> video RTP with THEORA, audio RTP with OPUS
> 
> I notice that if running , cpu load observed with "top -c" command
>      video only, cpu load is about 17% total (server + client processes)
>      audio only, cpu load is about 3% total
>      video + audio together, cpu load jumps to 50%+ on server side (this is
> weird or wrong)
> 
> my test commands are as follow.
> 
> =========================================================
> **** This is video only test on same machine. cpu load ~17% total
> 
> server command   process cpu load ~14%
> gst-launch-1.0 ksvideosrc ! \
>               "video/x-raw,\
>                framerate=15/1,\
>                width=352,height=288" ! \
>                theoraenc  ! \
>                rtptheorapay config-interval=2 ! \
>                udpsink host="127.0.0.1" port=5555
> 
> client command:  process cpu load ~3%
> gst-launch-1.0  \
>                   udpsrc port=5555 ! \
>                  "application/x-rtp,media=video,clock-rate=90000,\
>                   encoding-name=THEORA" ! \
>                   rtpjitterbuffer latency=500 ! \
>                   rtptheoradepay  ! \
>                   queue ! \
>                   theoradec  ! \
>                   queue ! \
>                   videoconvert ! \
>                   autovideosink sync=false
> 
> =============================================================
> **** This is audio only test on same machine  cpu load ~3% total
> 
> 
> server command: process cpu load ~1.9%
> 
> gst-launch-1.0  \
>             wasapisrc ! \
>             audioconvert ! queue ! \
>             "audio/x-raw,format=S16LE,layout=interleaved,channels=2" ! \
>             opusenc ! \
>             "audio/x-opus, channels =2" ! \
>             rtpopuspay ! \
>             udpsink host="127.0.0.1" port=5560
> 
> 
> client command: process cpu load ~1%
> 
> gst-launch-1.0  \
>              udpsrc port=5560 ! \
>              "application/x-rtp,media=audio,clock-rate=48000," \
>              "encoding-name=OPUS,"\
>              "payload=96"  ! \
>              queue ! \
>              rtpopusdepay ! queue ! opusdec ! \
>              audioconvert ! audioresample ! autoaudiosink
> 
> 
> 
> ===================================================================
> **** This is video & audio run together on the same machine, cpu load jumps
> to 50%+
> ****                                                   
> 
> 
> server command: process cpu load ~49%
> 
> gst-launch-1.0 ksvideosrc device-name-partial="C270" ! \
>               "video/x-raw,\
>                framerate=15/1,\
>                width=352,height=288" ! \
>                theoraenc  ! \
>                rtptheorapay config-interval=2 ! \
>                udpsink host="127.0.0.1" port=5555  \
>                                                   \
>                wasapisrc device-name="TAND" ! \
>                audioconvert ! queue ! \
>                "audio/x-raw,format=S16LE,layout=interleaved,channels=2" ! \
>                opusenc ! \
>                "audio/x-opus, channels =2" ! \
>                rtpopuspay ! \
>                udpsink host="127.0.0.1" port=5560
> 
> 
> client command: process cpu load ~4%
> 
> gst-launch-1.0  \
>                   udpsrc port=5555 ! \
>                  "application/x-rtp,media=video,clock-rate=90000,\
>                   encoding-name=THEORA" ! \
>                   rtpjitterbuffer latency=500 ! \
>                   rtptheoradepay  ! \
>                   queue ! \
>                   theoradec  ! \
>                   queue ! \
>                   videoconvert ! \
>                   autovideosink sync=false \
>                                            \
>                   udpsrc port=5560 ! \
>                   "application/x-rtp,media=audio,clock-rate=48000," \
>                   "encoding-name=OPUS,"\
>                   "payload=96"  ! \
>                   queue ! \
>                   rtpopusdepay ! queue ! opusdec ! \
>                   audioconvert ! audioresample ! autoaudiosink
> 
> ==========================================================================
> 
> So, why the huge cpu load jump on server side, almost trippled, when both
> video & audio are run together?
> The internal thread overhead is causing problem?

Just run a system profiler, it will give you the bottleneck.

> 
> Please comment.
> 
> 
> 
> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190719/db76700a/attachment.sig>


More information about the gstreamer-devel mailing list