GNOME Bugzilla – Bug 703955
osxvideosink: High CPU load
Last modified: 2017-07-28 20:20:31 UTC
I found that osxvideosink eats too much of CPU even with quite simple pipelines. For instance, videotestsrc pipeline like this: gst-launch-0.10 videotestsrc ! video/x-raw-yuv,width=1920,height=1080,framerate=\(fraction\)25/1 ! osxvideosink gives 70% of CPU load and unfortunately the main impact is from glTexSubImage2D() GL method which I don't know how to optimize.
osxvideosink should a) support more color formats and b) implement some kind of zerocopy rendering. However ideally osxvideosink will be deprecated in favor of glimagesink from gst-plugins-gl soonish
Yes, that's right. Previously I've experimented on cocoawindow code trying to improve its performance and add some more color formats (as, e.g. after avdec_h264 it requires colorspace convertion with no direct path which eats some 5% to my estimations IIRC). There's one redundant memcpy() of every frame but it seems to not impact the overall performance significantly. Apart from that, I see no way to optimize the performance other than use more modern method of displaying video with OpenGL, with which I'm not that big expert, unfortunately. So as to color convertion, which obviously can be implemented with some shader. I agree that given gst-plugins-gl is almost around the corner it's better to put these things to it, if not already implemented there. I still didn't have a chance to try gst-plugins-gl on Mac OS X and use osxvideosink for video output, but hopefully will do it in some time or the next time osxvideosink would require any fixes.
Is osxvideosink something we want to maintain ? If yes feel free to re-open this bug, thx!