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 652150 - [lamemp3enc] Lame encoder generates incorrect timestamps
[lamemp3enc] Lame encoder generates incorrect timestamps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other All
: Normal normal
: 0.10.20
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 652154 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-06-08 23:04 UTC by Matej Knopp
Modified: 2011-12-26 17:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initial patch (4.79 KB, patch)
2011-06-08 23:04 UTC, Matej Knopp
rejected Details | Review

Description Matej Knopp 2011-06-08 23:04:12 UTC
Created attachment 189507 [details] [review]
Initial patch

The encoder takes timestamp from input buffer and calculates the duration according to number of samples in input buffer and then sets these on output buffer.

This is wrong however as Lame output is always (unless flushed) shorter than the length of input buffer. Lame buffers certain number of samples, those will be outputted in next iteration, however the timesamp and duration on output buffer don't reflect this.

Attached a patch fixing this.
Comment 1 Matej Knopp 2011-06-09 08:31:00 UTC
I apologize for the formatting. I can upload correctly formatted patch on request.
Comment 2 Matej Knopp 2011-06-09 08:36:55 UTC
Also I'm not sure how well this works for VBR (I only tested it for CBR). On the other hand the current state is that timestamps are broken for both CBR and VBR.
Comment 3 Matej Knopp 2011-06-10 19:27:16 UTC
The patch only fixes timestamps with constant bitrate. I guess the proper solution is not to just try fix the timestamps but make sure that the encoder outputs entire frame instead of what it does now.
Comment 4 David Schleef 2011-07-04 06:39:56 UTC
The first step is to fix up what the lame library is creating, and push only properly framed buffers.  Timestamps for framed buffers are well-defined.
Comment 5 David Schleef 2011-07-14 21:07:37 UTC
Review of attachment 189507 [details] [review]:

Same as what I said in the previous comment.
Comment 6 David Schleef 2011-07-14 21:12:11 UTC
*** Bug 652154 has been marked as a duplicate of this bug. ***
Comment 7 Mark Nauwelaerts 2011-12-26 17:50:27 UTC
lame(mp3enc) has been ported to audioencoder by now, and following has lame(mp3enc) perform some parsing on lame library provided date to ensure framed output (which will then have meaningful and correct ts as arranged by audioencoder base class):

commit e21ba604a4205fd6bf58bfa040cf26ff1e56397b
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Mon Dec 26 18:23:52 2011 +0100

    lamemp3enc: ensure parsed output
    
    ... by doing some basic parsing of encoded lame data.
    
    Fixes #652150.