[Vorbis-dev] How to get the actual bitrate?

Mathias Kunter mathiaskunter at yahoo.de
Tue Jan 26 04:00:42 PST 2010


Hello,

I've also implemented it the way Silvia said. However, is there a better (or faster) way of finding the last Ogg page in a stream than scanning the last 64 K (which is the maximum possible page size) of the stream for a page header capture pattern?

Thanks,
Mathias K.





________________________________
Von: Silvia Pfeiffer <silvia at silvia-pfeiffer.de>
An: Lucas Clemente Vella <lvella at gmail.com>
CC: vorbis-dev at xiph.org; 揭磊平 <jxren0626 at 163.com>
Gesendet: Dienstag, den 26. Januar 2010, 7:47:29 Uhr
Betreff: Re: [Vorbis-dev] How to get the actual bitrate?

On Tue, Jan 26, 2010 at 2:17 PM, Lucas Clemente Vella <lvella at gmail.com> wrote:
> 揭磊平 escreveu:
>> Dear all:
>>   I'm a developer in china, and i really want to know how to calculate a ogg audio file's bitrate and then i can get the duration by file size.
>>   thanks very much for your answer.
>
> See, most of ogg vorbis files have variable bitrate, so the way to
> calculate its mean bitrate -- the only significant bitrate when speaking
> of the whole stream -- is size/duration, what imply you must know the
> duration beforehand.
>
> I'm afraid you can't know the duration of the stream by just looking at
> the file size, since even libvorbis must be able to seek through the
> stream to be able to determine it's duration.

You can seek to the last page, decode the granulepos and calculate the
duration from that.

Cheers,
Silvia.
_______________________________________________
Vorbis-dev mailing list
Vorbis-dev at xiph.org
http://lists.xiph.org/mailman/listinfo/vorbis-dev


__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20100126/99d5ac52/attachment.htm 


More information about the Vorbis-dev mailing list