Opened 12 days ago
Last modified 11 days ago
#11005 new defect
Damaged MP4 rejected by ffmpeg, mkvtoolnix can read it fine
Reported by: | PumaD | Owned by: | |
---|---|---|---|
Priority: | important | Component: | avformat |
Version: | git-master | Keywords: | |
Cc: | PumaD, MasterQuestionable | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Got a multi GiB file which is unfortunately damaged and all players I tested refuse to play. I almost deleted it but then had the idea to run it though mkvtoolnix. It managed to salvage it almost completely with just minor visual artifacts during playback.
Would be great if ffmpeg could do the same.
How to reproduce:
$ ffmpeg -i slightly-damaged.mp4 out.mp4 ffmpeg version N-115112-g39ce8a9695 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 13.2.1 (GCC) 20240417 configuration: libavutil 59. 17.100 / 59. 17.100 libavcodec 61. 5.103 / 61. 5.103 libavformat 61. 3.103 / 61. 3.103 libavdevice 61. 2.100 / 61. 2.100 libavfilter 10. 2.101 / 10. 2.101 libswscale 8. 2.100 / 8. 2.100 libswresample 5. 2.100 / 5. 2.100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x609423feb840] Invalid sample size -1251017134 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x609423feb840] error reading header [in#0 @ 0x609423feb580] Error opening input: Invalid data found when processing input Error opening input file slightly-damaged.mp4. Error opening input files: Invalid data found when processing input
Tested with ffmpeg 6.1.1 as well as git master from yesterday.
Attachments (1)
Change History (5)
comment:1 by , 12 days ago
follow-up: 3 comment:2 by , 11 days ago
Cc: | added |
---|---|
Component: | undetermined → avformat |
͏ MKVToolNix..?
͏ https://gitlab.com/mbunkus/mkvtoolnix#1-introduction
͏ Sure it's MP4?
͏ What's your `mkvmerge` command? (if indeed MP4 input)
͏ FFmpeg much relies the filename extension: when ͏"-f" not specified.
by , 11 days ago
Attachment: | slightly-damaged-refuses-to-play.mp4.txt added |
---|
͏ Indeed MP4:
͏ https://streams.videolan.org/ffmpeg/incoming/11005/slightly-damaged-refuses-to-play.mp4 (~ 6.35 MiB)
͏ Note: NSFW
comment:3 by , 11 days ago
Replying to MasterQuestionable:
͏ MKVToolNix..?
͏ https://gitlab.com/mbunkus/mkvtoolnix#1-introduction
Yes, that one. Sorry, I shouldn't have assumed everyone to be familiar with it.
͏ Sure it's MP4?
Your implication being that MKVToolNix can only read MKV and not MP4? That's not the case. It can only create MKV but read a very wide variety of input formats.
͏ What's your `mkvmerge` command? (if indeed MP4 input)
I used the GUI, but that only constructs a command line. A simple mkvmerge --output out.mkv slightly-damaged-refuses-to-play.mp4
works.
͏ FFmpeg much relies the filename extension: when ͏"-f" not specified.
Good to know, I wasn't aware of that. However, you already confirmed in your other comment that it's indeed MP4.
comment:4 by , 11 days ago
Priority: | normal → important |
---|
͏ Thanks for feedback.
͏ I much figured out the cause. (though unable to provide fix now)
I've uploaded a sample under the name
slightly-damaged-refuses-to-play.mp4
to https://streams.videolan.org/upload/ since it's too big to attach here.