Opened 7 years ago

Closed 7 years ago

#6102 closed defect (fixed)

"error reading header" and "unknown error" when reading mp4 file

Reported by: balchen Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mov regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:

ffprobe and ffmpeg report "error reading header" / "unknown error" / -1989548172 when reading an mp4 file I received from a client.

According to MediaInfo, the file contains the following 6 streams:

Format                      : MPEG-4
Format profile              : Base Media / Version 2
Codec ID                    : mp42 (mp42/mp41)
File size                   : 2.15 GiB
Duration                    : 8mn 49s
Overall bit rate            : 34.9 Mbps
Encoded date                : UTC 2014-06-20 15:45:31
Tagged date                 : UTC 2014-08-20 10:27:37

Video
ID                          : 1
Format                      : MPEG-4 Visual
Format profile              : Simple@L1
Format settings, BVOP       : Yes
Format settings, QPel       : No
Format settings, GMC        : No warppoints
Format settings, Matrix     : Default (H.263)
Codec ID                    : 20
Duration                    : 8mn 49s
Bit rate                    : 34.0 Mbps
Width                       : 1 920 pixels
Height                      : 1 080 pixels
Display aspect ratio        : 16:9
Frame rate mode             : Constant
Frame rate                  : 25.000 fps
Color space                 : YUV
Bit depth                   : 8 bits
Scan type                   : Progressive
Compression mode            : Lossy
Bits/(Pixel*Frame)          : 0.656
Stream size                 : 2.10 GiB (98%)
Language                    : English
Encoded date                : UTC 2014-06-20 15:44:11
Tagged date                 : UTC 2014-06-20 15:47:44
Color primaries             : BT.709
Transfer characteristics    : BT.709
Matrix coefficients         : BT.709
transfer_characteristics_Or : BT.601
matrix_coefficients_Origina : BT.601

Audio
ID                          : 2
Format                      : AAC
Format/Info                 : Advanced Audio Codec
Format profile              : LC
Codec ID                    : 40
Duration                    : 8mn 49s
Source duration             : 8mn 49s
Bit rate mode               : Constant
Bit rate                    : 55.2 Kbps
Nominal bit rate            : 64.0 Kbps
Channel(s)                  : 2 channels
Channel positions           : Front: L R
Sampling rate               : 44.1 KHz
Frame rate                  : 43.066 fps (1024 spf)
Compression mode            : Lossy
Stream size                 : 3.48 MiB (0%)
Source stream size          : 3.48 MiB (0%)
Language                    : English
Encoded date                : UTC 2014-06-20 15:44:11
Tagged date                 : UTC 2014-06-20 15:47:44

Other #1
ID                          : 3
Type                        : Scene description
Format                      : System Core
Codec ID                    : 2
Duration                    : 8mn 49s
Language                    : English
Encoded date                : UTC 2014-06-20 15:44:11
Tagged date                 : UTC 2014-06-20 15:47:44

Other #2
ID                          : 4
Type                        : Object description
Format                      : System
Codec ID                    : 1
Duration                    : 8mn 49s
Language                    : English
Encoded date                : UTC 2014-06-20 15:44:11
Tagged date                 : UTC 2014-06-20 15:47:44

Other #3
ID                          : 5
Type                        : Hint
Format                      : RTP
Codec ID                    : rtp 
Duration                    : 8mn 49s
Title                       : Hinted Sound Track
Language                    : English
Default                     : No
Encoded date                : UTC 2014-06-20 15:44:11
Tagged date                 : UTC 2014-06-20 15:47:44
Source duration             : 529206
Source_Duration_LastFrame   : -23
Source frame count          : 5698
Source stream size          : 546992
Stream size                 : 546992
Bit rate mode               : VBR

Other #4
ID                          : 6
Type                        : Hint
Format                      : RTP
Codec ID                    : rtp 
Duration                    : 8mn 49s
Title                       : Hinted Video Track
Language                    : English
Default                     : No
Encoded date                : UTC 2014-06-20 15:44:24
Tagged date                 : UTC 2014-06-20 15:47:44

How to reproduce:

ffmpeg -report provides the following log:

ffmpeg started on 2017-01-25 at 11:04:28
Report written to "ffmpeg-20170125-110428.log"
Command line:
ffmpeg -i Funnhistorie.mp4 -report
ffmpeg version N-82889-g54931fd Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 68.100 / 57. 68.100
  libavformat    57. 61.100 / 57. 61.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Splitting the commandline.
