Opened 12 years ago

Closed 12 years ago

#1003 closed defect (fixed)

matroska file hits eof after any seek

Reported by: DonMoir Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mkv
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

This file is probably a "bad" file.

http://sms.pangolin.com/temp/bad_seek_matroska_eof.mkv (103 mb)

VLC can seek into it effectively but it will end up breaking down with distorted frames.

ffdshow can seek into it but it is very slow.

Use avformat_seek_file at any timestamp including zero and the next packet read will fail.

avformat_seek_file returns zero as an indication of success.

The only recovery is to shut the file down and reopen it.

Any seek with ffplay, smplayer, my own app, just stops playback (because it will hit EOF) and you can't get out of it without closing the file.

If nothing else can be done about it, then at least a failure by avformat_seek_file would be good as long as it was able to continue to playback.

no errors reported by ffplay or ffmpeg. If you do ffmpeg -ss 10... it will claim nothing was encoded.

ffplay bad_seek_matroska_eof.mkv

ffplay version N-37771-gfd0b8d5 Copyright (c) 2003-2012 the FFmpeg developers

built on Feb 11 2012 13:42:37 with gcc 4.6.2

libavutil 51. 39.100 / 51. 39.100
libavcodec 54. 1.100 / 54. 1.100
libavformat 54. 0.100 / 54. 0.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 62.100 / 2. 62.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 6.100 / 0. 6.100
libpostproc 52. 0.100 / 52. 0.100

Input #0, matroska,webm, from 'bad_seek_matroska_eof.mkv':

Metadata:

title : Backstreet.Boys.Live.From.O2.Arena.2008.HDTVRip.1080p.-VoLoNa by HDTVshek.HET

Duration: 00:01:50.84, start: 0.000000, bitrate: 7683 kb/s

Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9],

23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)

Metadata:

title : Backstreet.Boys.Live.From.O2.Arena.2008.HDTVRip.1080p.-VoLoNa

Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), s16, 384 kb/s (default)
Metadata:

title : AC3 5.1@384Kbps

17.00 A-V: 0.035 fd= 13 aq= 0KB vq= 0KB sq= 0B f=0/0 f=0/0

Change History (3)

comment:1 by Carl Eugen Hoyos, 12 years ago

Keywords: mkv added
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

Fails differently if the file is cut.
Sample uploaded to http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket1003/

$ ffmpeg -ss 1 -i bad_seek_matroska_eof.mkv out.avi
ffmpeg version N-37956-gd493170 Copyright (c) 2000-2012 the FFmpeg developers
  built on Feb 17 2012 19:42:03 with gcc 4.5.3
  configuration: --cc=/usr/local/gcc-4.5.3/bin/gcc
  libavutil      51. 39.100 / 51. 39.100
  libavcodec     54.  3.100 / 54.  3.100
  libavformat    54.  1.100 / 54.  1.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 62.101 /  2. 62.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
Input #0, matroska,webm, from 'bad_seek_matroska_eof.mkv':
  Metadata:
    title           : Backstreet.Boys.Live.From.O2.Arena.2008.HDTVRip.1080p.-VoLoNa by HDTVshek.HET
  Duration: 00:01:50.84, start: 0.000000, bitrate: 7683 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      title           : Backstreet.Boys.Live.From.O2.Arena.2008.HDTVRip.1080p.-VoLoNa
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), s16, 384 kb/s (default)
    Metadata:
      title           : AC3 5.1@384Kbps
[buffer @ 0x1a57d00] w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'
Output #0, avi, to 'out.avi':
  Metadata:
    INAM            : Backstreet.Boys.Live.From.O2.Arena.2008.HDTVRip.1080p.-VoLoNa by HDTVshek.HET
    ISFT            : Lavf54.1.100
    Stream #0:0(eng): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 tbn, 23.98 tbc (default)
    Metadata:
      title           : Backstreet.Boys.Live.From.O2.Arena.2008.HDTVRip.1080p.-VoLoNa
    Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), flt, 128 kb/s (default)
    Metadata:
      title           : AC3 5.1@384Kbps
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
  Stream #0:1 -> #0:1 (ac3 -> ac3)
Press [q] to stop, [?] for help
frame=    0 fps=  0 q=0.0 Lsize=      10kB time=00:00:00.00 bitrate=   0.0kbits/s
video:0kB audio:0kB global headers:0kB muxing overhead inf%
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

comment:2 by reimar, 12 years ago

Potential patch sent to list.

comment:3 by reimar, 12 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.