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 630303 - theoraenc: Make the bitrate/quality dynamically modifiable
theoraenc: Make the bitrate/quality dynamically modifiable
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other All
: Normal normal
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-21 23:00 UTC by Olivier Crête
Modified: 2010-09-22 15:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
theoraenc: Make the bitrate/quality dynamically modifiable (5.14 KB, patch)
2010-09-21 23:00 UTC, Olivier Crête
committed Details | Review

Description Olivier Crête 2010-09-21 23:00:46 UTC
Theora allows changing the bitrate dynamically, here is a patch that implements that
in the GStreamer element. Here is a patch to do it.

Also, here is a small test case, I'm too lazy to write a real unit tests..

import gst

a = gst.parse_launch("videotestsrc is-live=1 ! video/x-raw-yuv, width=640, height=480, framerate=(fraction)30/1 ! theoraenc name=enc bitrate=50  !  appsink name=sink max-buffers=1")

enc = a.get_by_name("enc")
s = a.get_by_name("sink")

a.set_state(gst.STATE_PLAYING)

last = None
avg = None
for i in range(1, 600):
    if i != 0 and i % 60 == 0:
        enc.set_property("bitrate", i)
        avg = None
        print "SET TO ", i
    buf = s.emit("pull-buffer")
    if last and last != buf.timestamp:
        if avg:
            avg = (9*avg/10) +  (100 * 1000 * 8 * buf.size / (buf.timestamp - last))
        else:
            avg =  8 * 1000 * 1000 * buf.size / (buf.timestamp - last)
        print i, avg, buf.size
    last = buf.timestamp
Comment 1 Olivier Crête 2010-09-21 23:00:48 UTC
Created attachment 170798 [details] [review]
theoraenc: Make the bitrate/quality dynamically modifiable
Comment 2 Sebastian Dröge (slomo) 2010-09-22 08:23:03 UTC
Comment on attachment 170798 [details] [review]
theoraenc: Make the bitrate/quality dynamically modifiable

Looks good, please push
Comment 3 Olivier Crête 2010-09-22 15:41:52 UTC
Comment on attachment 170798 [details] [review]
theoraenc: Make the bitrate/quality dynamically modifiable

Committed:

commit 91f89f490cf9bab23f7eaab21273b4914cbf662d
Author: Olivier Crête <olivier.crete@collabora.co.uk>
Date:   Tue Sep 21 18:57:42 2010 -0400

    theoraenc: Make the bitrate/quality dynamically modifiable
    
    https://bugzilla.gnome.org/show_bug.cgi?id=630303