[FFmpeg-devel] [PATCH] avformat/oggparseopus: fix segmented timestamps

Mark Harris mark.hsj at gmail.com
Sat Jan 4 23:37:09 CET 2014


On Sat, Jan 4, 2014 at 12:57 PM, Michael Niedermayer <michaelni at gmx.at>wrote:

> On Sat, Jan 04, 2014 at 12:19:41PM -0800, Mark Harris wrote:
> > On Sat, Jan 4, 2014 at 11:59 AM, Michael Niedermayer <michaelni at gmx.at
> >wrote:
> >
> > > On Tue, Dec 31, 2013 at 11:04:54AM -0800, Mark Harris wrote:
> > > > Fix timestamp calculation for code 3 Ogg Opus packets with less than
> > > > 2 bytes in the last segment (e.g. packet length 255 or 256).
> > > > A sample that would seek incorrectly in ffplay can be created with:
> > > >   ffmpeg -i in.wav -b:a 34k -vbr off -frame_duration 60 out.opus
> > >
> > > i dont seem to be able to reproduce the issue even though it seems
> > > i did have a in.wav file in my local directory. Or maybe iam trying
> > > the wrong things with the generated file
> > >
> > >
> > The input audio doesn't matter as long as you can distinguish beginning,
> > middle, and end (so don't use "sine" or a similar source).  It's the
>
> ive used a 3 minute long piece of music (48khz stereo), seeking to the
> middle works fine before this patch in ffplay.
> That said i see that the code was wrong before. iam just trying to
> understand how to reproduce this issue
>
>
You can use: http://opus-codec.org/examples/samples/music_orig.wav

Be sure to use a current libopus (1.1).  I think that CBR in older
versions was not as precise.

 - Mark


>
> > particular Opus packet sizes that cause the problem; encoding anything
> > to 34kb/s CBR with 60ms frame duration will trigger the issue.
> > Without the patch, "ffplay out.opus" and clicking in the middle of the
> > window to seek to the middle will seek to the end instead, due to
> > incorrect timestamps.
>


More information about the ffmpeg-devel mailing list