将碎片化的MP4拆分为多个MP4文件 [英] Split fragmented MP4 into multiple MP4 files

查看:245
本文介绍了将碎片化的MP4拆分为多个MP4文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试将fMP4文件的片段解析为单独的独立MP4.任何人都可以帮助我们指出正确的方向,或者存在可以利用的开源代码吗?

We're trying to parse the fragments of an fMP4 file into separate independent MP4s. Can anyone help point us in the right direction to do this, or is there any open source code that exists that we could leverage?

推荐答案

我认为 MP4Box 可能就是您想要的.它是开源的,因此如果您想知道如何完成代码,可以看一下代码. 它也可以用作命令行工具,例如如此内容中所述博客文章(跳至细分"部分):

I think MP4Box might be what you are looking for. It's open source, so you can have a look at the code if you want to know how this can be done. It can also be used as command line tools, e.g. as described in this blog post (skip to the "Segmenting" section):

MP4Box -dash 4000 -rap -segment-name segment_ myInput.mp4

使用-segment-name-profile选项为每个片段生成一个文件. -rap标志也很重要,因此内容的分割方式应使每个文件都以关键帧开头,因为这是大多数播放器的要求. -dash 4000指定生成的文件的长度(以毫秒为单位,在本示例中为4秒).

Use either the -segment-name or the -profile option to generate one file per fragment. The -rap flag is also important so the content is split in a way that each file starts with a key frame, as this is a requirement for most players. The -dash 4000 specifies the length in milliseconds (i.e. in this example 4 seconds) of the resulting files.

这篇关于将碎片化的MP4拆分为多个MP4文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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