High cpu usage!

Hello guys,

I’m currently running the following GStreamer pipeline to mix two VP8 video streams and play audio.

The problem is that the CPU usage is kind of high, likely because of decoding, scaling, and compositing VP8 streams in software.

Does anyone have suggestions or tweaks to minimize CPU usage while doing this? Any tips for optimizing this pipeline would be greatly appreciated.

gst-launch-1.0 \
    compositor name=mix \
        sink_0::xpos=0 sink_0::ypos=0 sink_0::width=640 sink_0::height=360 \
        sink_1::xpos=640 sink_1::ypos=0 sink_1::width=640 sink_1::height=360 ! \
    video/x-raw,width=1280,height=360 ! \
    autovideosink sync=false \
    \
    udpsrc port=5010 caps="application/x-rtp,media=video,clock-rate=90000,encoding-name=VP8" ! \
    rtpjitterbuffer drop-on-latency=true ! \
    rtpvp8depay ! vp8dec ! videoconvert ! videoscale ! \
    video/x-raw,width=640,height=360 ! mix.sink_0 \
    \
    udpsrc port=5012 caps="application/x-rtp,media=video,clock-rate=90000,encoding-name=VP8" ! \
    rtpjitterbuffer drop-on-latency=true ! \
    rtpvp8depay ! vp8dec ! videoconvert ! videoscale ! \
    video/x-raw,width=640,height=360 ! mix.sink_1 \
    \
    udpsrc port=5014 caps="application/x-rtp,payload=111" ! \
    rtpjitterbuffer drop-on-latency=true ! \
    rtpopusdepay ! opusdec ! \
    audioconvert ! \
    autoaudiosink

You may say if you have multiple CPUs and if the CPU usage is one core only. With Linux, tools like htop would show that. In such case, you may try adding a queueelement before each compositor’s mix.sink.

Furthermore, if you have a specific target HW, you may also investigate if this one provides HW VP8 decoder or HW converter or HW scaler.