Opened 12 years ago

Last modified 11 years ago

#1558 open defect

Artefacts and wrong duration when decoding a (possibly damaged) matroska file

Reported by: Carl Eugen Hoyos Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mkv duration roundup
Cc: Swinder Pal SINGH Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

(issue 384)
http://samples.ffmpeg.org/ffmpeg-bugs/roundup/issue384/
FFmpeg is unable to decode a matroska sample that is played fine by vlc.

$ ffmpeg -i matroska_crash.mkv
ffmpeg version N-42619-g6b7849e Copyright (c) 2000-2012 the FFmpeg developers
  built on Jul 19 2012 08:58:35 with gcc 4.3.2
  configuration: --cc=/usr/local/gcc-4.3.2/bin/gcc --enable-gpl --enable-libopenjpeg --enable-libvorbis --enable-libspeex --enable-libmp3lame --enable-libtheora --extra-ldflags=-lm --enable-libvpx --enable-libxavs --enable-x11grab --enable-libass
  libavutil      51. 65.100 / 51. 65.100
  libavcodec     54. 41.100 / 54. 41.100
  libavformat    54. 17.100 / 54. 17.100
  libavdevice    54.  1.100 / 54.  1.100
  libavfilter     3.  2.100 /  3.  2.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[matroska,webm @ 0x90764e0] Unknown entry 0x6E1F
[matroska,webm @ 0x90764e0] Unknown entry 0x48B2
[matroska,webm @ 0x90764e0] Read error at pos. 2376 (0x948)
[matroska,webm @ 0x90764e0] Unknown entry 0x81
[matroska,webm @ 0x90764e0] Read error at pos. 192 (0xc0)
[matroska,webm @ 0x90764e0] Unknown entry 0x82
[matroska,webm @ 0x90764e0] Unknown entry 0x67C9
    Last message repeated 1 times
[matroska,webm @ 0x90764e0] Unknown entry 0x82
[matroska,webm @ 0x90764e0] Could not find codec parameters for stream 1 (Audio: mp3, 48000 Hz, 2 channels, s16): unspecified sample size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x90764e0] Could not find codec parameters for stream 3 (Audio: mp3, 48000 Hz, 2 channels, s16): unspecified sample size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x90764e0] Could not find codec parameters for stream 5 (Audio: mp3, 48000 Hz, 2 channels, s16): unspecified sample size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x90764e0] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for  Input Stream #0.1 : stereo
Guessed Channel Layout for  Input Stream #0.3 : stereo
Guessed Channel Layout for  Input Stream #0.5 : stereo
Input #0, matroska,webm, from 'matroska_crash.mkv':
  Metadata:
    creation_time   : 2005-07-28 20:39:44
  Duration: N/A, start: 0.000000, bitrate: N/A
    Chapter #0.0: start 0.000000, end 15.000000
    Metadata:
      title           : Introduction
    Chapter #0.1: start 15.000000, end 30.000000
    Metadata:
      title           : Developpement
    Chapter #0.2: start 30.000000, end 45.200000
    Metadata:
      title           : Conclusion
    Stream #0:0(eng): Video: mpeg4 (DX50 / 0x30355844), yuv420p, 720x400, SAR 1:1 DAR 9:5, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
    Stream #0:1(eng): Audio: mp3, 48000 Hz, stereo, s16 (default)
    Stream #0:2(eng): Video: mpeg4 (DX50 / 0x30355844), yuv420p, 720x400, SAR 1:1 DAR 9:5, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
    Stream #0:3(eng): Audio: mp3, 48000 Hz, stereo, s16 (default)
    Stream #0:4(eng): Video: mpeg4 (DX50 / 0x30355844), yuv420p, 720x400, SAR 1:1 DAR 9:5, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
    Stream #0:5(eng): Audio: mp3, 48000 Hz, stereo, s16 (default)
At least one output file must be specified

Change History (4)

comment:1 by Carl Eugen Hoyos, 12 years ago

Keywords: roundup added

comment:2 by Carl Eugen Hoyos, 11 years ago

Keywords: duration added
Reproduced by developer: set
Status: newopen
Summary: Unable to decode a (possibly damaged) matroska fileArtefacts and wrong duration when decoding a (possibly damaged) matroska file

The sample plays now but shows heavy artefacts in the beginning that are not visible with vlc, shown duration is wrong, see ticket #3066.

$ ffmpeg -i matroska_crash.mkv -qscale 2 out.mkv
ffmpeg version N-57288-g09ba986 Copyright (c) 2000-2013 the FFmpeg developers
  built on Oct 21 2013 12:07:28 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      52. 47.101 / 52. 47.101
  libavcodec     55. 37.102 / 55. 37.102
  libavformat    55. 19.103 / 55. 19.103
  libavdevice    55.  4.100 / 55.  4.100
  libavfilter     3. 88.102 /  3. 88.102
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[matroska,webm @ 0x1e12880] Unknown entry 0x6E1F
[matroska,webm @ 0x1e12880] Unknown entry 0x48B2
[matroska,webm @ 0x1e12880] Read error at pos. 2376 (0x948)
[matroska,webm @ 0x1e12880] Unknown entry 0x81
[matroska,webm @ 0x1e12880] Read error at pos. 192 (0xc0)
[matroska,webm @ 0x1e12880] Unknown entry 0x82
Truncating packet of size 1304136787 to 4682756
[matroska,webm @ 0x1e12880] Unknown entry 0x67C9
    Last message repeated 1 times
