开发者

Fix faulty MP4 metadata

开发者 https://www.devze.com 2023-02-28 17:40 出处:网络
I have a problem wi开发者_开发问答th 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 actu

I have a problem wi开发者_开发问答th 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.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号