GNOME Bugzilla – Bug 696501
avdec: better multi-threaded decoding performance for live pipelines where downstream does not sync to clock
Last modified: 2018-11-03 12:55:53 UTC
Currently we always use FF_THREAD_SLICE mode for multithreaded H.264 decoding. This mode requires encoder support, so multiple threads will only be used if the H.264 video is encoded in a suitable way (i.e. with multiple slices per frame). This is not necessarily the case, and where this is not the case decoding will be done in a single thread only, hampering performance. We should use FF_THREAD_SLICE only for live pipelines where latency is important, and use FF_THREAD_FRAME for decoding scenarios where latency does not matter, to make sure we actually use multiple threads for decoding if possible.
See also https://bugs.freedesktop.org/show_bug.cgi?id=56206
As I noted on the SDK bug, we should add some way to communicate application-specific latency requirements throughout the pipeline, allowing anything but zero-latency decoders for live RTP pipelines also means solving the variable framerate problem!
Ok, but I don't think this bug depends in any way on the app being able to communicate latency requirements, does it? Since we're starting from a minimal-latency-not-very-efficient scenario, simply switching to FF_THREAD_FRAME for non-live pipelines should always be acceptable, no? Then also switching to FF_THREAD_FRAME for live pipelines where the latency requirements are > N frames with N=max-cores (or so) would be an added bonus.
*** Bug 663617 has been marked as a duplicate of this bug. ***
As Olivier noted on IRC a while ago, we can switch to FF_THREAD_FRAME for better performance not only if upstream is not live, but also if nothing downstream syncs to the clock (though we don't have a way to query that yet).
*** Bug 697690 has been marked as a duplicate of this bug. ***
Isn't that fixed now with http://cgit.freedesktop.org/gstreamer/gst-ffmpeg/commit/?id=2d2c9b1aac6f2fa3a1a7c8a9ed46b76cefe228c8
> Isn't that fixed now with 2d2c9b1a ? No, I think there are still some cases we're missing which could be improved, see comment 5: we can use FF_THREAD_FRAME even if upstream is live, as long as downstream does not sync to the clock.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/9.