[matroska,webm @ 0x1e12880] Unknown entry 0x82
Truncating packet of size 1304137043 to 4682741
[matroska,webm @ 0x1e12880] Unknown entry 0x83
    Last message repeated 4 times
Truncating packet of size 1304137043 to 4682661
[matroska,webm @ 0x1e12880] Unknown entry 0x83
Truncating packet of size 491633549 to 4682646
[matroska,webm @ 0x1e12880] Unknown entry 0x83
Truncating packet of size 881479099 to 4682631
[matroska,webm @ 0x1e12880] Unknown entry 0x83
Truncating packet of size 75773773 to 4682616
[matroska,webm @ 0x1e12880] Unknown entry 0x83
Truncating packet of size 198743885 to 4682600
[matroska,webm @ 0x1e12880] Unknown entry 0x83
[matroska,webm @ 0x1e12880] Unknown entry 0x7B4C
[matroska,webm @ 0x1e12880] Unknown entry 0x7DAC
[matroska,webm @ 0x1e12880] Unknown entry 0xC9
[matroska,webm @ 0x1e12880] Unknown entry 0x81
[matroska,webm @ 0x1e12880] Unknown entry 0x90
[matroska,webm @ 0x1e12880] Unknown entry 0xF1
[matroska,webm @ 0x1e12880] Unknown entry 0x55B1
Truncating packet of size 182616600 to 4128317
[mpeg4 @ 0x1e15560] hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 0x1e15560] my guess is 5 bits ;)
[matroska,webm @ 0x1e12880] Estimating duration from bitrate, this may be inaccurate
[matroska,webm @ 0x1e12880] Could not find codec parameters for stream 3 (Audio: mp3, 48000 Hz, 2 channels, s16p): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x1e12880] Could not find codec parameters for stream 5 (Audio: mp3, 48000 Hz, 2 channels, s16p): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for  Input Stream #0.3 : stereo
Guessed Channel Layout for  Input Stream #0.5 : stereo
Input #0, matroska,webm, from 'matroska_crash.mkv':
  Metadata:
    creation_time   : 2005-07-28 20:39:44
  Duration: 00:06:30.25, start: 0.000000, bitrate: 96 kb/s
    Chapter #0.0: start 0.000000, end 15.000000
    Metadata:
      title           : Introduction
    Chapter #0.1: start 15.000000, end 30.000000
    Metadata:
      title           : Developpement
    Chapter #0.2: start 30.000000, end 45.200000
    Metadata:
      title           : Conclusion
    Stream #0:0(eng): Video: mpeg4 (Simple Profile) (DX50 / 0x30355844), yuv420p, 720x400 [SAR 1:1 DAR 9:5], 25 fps, 25 tbr, 1k tbn, 25 tbc (default)
    Stream #0:1(eng): Audio: mp3, 48000 Hz, stereo, s16p, 96 kb/s (default)
    Stream #0:2(eng): Video: mpeg4 (DX50 / 0x30355844), yuv420p, 720x400, SAR 1:1 DAR 9:5, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
    Stream #0:3(eng): Audio: mp3, 48000 Hz, stereo, s16p (default)
    Stream #0:4(eng): Video: mpeg4 (DX50 / 0x30355844), yuv420p, 720x400, SAR 1:1 DAR 9:5, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
    Stream #0:5(eng): Audio: mp3, 48000 Hz, stereo, s16p (default)
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, matroska, to 'out.mkv':
  Metadata:
    encoder         : Lavf55.19.103
    Chapter #0.0: start 0.000000, end 15.000000
    Metadata:
      title           : Introduction
    Chapter #0.1: start 15.000000, end 30.000000
    Metadata:
      title           : Developpement
    Chapter #0.2: start 30.000000, end 45.200000
    Metadata:
      title           : Conclusion
    Stream #0:0(eng): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 720x400 [SAR 1:1 DAR 9:5], q=2-31, 200 kb/s, 1k tbn, 25 tbc (default)
    Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s (default)
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 -> mpeg4)
  Stream #0:1 -> #0:1 (mp3 -> ac3)
Press [q] to stop, [?] for help
[mpeg4 @ 0x205fb00] warning: first frame is no keyframe
frame=  953 fps=0.0 q=2.0 Lsize=    8082kB time=00:00:45.20 bitrate=1464.8kbits/s
video:7170kB audio:893kB subtitle:0 global headers:0kB muxing overhead 0.229468%

comment:3 by Swinder Pal SINGH, 11 years ago

plz add me to cc as i want to know when this is fixed.

comment:4 by Carl Eugen Hoyos, 11 years ago

Cc: Swinder Pal SINGH added
Note: See TracTickets for help on using tickets.