Opened 5 years ago

Last modified 4 years ago

#8272 new defect

"error reading header" of MOV file containing HDV stream

Reported by: Olivier Bruchez Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mov oom
Cc: olivier@bruchez.org Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I've created a MOV file using iMovie from an HDV tape (via Firewire). The file has a size of 11 GB. When using it as an input in ffmpeg, I get an error:

./ffmpeg -i 2005-07-01\ 23_23_13.mov
ffmpeg version N-95322-g72704cbff4-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.8)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 59.102 / 58. 59.102
  libavformat    58. 33.100 / 58. 33.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 62.100 /  7. 62.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fac76001800] error reading header
2005-07-01 23_23_13.mov: Cannot allocate memory

It works perfectly fine in Quicktime Player.

When I truncate the file e.g. to 100 MB, ffmpeg can open the file:

./ffmpeg -i 2005-07-01\ 23_23_13-truncated.mov
ffmpeg version N-95322-g72704cbff4-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.8)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 59.102 / 58. 59.102
  libavformat    58. 33.100 / 58. 33.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 62.100 /  7. 62.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2005-07-01 23_23_13-truncated.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2019-10-08T13:02:06.000000Z
    com.apple.quicktime.make: Apple
    com.apple.quicktime.model: MacBookPro8,2
    com.apple.quicktime.software: Mac OS X 10.13.6 (17G8037)
    com.apple.quicktime.creationdate: 2019-10-08T14:42:40+0200
  Duration: 00:00:20.52, start: 0.000000, bitrate: 38985 kb/s
    Stream #0:0(und): Video: mpeg2video (Main) (hdv2 / 0x32766468), yuv420p(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2019-10-08T13:02:06.000000Z
      handler_name    : Core Media Video
      encoder         : HDV 1080i60
      timecode        : 00:00:00:15
    Stream #0:1(und): Data: none (tmcd / 0x64636D74), 0 kb/s
    Metadata:
      creation_time   : 2019-10-08T13:02:06.000000Z
      handler_name    : Core Media Time Code
      timecode        : 00:00:00:15
    Stream #0:2(und): Audio: pcm_f32le (lpcm / 0x6D63706C), 48000 Hz, stereo, flt, 3072 kb/s (default)
    Metadata:
      creation_time   : 2019-10-08T13:02:06.000000Z
      handler_name    : Core Media Audio
At least one output file must be specified

I would attach the full, verbose log to this ticket, but it's very big (12 GB uncompressed, 720 MB compressed).

Attachments (1)

2005-07-01-23_23_13.mov.txt (1.0 MB ) - added by Olivier Bruchez 4 years ago.
Result of ffmpeg -benchmark -loglevel debug -i 2005-07-01\ 23_23_13.mov

Download all attachments as: .zip

Change History (8)

comment:1 by Carl Eugen Hoyos, 5 years ago

Please split the input file in 100MB segments and provide the first and the last part.

comment:2 by Olivier Bruchez, 5 years ago

Cc: olivier@bruchez.org added

comment:3 by Olivier Bruchez, 5 years ago

I've uploaded the beginning and end of the MOV file here:

https://drive.google.com/drive/folders/1LUfDE0CVSAHwLA09ffipPvSiOGmIYegA?usp=sharing

comment:4 by Carl Eugen Hoyos, 5 years ago

The file I created has a size of 11338291992 bytes, but the sample does not allow to reproduce the issue (decoding with FFmpeg works fine), is the size correct?
Please provide the complete, uncut console output of ffmpeg -benchmark -loglevel debug -i 2005-07-01\ 23_23_13.mov

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

by Olivier Bruchez, 4 years ago

Attachment: 2005-07-01-23_23_13.mov.txt added

Result of ffmpeg -benchmark -loglevel debug -i 2005-07-01\ 23_23_13.mov

comment:5 by Olivier Bruchez, 4 years ago

That's correct: the full MOV file has a size of 11'338'291'992 bytes.

I've attached the logs (results of ffmpeg -benchmark -loglevel debug -i ...).

comment:6 by Carl Eugen Hoyos, 4 years ago

Component: undeterminedavformat
Keywords: mov oom added
Version: unspecifiedgit-master

mov_read_trun() apparently makes huge memory allocations for this file, I don't know if this can be fixed.

comment:7 by Carl Eugen Hoyos, 4 years ago

Could you test with -max_alloc 3000000000?

Note: See TracTickets for help on using tickets.