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 575736 - mpeg2enc's bitrate parameter does not work properly
mpeg2enc's bitrate parameter does not work properly
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.10
Other Linux
: Normal normal
: 0.10.12
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-17 19:06 UTC by gnucash
Modified: 2009-03-30 20:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description gnucash 2009-03-17 19:06:42 UTC
I attempted to reencode a 15-minute sample video using mpeg2enc.  I picked bitrate=3180 since the CableLabs VOD standard specifies 3180000 bits/s.  When I graphed the bit rate of the resulting stream the results were drastically wrong.  It started out good, but after a few seconds exploded to 15Mbits/s with spikes to 27Mbit/s.

I experimented with varying bit rates.  2750 Kbits/s worked for the entire 15-minute encoding.  2900 exploded near the end.  3000-3050 exploded in the middle, went sane later on, and exploded again at the end.


gst-launch-0.10 -v filesrc location=/var/tmp/The\ Drinky\ Crow\ Show\ -\ Tunnel\ Girls.mpeg ! decodebin name=db ! queue ! videoscale ! video/x-raw-yuv, width=352, height=480, pixel-aspect-ratio=1920/1056 ! mpeg2enc b-per-refframe=2 bitrate=2900  min-gop-size=15 max-gop-size=15 sequence-header-every-gop=true aspect=2 ! ttvpeswrapper silent=true ! filesink location=/var/tmp/x/dc.m2v  db.! queue  ! audioconvert ! ffenc_ac3 bitrate=192000 ! ttvpeswrapper silent=true stream-id=189 ! filesink location=/var/tmp/x/dc.ac3

I have a screenshot of one of the graphs here:

http://www.purplefrog.com/~thoth/x/bitrate=3050.png
Comment 1 gnucash 2009-03-17 19:37:54 UTC
I also noticed that the bitrate parameter does not use 1000bit kilobits, but instead uses 1024bit kilobits.

This is different from the conventions used in the broadcast industry and in the underlying standards documents.  mpeg2enc should probably use the same conventions as the relevant standards.
Comment 2 Mark Nauwelaerts 2009-03-30 20:11:12 UTC
mpeg2enc's rate control is rumoured to be fixed/improved in 1.9, but no warranty on that here.

On the other hand, the following takes care of some bitrate property setting:

commit d2f954636997b16343b40dfefd3ffb0fb00895a1
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Mon Mar 30 21:57:12 2009 +0200

    mpeg2enc: fix bitrate property settings

    Align bitrate property interpretation with usual mpeg2enc behaviour.
    Fixes #575736.