Android - How to join two videos

2019-05-14 00:14发布

Basically, I am looking for a way to combine two mp4 video files (on the sd card) together. More like, appending the second video at the end of the first one. I have searched a lot, but couldn't find a suitable solution. (well I wasn't able to find any solution at all).

So my question is, Is there a library available that can combine (and possibly trim) videos supported by android?

Most of the java libraries I looked for this were platform dependent, for ex Xuggler was not much help in this case.

Thanks.

2条回答
何必那么认真
2楼-- · 2019-05-14 00:34

Use ffmpeg which is providing amazing features to the users to compress, split, merge and all kind of video/ audio editing/compressing/trancoding,etc. Version 1.1 (ffmpeg fire flower) onwards concat demuxer has been added to it, This is working fine in my android application.

http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20concatenate%20(join,%20merge)%20media%20files

查看更多
干净又极端
3楼-- · 2019-05-14 00:51

You can use the mp4parser library to append videos. The problem is the limited documentation.

查看更多
登录 后发表回答