Nowaday, the Audio and Video are so popular. As a developer, you have many works to process them such as record, convert, stream, etc.
Actually, if you are an Java-er, C#-er, etc, it is really difficult to find the way to do that with pure language programming.
Today, I want to introduce one powerful ‘tool’ which can do these tasks quickly. It is FFMPEG.
FFMPEG is a complete, cross-platform solution to record, convert and stream audio and video. After using it, I found that converting video and audio has never been so easy ! You only use commands and option which are supported, only one line command ! Wow
Please find detail at below website:
Look at below commant to converting a .mp4 file to .avi file:
ffmpeg -i input.mp4 output.avi
Run it and Done ! You have a AVI file. How it is easy !
Because the FFMPEG is a cross-platform, so you can use it in any popular OS today such as Window, Linux, MAC OS, etc.
Beside running pure FFMPEG command directly, you can use it in your project using Java, C#, etc.
For Java, you only define a certain FFMPEG command and run it using Process object like below code:
String exeCommand = “ffmpeg -i your_input_file your_output_file”
// Run FFMPEG command
Process process = Runtime.getRuntime().exec(exeCommand);
Done. You can find the demo JAVA code using FFMPEG at Github here.
Share this topic if it is helpful 🙂