ffmpeg-生成moov原子 [英] ffmpeg - generate moov atom

查看:337
本文介绍了ffmpeg-生成moov原子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用blackmagic的prorecorder录制视频.我使用ffmpeg即时将视频转码为mp4视频容器.持续时间未知,因为我正在将prorecorder输出到命名管道的.ts进行转码.

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.

所以,问题是-我想在fe持续时间内生成假" moov原子.与ffmpeg一起工作8个小时,然后像我已经开始的那样开始录制mp4文件.我该怎么办?

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?

我检查并认为相关的文档- https://ffmpeg.org/ffmpeg -formats.html#MOV_002fMP4_002fISMV 我还在堆栈上看到了此内容:是否可以伪造一个( mp4)moov atom?

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?

推荐答案

我有一个类似的问题,只有在编码近2000个视频后才发现.而不是从头开始,我使用了以下命令来插入moov原子:

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

这篇关于ffmpeg-生成moov原子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