ffmpeg - generate moov atom

烂漫一生 提交于 2019-12-10 15:33:57

问题


I am currently recording video with blackmagic's prorecorder. I transcode video on-the-fly to mp4 video container with ffmpeg. Duration is unknown as I'm transcoding .ts that prorecorder is outputing to named pipe.

My goal is to I try to play this file with browser, while stream is still beeing recorded - Playback is great, but problem is that when I open file, duration is defined to current recording time.

So, question is - I would like to generate "fake" moov atom for duration of fe. 8 hours with ffmpeg, and then start recording mp4 file as I'm already doing. How could I do this?

Documentation that I checked and I think it's relevant - https://ffmpeg.org/ffmpeg-formats.html#MOV_002fMP4_002fISMV I also saw this on stack: Is it possible to fake a (mp4) moov atom?


回答1:


I had a similar problem and only discovered it after encoding nearly 2000 videos. Instead of starting over, I used this command to insert the moov atom:

/usr/bin/ffmpeg -i ./input.mp4 -c:v copy -movflags faststart -strict -2 ./output.mp4


来源:https://stackoverflow.com/questions/18294912/ffmpeg-generate-moov-atom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!