[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec oggvorbis.c,1.20,1.21

Justin Ruggles jruggle
Sun Sep 4 02:24:52 CEST 2005


Hey,

Rich Felker wrote:
> What does granule position have to do with this? It's vorbis, not ogg..

The vorbis encoder actually produces ogg packets, then strips the vorbis
packets from them to pass to the muxer.  The vorbis encoder stores the
granule position from the ogg packets received by libvorbis to the
vorbis frame->pts field.  The granulepos is given in samples. From what
I can tell, FFmpeg does some scaling between the codec timebase and
stream timebase to set the pkt->pts value.  It looks like Ogg expects
vorbis to have a timebase equal to 1/samplerate and tries to scale it
back to the original granulepos.

So, you are right that the ogg issue is somewhat separate.  But if
vorbis doesn't set the codec time_base to the samplerate, the ogg
encoder should be modified to not scale the pkt->pts so it gives correct
output.  Or maybe scale it by the actual codec time_base instead of
assuming it's 1/samplerate.

-Justin





More information about the ffmpeg-cvslog mailing list