[gstreamer-bugs] [Bug 630303] New: theoraenc: Make the bitrate/quality dynamically modifiable
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Tue Sep 21 16:00:47 PDT 2010
https://bugzilla.gnome.org/show_bug.cgi?id=630303
GStreamer | gst-plugins-base | unspecified
Summary: theoraenc: Make the bitrate/quality dynamically
modifiable
Classification: Desktop
Product: GStreamer
Version: unspecified
OS/Version: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: gst-plugins-base
AssignedTo: gstreamer-bugs at lists.sourceforge.net
ReportedBy: tester at tester.ca
QAContact: gstreamer-bugs at lists.sourceforge.net
GNOME target: ---
GNOME version: ---
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
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the Gstreamer-bugs
mailing list