Showing posts with label FFmpeg. Show all posts
Showing posts with label FFmpeg. Show all posts

Monday, June 21, 2010

Add separate audio to a video file using FFMPEG

There was a need to put the "Wavin Flag" song with a video of football tricks and stuff. So i turned to FFMPEG. After tinkering with the command line parameters as much as i could do, I found the easy way is to specify the audio file and the video file as inputs and FFMPEG gave me a single video file with the desired result.

The syntax woule be

ffmpeg -i input_audio.mp3 -i input_video combined_video

Take a look at the example command.

ffmpeg.exe -i audiofile.mp3 -i source_video.mpg -b 800k output.mpg

I used -b 800k, to make sure that the output video would be with 800kbps bit rate.

Saturday, May 22, 2010

Extract Audio from FLV file and save as MP3 with FFmpeg

I had to extract MP3 from an flv video a few days back. Luckily i had FFmpeg. Since i had the command line version only, i had to dig deep to find the commands to get my task done.

The command that i used is : 

D:>ffmpeg.exe -i

This will process the video file and out put the audio at a rate of 64kbps. Although the flv contained audio at 128kbps, the result i got was only at 64kbps. 

In order to copy the sound channel directly and save it as mp3, we can use this

D:>ffmpeg.exe -i “D:\testVideo.flv” -acodec copy “D:\audio_from_video.mp3”

The option "-acodec copy" results in FFMPEG copying the audio stream present to the output file without processing it.

About FFmpeg

FFmpeg is a collection of software libraries that can record, convert and stream digital audio and video in numerous formats. It includes libavcodec, an audio/video codec library used by several other projects, and libavformat, an audio/video container mux and demux library. The name of the project comes from the MPEG video standards group, together with "FF" for "fast forward".

FFmpeg takes care of all the hard work of video processing by doing all the decoding, encoding, muxing and demuxing for you. This can make media applications much simpler to write. It's simple, written in C, fast, and can decode almost any codec you'll find in use today, as well as encode several other formats.

FFmpeg Website