gstreamer 1.19.3 CPU overhead for simple pipeline
Hi folks,
I'm running the same pipeline with two different versions of gstreamer
gst-launch-1.0 v4l2src ! videoconvert ! video/x-raw,format=I420, width=640, height=480, framerate=30/1 ! x264enc ! fakesink
And I'm getting very different CPU overhead.
The base system is ubuntu 20.04
with intel i7
processor.
The system also has an NVIDIA GPU:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.86 Driver Version: 470.86 CUDA Version: 11.4 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA T500 Off | 00000000:01:00.0 Off | N/A |
| N/A 47C P0 N/A / N/A | 1307MiB / 3914MiB | 36% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
Version A is from apt:
gst-inspect-1.0 version 1.16.2
GStreamer 1.16.2
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0
Version B was compiled from sources:
gst-inspect-1.0 version 1.19.3
GStreamer 1.19.3
Unknown package origin
Using the following script:
meson \
--buildtype=release \
-Dprefix=/usr \
-Dgpl=enabled \
-Dbad=enabled \
-Dugly=enabled \
-Dgst-plugins-base:gl=enabled \
-Dgst-plugins-bad:gl=enabled \
-Dgst-plugins-bad:nvcodec=enabled \
-Dtests=disabled \
-Dexamples=disabled \
-Dgst-examples=disabled \
build_dir
ninja -C build_dir
ninja -C build_dir install
Running the above pipeline has an overhead of 100% when B is used compared to A (i.e. B is using more CPUs).
Some hypothesis:
- we're building it without some optimisations;
- regression in 1.19.3;
- different default params for
x264enc
(although I checked and I can't see anything suspicious)