[FFmpeg-devel] Problem with seeking in avi file.

Michael Niedermayer michaelni
Tue Aug 14 03:26:38 CEST 2007


On Sat, Aug 11, 2007 at 10:45:45AM +1000, Neil Brown wrote:
> I have another interesting movie file that ffmpeg doesn't quite work
> properly with.
> This one is an avi file containing dvvideo extracted off a digital
> camcorder (I can find out what program was used to exact it if that
> might be of interest).
> Anyway, the problem is that the first time that I seek into the file,
> if I aim for beyond 4:57, I alway arrive at 4:57.  Subsequent seeks
> work as expected.
> e.g.
>   ffmpeg -ss 400 filename.avi
> starts at 4:57, as does any number of seconds greater than 300.\
> The file starts with RIFF with a size of 1069618820.
> This covers about 1/4 of the file (5 minutes of about 20).
> There are 3 more RIFF headers of 1069611496, then
> one of 63795560 which completes the file.
> The file contains a 'dmlh' tag, so is_odml is set.
> The file contains a 'LIST' tag with a 'movi' subtag and a size of
> 1069467476.  This just covers the first of 5 RIFF sections.
> So ->movi_end gets set to 1/4 of the way through the file - the end of
> the first section.
> In avi_read_packet, after a seek further into the file,
> 'i' is the current position in the file, so this code:
>         if (i >= avi->movi_end) {
>             if (avi->is_odml) {
>                 url_fskip(pb, avi->riff_end - i);
>                 avi->riff_end = avi->movi_end = url_fsize(pb);
>             } else
>                 break;
>         }
> seeks back to the end of the first RIFF, then sets movi_end to the
> correct end of the file.
> It seems to me that if 'odml' allows as to set movi_end to fsize at
> this point, it should allow movi_end to be set to fsize right at the
> start.

yes, setting it to fsize is wrong no matter where its done, it breaks
the code quoted above should be removed its broken
you seem pretty good at spotting totally broken code :)
ill try to fix this one ...


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070814/5464adb6/attachment.pgp>

More information about the ffmpeg-devel mailing list