Opened 4 years ago

Last modified 4 years ago

#8876 new defect

Invalid data found when processing input, but video is playable

Reported by: Rotem Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mov
Cc: yakir.rotem@gmail.com Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Hey,

I'm using ffmpeg version

ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.8)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100

When I try to process this video https://s3-ap-southeast-1.amazonaws.com/filestore.getselect.co/IMG_0029.mp4 using this command

ffmpeg -i IMG_0029.mp4 -y newvideo2.mp4

I get this output

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f8a1f008200] could not find corresponding trex (id 1)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f8a1f008200] could not find corresponding track id 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f8a1f008200] trun track id unknown, no tfhd was found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f8a1f008200] error reading header
IMG_0029.mp4: Invalid data found when processing input

I don't understand what is the problem as the video is playable.

Would appreciate any help.

Change History (13)

comment:1 by Rotem, 4 years ago

Cc: yakir.rotem@gmail.com added

comment:2 by Carl Eugen Hoyos, 4 years ago

Keywords: mov added; Invalid data removed
Version: 4.2unspecified

How was the input file created?

in reply to:  2 comment:3 by Rotem, 4 years ago

Replying to cehoyos:

How was the input file created?

by using a tool online (redv.co) to download reddit video

comment:4 by Balling, 4 years ago

redv.co -- very bad idea. Try to use youtube-dl, it supports reddit.

in reply to:  4 comment:5 by Rotem, 4 years ago

Replying to Balling:

redv.co -- very bad idea. Try to use youtube-dl, it supports reddit.

Ok but this is not the point. This video is a potential video our users can have on their device so I want to be able to compress also videos that were created by redv.co.

comment:6 by Carl Eugen Hoyos, 4 years ago

Sorry, but I don't understand this report: You found a website that can produce invalid mov files, ffmpeg allows to read such files, what would you like to change?

in reply to:  6 comment:7 by Rotem, 4 years ago

Keywords: mp4 added; mov removed
Version: unspecified4.2

Replying to cehoyos:

Sorry, but I don't understand this report: You found a website that can produce invalid mov files, ffmpeg allows to read such files, what would you like to change?

Why are we even discussing the website? ... I have an mp4 file that is playable in all devices and computers so clearly the file is not corrupted, however, when I try to compress it using ffmpeg I get the above error.

comment:8 by Carl Eugen Hoyos, 4 years ago

Component: undeterminedavformat
Keywords: mov added; mp4 removed
Reproduced by developer: set
Version: 4.2git-master
$ ffmpeg -i IMG_0029.mp4 -qscale 2 out.avi
ffmpeg version N-98962-g0271098e6c Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (SUSE Linux)
  configuration: --enable-gpl --enable-gnutls --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libdav1d --enable-libvpx --enable-libopus --enable-libxml2 --enable-libwebp --enable-librav1e --enable-libfreetype --enable-libass
  libavutil      56. 58.100 / 56. 58.100
  libavcodec     58.101.101 / 58.101.101
  libavformat    58. 51.101 / 58. 51.101
  libavdevice    58. 11.101 / 58. 11.101
  libavfilter     7. 87.100 /  7. 87.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3a0c580] Detected moov in a free or hoov atom.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3a0c580] Found duplicated MOOV Atom. Skipped it
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'IMG_0029.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1iso6mp41
    encoder         : Lavf56.40.101
  Duration: 00:00:05.38, start: 0.000000, bitrate: 33566 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 812:813 DAR 86681:48780], 1182 kb/s, SAR 30046:30083 DAR 247:139, 30 fps, 30 tbr, 12k tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 130 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Please use -q:a or -q:v, -qscale is ambiguous
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
  Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[mpeg4 @ 0x3a3a780] Invalid pixel aspect ratio 30046/30083, limit is 255/255 reducing
Output #0, avi, to 'out.avi':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1iso6mp41
    ISFT            : Lavf58.51.101
    Stream #0:0(und): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p(progressive), 854x480 [SAR 1:1 DAR 427:240], q=2-31, 200 kb/s, SAR 30046:30083 DAR 247:139, 30 fps, 30 tbn, 30 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.101.101 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
    Stream #0:1(und): Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc58.101.101 libmp3lame
frame=  161 fps=0.0 q=2.0 Lsize=    2982kB time=00:00:05.37 bitrate=4544.2kbits/s speed=15.1x    
video:2879kB audio:84kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.638195%

The sample plays for more than two minutes with MPlayer and WMP.

in reply to:  8 comment:9 by Rotem, 4 years ago

Replying to cehoyos:

This is what I get when I run the command

ffmpeg -i IMG_0029.mp4 -qscale 2 out.avi
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.8)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f930f012400] could not find corresponding trex (id 1)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f930f012400] could not find corresponding track id 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f930f012400] trun track id unknown, no tfhd was found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f930f012400] error reading header
IMG_0029.mp4: Invalid data found when processing input

Maybe it is a bug that got fixed in the latest ffmpeg version?

in reply to:  8 comment:10 by Rotem, 4 years ago

Replying to cehoyos:

After installing version 4.3.1 I no longer have the error message, however, the command ffmpeg -i IMG_0029.mp4 -y newvideo2.mp4 only produces a 5 seconds videos instead of the full length which is 2 minutes and 20 seconds.

Do you know why?

comment:11 by Rotem, 4 years ago

I've opened this ticket for the duration issue - https://trac.ffmpeg.org/ticket/8883

comment:12 by Rotem, 4 years ago

I've opened this ticket for the duration issue - https://trac.ffmpeg.org/ticket/8883

comment:13 by Rotem, 4 years ago

Bump

Note: See TracTickets for help on using tickets.