commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
This commands saves the output in the audio directory. The portion ${file/%avi/mp3} uses bash string replacement to replace the avi to mp3 within the ${file} variable.
There is 1 alternative - vote for the best!
This command extracts the audio stream of the video in $file and stores it in a file where the original suffix is changed to .mp3
If you can do better, submit your command here.
You must be signed in to comment.
If you want it without being mp3 compressed try this
mplayer $avi -vc null -vo null -ao pcm:fast:file=$wav
I did a batch operation on multiple files with
for file in `ls -1`;do mencoder "${file}" -of rawaudio -oac mp3lame -ovc copy -o audio/"${file/%avi/mp3}";doneassuming audio/ directory has been created beforehand.
This is simply an awesome one-liner. Thank you for sharing this!
Two things i've learned using this:
1) using mencoder is faster than "mplayer -audiodump"; the latter will play the entire video in normal speed as it dumps the audio.
2) If your files have spaces on their names use:
$ for file in *; do mencoder "${file}" -of rawaudio -oac lavc -ovc copy -o audio/"{file/%avi/}mp2";done
i also have this kinds of needs recently, and after long google search, i accidentally find a step by step guide on how to extract audio from MKV, MOV, MP4, WMV, AVI, MPG, VOB, 3GP, FLV, WebM, SWF, F4V, DivX, Xvid, ASF, RMVB, MVI, WTV, DVR, H.264, DV, MXF, AVCHD, MOD, TOD, MTS and etc at http://www.bigasoft.com/articles/audio-extractor-extract-audio-from-mp4-flv-avi-mkv-mov-wmv.html
It did help me to extract audio from mkv files and then allow me to save them as mp3, wmv, or wav
hope it also helps you