I've got an MP4 file that is actually 2:09:42 long. But when playing it in VLC player it is being shown as 7:13:45 long. I'm trying to fix this file.
I remuxed it using
ffmpeg -i input.mp4 -codec copy output.mp4 which did not change anything.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4': Metadata: major_brand : isom minor_version : 1 compatible_brands: isomavc1 creation_time : 2012-12-12T09:35:27.000000Z Duration: 07:13:45.09, start: 0.000000, bitrate: 578 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x800 [SAR 1:1 DAR 12:5], 1618 kb/s, 23.98 fps, 23.98 tbr, 96k tbn, 47.95 tbc (default ) Metadata: creation_time : 2012-12-12T09:35:27.000000Z Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, flt p, 92 kb/s (default) Metadata: creation_time : 2012-12-12T09:36:27.000000Z handler_name : GPAC ISO Audio Handler
I demuxed the file and tried to recombine the streams. Here, this is shown:
Input #0, h264, from 'x.h264': Duration: N/A, bitrate: N/A Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x800 [SAR 1:1 DAR 12:5], 23.98 fps, 23.98 tbr, 1200k tbn, 47.95 tbc [aac @ 000000000328a8c0] Estimating duration from bitrate, this may be inaccurat e Input #1, aac, from 'x.aac': Duration: 07:14:19.51, bitrate: 94 kb/s Stream #1:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 94 kb/s Output #0, mp4, to 'x.mp4': Metadata: encoder : Lavf58.38.101 Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1 920x800 [SAR 1:1 DAR 12:5], q=2-31, 23.98 fps, 23.98 tbr, 1200k tbn, 1200k tbc Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 94 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #1:0 -> #0:1 (copy)
Here, the wrong duration is shown for the aac stream. Does this mean that the aac stream has wrong time information?
When I play the aac file VLC player shows 7 hours duration. When I play the h264 file no duration is shown.
I then tried to remux specifying
-t 2:09:42. This makes VLC player display the correct duration. The movie plays normally and appears complete. But the file size dropped from 1.8 GB to 1.6 GB which makes me suspect that I somehow lost data.
How can I fix this file?
Update: I have now recoded the aac stream to MP3. It really is 7 hours long. The audio is repeated multiple times. No idea why. So I guess I can just trim that stream? Is that appropriate?