I have two files one is a .webm audio file and the other one is a .mp4 video file Is there a way to combine these two files together using java?
Thanks in advance.
This could be achieved by using ffmpeg
C
library via JNI
or via executing ffmpeg
command line binaries.
Here are the steps for command line execution:
Download FFmpeg: http://ffmpeg.org/download.html . You Can download the source from the repository and build them as per your machine architecture.
Extract downloaded file to specific folder, say c:\ffmpeffolder Using cmd move to specific folder c:\ffmpeffolder\bin
$ ffmpeg -i audioInput.webm -i videoInput.mp4 -acodec copy -vcodec copy outputFile.avi
Command line Execution from Java: https://stackoverflow.com/a/8496537/2900034
This is it. outputFile.avi will be the resulting file.
Or if you want to work around ffmpeg C libraries
Here are some good starts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With