playbin, avdec_h264, threads and memory use

Gordon Nickel gordon.nickel at
Wed Oct 14 09:48:35 PDT 2015


I've noticed some interesting behaviour when playing back h.264 files. On systems with just a few cores (4-6), memory use is high, but reasonable (400-500 mb for 4k video), but on newer systems with 8-12 cores and hyperthreading enabled, we're seeing very high memory use (1.4 GB) which eventually leads to a memory allocation excpetion in glib (likely due to memory fragmentation).

The symptom can be replicated in gst-launch by varying the max-threads of avdec_h264:
gst-launch-1.0.exe filesrc location=c:/test.mp4 ! qtdemux ! h264parse ! avdec_h264 max-threads=6 ! autovideosink

For each additional thread we're seeing additional memory allocated to gst-launch.

However, we'd like to continue using playbin (instead of that pipeline above) to more easily support more types of video. Is there a way to limit the number of threads and/or memory used by avdec_h264 through playbin?

Here's a quick overview of our systems:
Gstreamer 1.6.0
Windows 7
Xeon Processors - 6-12 cores, some with hyperthreading enabled
12-16GB ram
playbin -> appsink -> custom openGL shader pipeline
720p - 4k video, usually h.264, sometimes prores or other formats

Gordon Nickel
Lead Developer

1624 NW Johnson Street
Portland, OR 97209, USA

503.226.1944 main
503.226.1283 fax

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list