Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
289 views
in Technique[技术] by (71.8m points)

java - How to concat or merge two or more video files in Android?

I want to merge two or more video files (they may be two mp4 or two 3gp, or any other format).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...