Reading option '-i' ... matched as input url with argument 'Funnhistorie.mp4'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url Funnhistorie.mp4.
Successfully parsed a group of options.
Opening an input file: Funnhistorie.mp4.
[file @ 0000000000e56540] Setting default whitelist 'file,crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] ISO: File Type Major Brand: mp42
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Unknown dref type 0x08206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Processing st: 0, edit list 0 - media time: 0, duration: 1323000
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Unknown dref type 0x08206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Processing st: 1, edit list 0 - media time: 0, duration: 23337720
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Unknown dref type 0x08206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Processing st: 2, edit list 0 - media time: 0, duration: 1323000
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Unknown dref type 0x08206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Processing st: 3, edit list 0 - media time: 0, duration: 1323000
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Unknown dref type 0x08206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Processing st: 4, edit list 0 - media time: 0, duration: 23337720
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Unknown dref type 0x08206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] Processing st: 5, edit list 0 - media time: 0, duration: 47628000
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025938c0] error reading header
[AVIOContext @ 0000000000e572e0] Statistics: 397362 bytes read, 1 seeks
Funnhistorie.mp4: Unknown error

-v 9 and -loglevel 99 provides the following details:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] AVIndex stream 5, sample 13223, offset 8969c39c, dts 47602800, size 32, distance 1, keyframe 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] AVIndex stream 5, sample 13224, offset 8969c3bc, dts 47606400, size 32, distance 2, keyframe 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] AVIndex stream 5, sample 13225, offset 8969d8d0, dts 47610000, size 32, distance 3, keyframe 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] AVIndex stream 5, sample 13226, offset 8969d8f0, dts 47613600, size 32, distance 4, keyframe 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] AVIndex stream 5, sample 13227, offset 8969d910, dts 47617200, size 32, distance 5, keyframe 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] AVIndex stream 5, sample 13228, offset 8969d930, dts 47620800, size 32, distance 6, keyframe 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] AVIndex stream 5, sample 13229, offset 8969d950, dts 47624400, size 32, distance 7, keyframe 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] Processing st: 5, edit list 0 - media time: 0, duration: 47628000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] type: 61746475 'udta' parent:'moov' sz: 78 370029 370132
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] type: 69746e68 'hnti' parent:'udta' sz: 70 8 70
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] type: 73646f69 'iods' parent:'moov' sz: 33 370107 370132
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] type: 65657266 'free' parent:'root' sz: 8 370172 2305419124
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] type: 65657266 'free' parent:'root' sz: 8 370180 2305419124
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] type: 7461646d 'mdat' parent:'root' sz: 2305045356 370188 2305419124
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] type: 64697575 'uuid' parent:'root' sz: 3588 2305415544 2305419124
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002572640] error reading header
[AVIOContext @ 000000000257bb40] Statistics: 397362 bytes read, 1 seeks
Funnhistorie.mp4: Unknown error

THe file is 2.2 GB and belongs to someone else. I can possibly provide a part of the file as a sample, but which part?

Thanks.

Change History (9)

comment:1 by Carl Eugen Hoyos, 7 years ago

Keywords: mov added

At least provide the first and the last 100MB, ideally the whole file.

comment:2 by Carl Eugen Hoyos, 7 years ago

Or test 218f46fc

comment:3 by balchen, 7 years ago

Is there a Windows build for 218f46fc?

comment:4 by Carl Eugen Hoyos, 7 years ago

If you cannot compile it may be simpler for you to upload 2G...

comment:5 by balchen, 7 years ago

The issue with providing the whole file is copyright, mainly. I've extracted the first and last 100 MB.

The files are uploaded to:

https://www.datafilehost.com/d/2119fd32 (first 100 MB)
https://www.datafilehost.com/d/ab360de1 (last 100 MB)

comment:6 by Carl Eugen Hoyos, 7 years ago

What is the exact size in bytes of the whole file?

Last edited 7 years ago by Carl Eugen Hoyos (previous) (diff)

comment:7 by balchen, 7 years ago

It's 2 305 419 124 bytes.

comment:8 by Carl Eugen Hoyos, 7 years ago

Component: undeterminedavformat
Keywords: regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

comment:9 by Michael Niedermayer, 7 years ago

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