如何Concat的或Android的合并两个或多个视频文件?多个、视频文件、两个、Concat

2023-09-04 03:55:08 作者:俊的抽象▂_

我想合并两个或多个视频文件(可能是两个MP4或两个3GP,或任何其他扩展名),请帮助我。

I want merge two or more video file (may be two mp4 or two 3gp , or any other extension) , please help me.

推荐答案

您可以使用的最通用的工具的ffmpeg(所指出的@Jeremy以上),但使用它的手机将需要一些工作;同时它是LGPL许可和它的一些连接codeRS(特别是X264)采用的是GPL。

The most generic tool you can use is ffmpeg (as noted by @Jeremy above), but using it on the mobile handset will require some work; also it is LGPL licensed and some of its encoders (notably x264) are GPL.

有一个简单的解决方案,如果你想使用类似的编码来连接这两个文件,​​并载于从MP4衍生的文件格式(3GP是这样的),是使用纯Java MP4分析器并连接所有的视频​​,而无需接触媒体流本身。看一看 mp4parser ,一个开源的解析器是纯Java,根据Apache许可证授权,甚至有一个例子串联视频在维基。

A simpler solution, if both files you want to concatenate are using similar encoding, and are contained in file formats derived from MP4 (3GP is such), is to use a pure-java MP4 parser and concatenate the videos without touching the media stream itself. Have a look at mp4parser, an open-source parser that is pure-java, licensed under Apache license and even has an example for concatenating videos in its wiki.