[Bug 692368] New: VBR mp3 files - query position not accurate

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Jan 23 02:31:15 PST 2013


https://bugzilla.gnome.org/show_bug.cgi?id=692368
  GStreamer | gst-plugins-ugly | 0.10.36

           Summary: VBR mp3 files - query position not accurate
    Classification: Platform
           Product: GStreamer
           Version: 0.10.36
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-ugly
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: hans at oesterholt.net
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Currently I'm working on support for the banshee mediaplayer for playing of
audio (also vbr mp3) files using cuesheets, i.e. one large audio file with an
index of the tracks. This is great for e.g. classical music or livesets. 

In order to support random play or playlists, I need to seek at the right
moment, to another position. This can only be done accurately, when the current
position is accurately reported. This is done for CBR files, but not for VBR
files. 

However, it should be possible to report an accurate position in time for a VBR
mp3 file using gst_element_query_position(). If the plugin knows at what frame
it is in the mp3 file, it can be calculated easy, but the mp3 plugin doesn't
work like that. I think it estimates the time using the current byte position
in the file * the average bitrate, something like that. This works for CBR
files, but not accurate for VBR files. It mostly underestimates the time
passed. So songs are ended to quickly.

However. All frames in an mp3 file are 26ms in length. See
http://www.mp3-converter.com/mp3codec/frames.htm

So also for a VBR file it must be possible to calculate the corrent current
position, if you know the current frame that is being processed.
CurrentFrameNumber*26 would be the current position in ms.

-- 
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