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.
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:
Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:
Useful for when you download movies split into < 700mb parts.
mencoder is generally included with mplayer.
sudo port install mplayer
Most of the commands require the jpegs a certain format, not this, it just follows alphabetical order. The same order you follow if you do "ls -lisah" from top to bottom, top frame is first, bottom is last...
This goes perfectly with a webcam timelapse... I have just the script for it:
Takes two input video files and an external audio track and encodes them together to an MPEG-4 DivX output video file with the correct size ready for uploading.
MEncoder can create MPEG (MPEG-PS) format output files. Usually, when you are using MPEG-1 or MPEG-2 video, it is because you are encoding for a constrained format such as SVCD, VCD, or DVD.
To change MEncoder's output file format, use the -of mpeg option.
Creating an MPEG-1 file suitable to be played on systems with minimal multimedia support, such as default Windows installs:
mencoder input.avi -of mpeg -mpegopts format=mpeg1:tsaf:muxrate=2000 \
-o output.mpg -oac lavc -lavcopts acodec=mp2:abitrate=224 -ovc lavc \
The following will take frames starting at 15.2 seconds for a total of 45.9 seconds:
mencoder -ss 15.2 -endpos 30.7 -oac copy -ovc copy mymovie.avi -o myeditedmovie.avi
Keep in mind -endpos is the total time, i.e. the output video in this is 3 minutes 3 seconds in length:
mencoder -ss 1 minute -endpos 2 minutes 3 seconds -oac copy -ovc copy mymovie.avi -o myeditedmovie.avi
Reencodes to MPEG-4 DivX output video file from step 1. Audio stream is simply copied. Resizes to 320x240 and deinterlaces as needed. A heading subtitle file is applied as watermark. This heading subtitle file can be a URL.
Rips DVD to lossless encoded video file. Reencodes audio to CBR MP3 for correct audio to video syncing. Be sure to have enough free disk space.
Rip DVD to YouTube ready AVI file, using MPEG-4 video codec and MP3 audio codec. Resizes to 320x240 and deinterlaces as needed.
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.
Record audio to MP3 stream and video to MPEG-4 stream from webcam to AVI file using mencoder. Gives floating point exception in some mencoder versions.
Extracts an MP3 encoded audio stream from an input video file.
Creates a new video file with video stream copied from input file and a different audio stream
Remove sound from input video file, output video stream is copied from input video stream, with no audio.
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. (?)
First, we convert the VMware avi (VMnc format) to the Microsoft avi format. Next, we convert the Microsoft avi format to FLV format.
You can play around with the -r switch (rate per second) and the -b switch (bitrate). But, if those get larger, so does your FLV file.
This set of commands will rip a dvd title using a 2 pass mencoder xvid encode. It will provide a great quality rip. It will rip as close to 700MB as possible. (note the bitrate of -700000)
Encode video.avi into newvideo.avi using the libav codec to produce an MPEG4 file with a bitrate of 800
video.avi is the resulting file. Press Ctrl+c to stop the recording. You can change the OVC option to another to record into a different format.
When playback of AVI files (containing a video format like XviD or DivX) is stuttering, it in 90% of the files is caused by a poorly or wrongly interleaved file. The issue can be permanently resolved by RE-MUXING the AVI video-files that have this problem