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 648144 - [vp8enc] Add more granularity to the speed levels
[vp8enc] Add more granularity to the speed levels
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-18 19:09 UTC by Andoni Morales
Modified: 2012-09-16 08:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-vp8enc-Add-more-granularity-to-the-speed-levels.patch (2.41 KB, patch)
2011-04-18 19:09 UTC, Andoni Morales
rejected Details | Review

Description Andoni Morales 2011-04-18 19:09:05 UTC
Created attachment 186225 [details] [review]
0001-vp8enc-Add-more-granularity-to-the-speed-levels.patch

The following patch uses the cpu_used parameter to add more granularity to the speed levels. Using the dummy test attached I get the following results:

speed=7 -> 17.34user 1.04system 0:08.25elapsed 222%CPU 
speed=6 -> 19.43user 1.24system 0:09.26elapsed 223%CPU 
speed=5 -> 23.92user 0.98system 0:12.39elapsed 200%CPU
speed=4 -> 42.06user 1.67system 0:14.59elapsed 299%CPU
speed=3 -> 48.77user 1.94system 0:19.36elapsed 261%CPU 
speed=2 -> 64.79user 2.71system 0:23.22elapsed 290%CPU
speed=1 -> 102.61user 4.62system 0:34.21elapsed 313%CPU
speed=0 -> 151.23user 6.52system 0:47.42elapsed 332%CPU
Comment 1 Andoni Morales 2011-04-18 19:12:45 UTC
The dummy test consists in running the following pipeline with the new range of speed levels:

time gst-launch filesrc location=/home/andoni/Vídeos/big_buck_bunny_720p_h264.mov num-buffers=1000 ! decodebin2 ! vp8enc speed=7 threads=4 ! fakesink
Comment 2 Sebastian Dröge (slomo) 2011-04-19 07:57:25 UTC
Combining the cpuused and speed parameters doesn't make that much sense IMHO. cpuused will only use parts of the available CPU resources while the other speed parameter will change the quality
Comment 3 Andoni Morales 2011-04-19 08:39:16 UTC
IMHO, speed and quality are directly related, as in every encoder, and for vp8 this value has a different meanings depending on the deadline used, but it affects quality by disabling several blocks of the encoding process to increase the speed.

For the BEST deadline, the cpu_used parameter can only take a value of 0, which combined with the infinite deadline, will let the encoder takes as much as it needs to encode a frame. It translates to "do all the steps and take all the time you need for it".

For the GOOD deadline, the cpu_used can take values from 0 to 5, disabling progressively blocks of the encoding process for each cpu_used level, with a very high deadline. It translates to "Do x blocks of the encoding process, but try to do them in before the deadline". 

For REALTIME, the cpu_used defines the target of cpu utilization and the number of steps done will be be changing dynamically depending on the complexity of a section and the resources available in a computer. It translates to "Do all the steps you targetting a x% of cpu usage"

At least this is what I understand from: http://www.webmproject.org/tools/encoder-parameters/#2_encode_quality_vs_speed
Comment 4 Andoni Morales 2011-04-19 08:43:58 UTC
Note that in the examples the only difference between the presets "1-Pass Good Quality VBR Encoding" and "1-Pass Fast VBR Encoding" is the cpu_used parameter (from 0 to 3)
Comment 5 Sebastian Dröge (slomo) 2011-04-20 07:17:43 UTC
Maybe we should simply expose all libvpx parameters directly, that will help people who look at the libvpx documentation to map them to GStreamer.
Comment 6 Andoni Morales 2011-04-20 17:14:20 UTC
In my opinion using presets for the speed property, as it's done for the x264 encoder, is probably a better option, rather than exposing all the available properties. At least this what I understood in https://bugzilla.gnome.org/show_bug.cgi?id=641729 regarding unifying the encoders properties.
But instead of a  simple range, we could have an enum with a brief description of each level.
Comment 7 Sebastian Dröge (slomo) 2011-04-21 15:18:30 UTC
I don't really know what's best here, sorry.

Maybe we should expose all encoder settings and use GstPreset for user-friendly presets, no idea
Comment 8 Andoni Morales 2011-10-19 14:00:58 UTC
Any feedback on this?
I think the proposed range covers most of the use cases, while the current one is hard to use for realtime encoding at high resolutions. It breaks the API, but the element is still in bad.
Comment 9 Oleksij Rempel 2012-04-11 17:56:24 UTC
I just found this change. May bad.
I'm not really agree with this change. For VPX_DL_BEST_QUALITY and VPX_DL_GOOD_QUALITY cpu usage do not really meter. It is not real time encoding.
Comment 10 Oleksij Rempel 2012-04-11 18:15:25 UTC
And any way it is not up to date. Current git use other, newer logick.
Comment 11 Sebastian Dröge (slomo) 2012-09-16 08:28:48 UTC
The speed property is no more, all the properties were reworked to be more in line with the upstream API and the vpxenc tool. What the speed property did can now be changed with the deadline and cpu-used properties.