简体   繁体   中英

Fix faulty MP4 metadata

I have a problem with incomplete videos. For instance a video whose upload failed. If you check its metadata with ffmpeg -i <filename> you will get a duration like 1 hour but actually only 10mb have been uploaded to the server and the real duration is somewere at 7 minutes. An ugly way to find these videos would be to convert every video and compare the duration output of the converted video with the duration of the original video. Since this approach is way too CPU costly I would like to simply recalculate the duration with FFmpeg.

Is there any command or a good software for that?

A couple of ideas and approaches:

  • Bolster your upload mechanism to not queue partially uploaded files. This can't be that hard.
  • Check the uploaded file with something like mp4info , or one of its sibling tools mp4trackdump, et al .
  • Use FFmpeg to do a first pass of two pass encoding. This should highlight any issues without actually encoding a file
  • Check out mp4box , which is another powerful tool for these kinds of tasks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM