Convert all FLV's in a directory to Ogg Theora (video)

for i in $(ls *.flv); do ffmpeg2theora -v 6 --optimize $i; done
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...
Sample Output
Duration: 00:00:37.87, start: 0.000000, bitrate: 48 kb/s
    Stream #0.0: Video: flv, yuv420p, 320x240, 12.50 tbr, 1k tbn, 1k tbc
    Stream #0.1: Audio: mp3, 22050 Hz, 2 channels, s16, 48 kb/s

  0:00:37.92 audio: 42kbps video: 83kbps, time elapsed: 00:00:06             
  0:00:37.87 audio: 42kbps video: 83kbps, time elapsed: 00:00:06   

What Others Think

The $(ls ) is superfluous; try: for i in *flv; do...
splante · 564 weeks ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? 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

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.


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: