After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 726612 - avvidenc: add 'max-threads' property to control max. number of threads used when encoding video
avvidenc: add 'max-threads' property to control max. number of threads used w...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other All
: Normal enhancement
: 1.3.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-03-18 05:33 UTC by Gavin Hurlbut
Modified: 2014-05-19 14:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch file to create the thread-count parameter (3.50 KB, patch)
2014-03-18 05:34 UTC, Gavin Hurlbut
none Details | Review
Updated patch file (4.15 KB, patch)
2014-03-20 04:35 UTC, Gavin Hurlbut
committed Details | Review

Description Gavin Hurlbut 2014-03-18 05:33:06 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.
Comment 1 Gavin Hurlbut 2014-03-18 05:34:05 UTC
Created attachment 272243 [details] [review]
Patch file to create the thread-count parameter
Comment 2 Thijs Vermeir 2014-03-18 09:31:23 UTC
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).
Comment 3 Gavin Hurlbut 2014-03-18 17:38:48 UTC
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.
Comment 4 Gavin Hurlbut 2014-03-20 04:35:09 UTC
Updated patch attached.
Comment 5 Gavin Hurlbut 2014-03-20 04:35:56 UTC
Created attachment 272461 [details] [review]
Updated patch file
Comment 6 Tim-Philipp Müller 2014-05-19 14:09:57 UTC
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