Extract Audio from a clip


Check which audio codecs has been used for audio track:

ffmpeg -i INPUT 2>&1 | grep Stream

Extract with

ffmpeg -i INPUT -vn -acodec copy OUTPUT.XXX

where XXX will be mp3 mp2 ac3 or or or.

Example:

file location : /home/cast/flashvideo.flv

ffmpeg -i /home/cast/flashvideo.flv 2>&1 | grep Stream :

you’ll get :

Stream #0.0: Video: flv, yuv420p, 320×240, 302 kb/s, 25 tbr, 1k tbn, 1k tbc
Stream #0.1: Audio: mp3, 22050 Hz, mono, s16, 64 kb/s

so to extract:

ffmpeg -i /home/cast/flashvideo.flv -vn -acodec copy myaudiostuff.mp3

do this for multiple files WITHOUT RENAMING..:

for file in $HOME/.* ;do ffmpeg -i “$file” -vn -acodec copy “${file%%.*}”.mp3;done

do this for multiple files WITH RENAMING..:

a=1;for file in $HOME/.* ;do ffmpeg -i “$file” -vn -acodec copy MYSTATICNAME-“$a”.mp3 ; a=$(($a+1));done

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: