I want to combine a video file (flv)
with no audio with an audio file (mp3)
using Xuggler. At the moment I have taken two streams and combined the
I know this thread is very old but the provided solution did not work for me and I figured I'd share my solution here...
I added the following dependencies to my pom.xml
org.bytedeco
ffmpeg
RELEASE
org.bytedeco
javacv-platform
RELEASE
org.bytedeco
javacpp
RELEASE
Then I use ProcessBuilder to execute FFMPEG commands. To merge audio and video, I use the following command:
String ffmpeg = Loader.load(org.bytedeco.ffmpeg.ffmpeg.class);
try {
ProcessBuilder pb = new ProcessBuilder(
ffmpeg,
"-i",
[PATH TO AUDIO FILE],
"-i",
[PATH TO VIDEO FILE],
"-acodec",
"copy",
"-vcodec",
"copy",
[PATH TO OUTPUT FILE]
);
pb.redirectErrorStream(true);
Process process = pb.start();
process.waitFor();
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}