GNOME Bugzilla – Bug 726612
avvidenc: add 'max-threads' property to control max. number of threads used when encoding video
Last modified: 2014-05-19 14:10:11 UTC
The thread_count parameter in the internal libav structure was not being set to anything but 0 (use defaults). This leads to poor performance for some encoders such as MPEG2, so I have added a thread-count parameter to the libav encoders that is tied to this internal structure value.
Created attachment 272243 [details] [review] Patch file to create the thread-count parameter
Thx, for the patch. I would suggest the following changes: * Change property name to max-threads (consistency with libav decoders). * Conditionally add the property based on the capabilities of the encoder (also see libav decoders).
OK. I had it as thread-count as the internal variable is thread_count, but consistency is a good thing. I'll look at the decoder threading setting, but the thread_count is a common parameter internally for all decoders and encoders, although I guess some don't use it. I'll take a look at this this evening and see if I can't bend it around to your suggestions.
Updated patch attached.
Created attachment 272461 [details] [review] Updated patch file
Thanks for the patch. I've pushed it to master now: commit 38fc56e207516ca58451cc818ebfbb1b9e7e0ccd Author: Gavin Hurlbut <gjhurlbu@gmail.com> Date: Mon Mar 17 22:26:52 2014 -0700 avvidenc: Add thread-count parameter for libav encoders As some libav encoders (such as MPEG2) use a thread_count parameter to control how many threads to use, and since it was always being set to 0 (which uses the default), suboptimal threading can sometimes be chosen. This extends the libav encoders to allow for a max-threads parameter which is passed into the internal structure to control this knob if applicable to the encoder. https://bugzilla.gnome.org/show_bug.cgi?id=726612