简体   繁体   English

如何修复 MJPEG 文件中的 fps/持续时间信息

[英]How to fix fps/duration information in MJPEG File

I have a set of MJPEG.avi files which were logged as being at 25fps, but were actually recorded slightly slower than this, so they're timing is wrong (they show up as being about 2 minutes shorter than the actual recording).我有一组 MJPEG.avi 文件,它们被记录为 25fps,但实际上记录的速度比这稍慢,所以它们的时间是错误的(它们显示为比实际记录短约 2 分钟)。 I know the true duration of recording - how can I set the duration of the file to that, without re-encoding?我知道录制的真实持续时间 - 如何在不重新编码的情况下将文件的持续时间设置为该持续时间?

You may use FFmpeg , using the same solution posted here .您可以使用FFmpeg ,使用此处发布的相同解决方案。

The following two steps solution is without re-encoding:以下两步解决方案无需重新编码:

  • Convert from AVI to raw MJPEG:从 AVI 转换为原始 MJPEG:

     ffmpeg -i input.avi -c copy input.mjpeg
  • Remux the raw MJPEG with new framerate (24 fps for example):使用新的帧速率(例如 24 fps)重新混合原始 MJPEG:

     ffmpeg -r 24 -i input.mjpeg -c copy output.avi

The above solution assumes there is no audio stream.上述解决方案假设没有音频 stream。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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