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.
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:
Errors in output don't matter. Stop recording: ctrl-c. Result playable with Flash too.
IMPORTANT: Find a Pulse Audio device to capture from: pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2
Certain Flash video players (e.g. Youtube) write their video streams to disk in /tmp/ , but the files are unlinked. i.e. the player creates the file and then immediately deletes the filename (unlinking files in this way makes it hard to find them, and/or ensures their cleanup if the browser or plugin should crash etc.) But as long as the flash plugin's process runs, a file descriptor remains in its /proc/ hierarchy, from which we (and the player) still have access to the file. The method above worked nicely for me when I had 50 tabs open with Youtube videos and didn't want to have to re-download them all with some tool.
Gives stereo, 16bit, 44.1kHz (default in Ubuntu/Medibuntu ffmpeg).
-aq 2 = 220-250kbit/s VBR, lower number is better quality. 2 or 3 should be good for most people. If you want the best mp3 q you should remove -aq and use -ab 320k to get 320kbit/s, but that is probably overkill for most .flv videos.
Do you have a large library of flv's you have picked up over the years using FlashGot Firefox plugin?
Do you want to be able to convert them to Ogg Theora (video) at once?
Try out this script...
Creates a 5 minute flv file, with the given sequence of images and audio with 0.5 fps.
The images were created using the following command:
for x in `seq 0 300`; do cp ../head.PNG head-`printf '%03d' $x`.png; done
You can also inject metadata to seek easier using yamdi as follows:
yamdi -i muxed.flv -o video.flv
I'm not well enough versed in the differences between ffmpeg & mencoder to know which one is better.
Create subtitle file heading.ssa with just one entry for the entire video duration. Command line sets that entry's text on top of the video as text watermark. If text is an URL works nice for sending people back to your site from a YouTube clip. Output file is lossless encoded and suitable for further processing. Subtitle file can be a URL so it's saved remotely.
Gives MPEG-4/DivX output video file ready for uploading to YouTube from FLV file downloaded from the site and your own subtitle file UTF-8 encoded. No resizing needed. (?)
I wanted all the 'hidden' .flv files from the http link in the command line; wget seemed appropriate, fed with output from lynx, grep the flv files and the normalised via sed (to remove the numeric bullet). Similar to the 'Grab mp3 files' fu. Replace link with your own, grep arg with something more interesting ;) See here for something along the same lines...
Hope you find it useful! Improvements welcome, naturally.
This converts all m4a files in a dir to flv. You can just swap the m4a bit to anything else ffmpeg supports though, and it'll work.
This is handy for making screenshots of all your videos for referring to in your flv player.