Commands tagged html5 (2)

  • Streaming HTML5 compatible video (Ogg Theora video with Vorbis sound) to an Icecast server using dvgrab, ffmpeg2theora and oggfwd. In this example I'm merging stereo sound to mono (-c 1), saving the original dv for later higher quality on-demand video (tee dvstream.dv), saving the theora stream for immediate on-demand video, and publishing the stream in Xiph's stream directory (-p and the name and description). The URL of the video will be (depending on your server) http://my.icecastserver.com/stream.ogv which will play in newer Firefox, Chrome and Opera web browsers. Cortado (a Java player) can easily be used for IE. Note also that I'm using port 80, which is not the default port for Icecast, this is to avoid restrictive firewalls. Also note that ffmpeg2theora 0.25 and will heed the bitrates much better than former versions because of using libtheora 1.1 or newer.


    4
    dvgrab --format raw - | tee dvstream.dv | ffmpeg2theora -A 45 -V 400 -c 1 -f dv -x 360 -y 288 -o /dev/stdout - | tee savelivestream.ogv | oggfwd -p -d "Stream description" -n "Streamname" my.icecastserver.com 80 icecastpassword /stream.ogv
    dittaeva · 2010-05-25 11:23:46 4
  • 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... Show Sample Output


    0
    for i in $(ls *.flv); do ffmpeg2theora -v 6 --optimize $i; done
    joenjeru · 2010-12-01 14:13:31 5

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.

Share Your Commands


Check These Out

cleanup /tmp directory
Cleans all files in /tmp that have been accessed at least 2 days ago.

Find the package that installed a command

Quick screenshot
Requires ImageMagick. Takes a screenshot 5 seconds after it's run and saves it as desktop_screenshot.jpg Particularly handy when made into a menu option or button.

Download full FLAC albums from archive.org
The only zipped version of an album available for download is the lossy mp3 version. To download lossless files, because of their size, you must download them individually. This command scrapes the page for all the FLAC (or also SHN) files.

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

Want to known what time is it in another part of the world ?
available timezone can be found in /usr/share/zoneinfo. Other examples: $ TZ=Europe/Paris date; TZ=Australia/Sydney date; TZ=America/New_York date this is based on zoneinfo files on macosx. Your mileage my vary on other unix dialects

pipe output to notify-send
you can put almost any command. $notify-send -t 0 "MOTD" "$(sed -n '/#^4/,/#$4/{/#^4\|#$4/!p}' motd2 | cut -d# -f2)" $notify-send -t 0 "readfile" "$(while read mess; do echo $mess;done < motd2)"

Show when filesystem was created
Knowing when a filesystem is created , you can deduce when an operating system was installed . find filesystem device (/dev/) informations by using the cat /etc/fstab command.

List the Sizes of Folders and Directories
I wanted an easy way to list out the sizes of directories and all of the contents of those directories recursively.

Loops over files, runs a command, dumps output to a file
In this case I'm selecting all php files in a dir, then echoing the filename and piping it to ~/temp/errors.txt. Then I'm running my alias for PHPCS (WordPress flags in my alias), then piping the PHPCS output to grep and looking for GET. Then I'm piping that output to the same file as above. This gets a list of files and under each file the GET security errors for that file. Extrapolate this to run any command on any list of files and pipe the output to a file. Remove the >> ~/temp/errors.txt to get output to the screen rather than to a file.


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: