Opened 9 years ago

Closed 9 years ago

#1625 closed defect (fixed)

AVI playback truncated

Reported by: rectalogic@… Owned by: r_togni@…
Priority: normal Component: demuxer
Version: HEAD Severity: normal
Keywords: Cc: reimar
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:

Description

Playing this AVI with r30311 now gets a warning:

Badly interleaved AVI file detected - switching to -ni mode...

And playback ends early (after 4746 frames)

This worked back in svn r30058, it did not get the interleaved error and played all 8775 frames.

Sample AVI uploaded to incoming/interleaved-truncated/interleaved-truncated.avi

Log for svn r30311, gets warning and plays 4746 frames:

MPlayer SVN-r30311-4.2.1 (C) 2000-2009 MPlayer Team

Playing /Volumes/Passport?/dataset/AVI--SEDG-adpcm-279342-89a7af1baa40d107.AVI.
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
Could not determine number of frames (for absolute seek).
VIDEO: [SEDG] 720x480 24bpp 29.970 fps -17179870.0 kbps (-2097152.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 22050 Hz, 2 ch, s16le, 177.0 kbit/25.09% (ratio: 22125->88200)
Selected audio codec: [ffadpcmimawav] afm: ffmpeg (FFmpeg WAV IMA ADPCM audio)
==========================================================================
AO: [coreaudio] 22050Hz 2ch s16le (2 bytes per sample)
Starting playback...
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.50:1 - prescaling to correct movie aspect.
[swscaler @ 0x1008a1760]BICUBIC scaler, from yuv420p to yuyv422 using MMX2
VO: [corevideo] 720x480 => 720x480 Packed YUY2
[ASPECT] Warning: No suitable new res found!
A: 157.2 V: 42.9 A-V:114.260 ct: 4.291 1288/1288 11% 3% 0.4% 2 0
Badly interleaved AVI file detected - switching to -ni mode...
A: 292.6 V: 158.3 A-V:134.273 ct: 15.833 4746/4746 11% 2% 0.2% 2 0

Exiting... (End of file)

Log for svn r30058, no warning and plays all 8775 frames:

MPlayer mbox-git-mbox/3.8.1-f0f6523f6605075f445552c72c82da54a7670f37-4.2.1 (C) 2000-2008 MPlayer Team
Playing /Volumes/Passport?/dataset/AVI--SEDG-adpcm-279342-89a7af1baa40d107.AVI.
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
Could not determine number of frames (for absolute seek).
VIDEO: [SEDG] 720x480 24bpp 29.970 fps -17179870.0 kbps (-2097152.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 22050 Hz, 2 ch, s16le, 177.0 kbit/25.09% (ratio: 22125->88200)
Selected audio codec: [ffadpcmimawav] afm: ffmpeg (FFmpeg WAV IMA ADPCM audio)
==========================================================================
AO: [coreaudio] 22050Hz 2ch s16le (2 bytes per sample)
Starting playback...
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.50:1 - prescaling to correct movie aspect.
[swscaler @ 0x89fea0]BICUBIC scaler, from yuv420p to yuyv422 using MMX2
VO: [corevideo] 720x480 => 720x480 Packed YUY2
[ASPECT] Warning: No suitable new res found!
A: 292.8 V: 292.8 A-V: -0.005 ct: -0.004 8775/8775 12% 2% 0.2% 0 0

Exiting... (End of file)

Change History (5)

comment:1 Changed 9 years ago by reimar

Your real problem is this:
A: 157.2 V: 42.9 A-V:114.260 ct: 4.291 1288/1288 11% 3% 0.4% 2 0

Something causes your video to play insanely slow.
The warning is not really relevant, the AVI demuxer juts switches mode in order to continue playing with video so massively out of sync.
Or is there no actual desync? In either way, try -mc 100 and -demuxer lavf to compare.

comment:2 Changed 9 years ago by rectalogic@…

It's hard to tell if there are sync issues because the audio is basically wind noise.

My real problem is only half the video is decoding before mplayer exits. I'm also using mencoder, and so I'm only able to transcode half of this file.

Previously mplayer r30058 would decode the entire file without problems or sync issues:
A: 292.8 V: 292.8 A-V: -0.005 ct: -0.004 8775/8775 12% 2% 0.2% 0 0

-demuxer lavf in current svn also decodes the entire file without sync issues:
A: 292.8 V: 292.8 A-V: 0.006 ct: -0.016 0/ 0 11% 2% 0.2% 0 0

So apparently something changed in mplayer avi demuxer between r30058 and r30311, and it now loses sync and only decodes half the file.

When I play the file with r30311 and -msglevel all=9, part way through it seems like the avi demuxer runs out of audio data, due to the sync issue I guess. But why didn't r30058 have any issues with sync?

[...]
* ftime=0.033 *
delay=1.021678
ds_fill_buffer(d_audio) called
seek to 0x694678C
ds_fill_buffer()->demux_fill_buffer() failed
ds_fill_buffer: EOF reached (stream: audio)
ds_fill_buffer(d_video) called
vd_ffmpeg data: b6010000, 8bb89d93, 8b162d22, b9018745
using IPB
* ftime=0.033 *
ds_fill_buffer(d_audio) called
seek to 0x694678C
s->pos=6948F10 newpos=6946000 new_bufpos=694678C buflen=0
stream_seek: WARNING! Can't seek to 0x694678C !
ds_fill_buffer()->demux_fill_buffer() failed
ds_fill_buffer: EOF reached (stream: audio)
ds_fill_buffer(d_video) called

[...repeats for every frame...]

comment:3 Changed 9 years ago by rectalogic@…

Ahh, I reverted commit r30130, that added support for parsing audio streams, and now this file plays fine with no sync or truncation issues. So there must be a bug somewhere in that commit.

comment:4 Changed 9 years ago by reimar

Actually audio decoding is completely broken with the native demuxer, which is what causes the desync. No idea about the exact reason (except that as you noticed it is probably related to the parsing code).

comment:5 Changed 9 years ago by reimar

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in SVN r30314.
And it would be better if you didn't upload 100 MB if the problem can be reproduced with just the first MB of the file cut out.

Note: See TracTickets for help on using tickets.