I was getting tired of having to go back and forth between tools and properties when wanting to convert Windows Media Videos to a better format. So I wrote a script that took me all day…
Depends: ffmpeg, libimage-exiftool-perl, zenity, awk, grep, idvid (from package tovid) and various codecs.
The point of the script is that it gets the info from the input file, shoots it back at you, and gives you the ability to set some variables for the ffmpeg conversion.
There are a lot of apps that does more or less the same, but they (the ones I’ve looked at), opens the whole video, and uses a lot of resources. I just wanted to twea a few easy steps.
Plans: I’m probably not going to use a lot of time on this, but it would be nice to make a list of all possible ffmpeg options, and letting you set every one of them, based on info from the input file. This, I will probably do, just as a small learning experience for myself.
Installing: Simply download the file for current version
You can save the file anywhere you’d like, but it’s useful to:
sudo ln -s /path/to/wmv2avi /usr/bin/wmv2avi
That way it is collected in your command archive, so you can just run it with wmv2avi
You might have to:
chmod +x wmv2avi
in order to get it to run.
Adding needed dependencies:
- Add universe and multiverse to you repositories. See help.ubuntu.com for more information on how to do that.
deb http://medibuntu.sos-sts.com/repo/ feisty free non-free
to your /etc/apt/sources.list. GPG-keys for that repo, do:
“wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add – && sudo apt-get update”
(Without the qoutes) in a terminal. See medibuntu.sos-sts.com/repository.php for more information.
- Now, make sure you have all packages. Do:
“sudo apt-get install zenity grep awk libimage-exiftool-perl ffmpeg gstreamer0.10-pitfdll w32codecs gstreamer0.10-ffmpeg gstreamer0.10-fluendo-mp3 gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse lame liblame0 toolame”
(Again, without the qoutes.) This brings in all needed packages, and then some. You’re bound to have some of these from before. Note: ffmpeg from medibuntu includes mp3 support. You should have that, but it violates patents in some countries.
Gotcha: When you run the script, after you pick the file, you get an information dialog that stays up until you close it. The script continues, but the next dialog (video title) is hidden beneath the info dialog. Just move it to the side to focus on the next dialog.
Note: There is now only one file!
New in v0.1.20070817:
- We don’t need an idvid_grep-file. We can just create the file from within the script
- Quotation marks around the variables in the main command is crucial. What if someone puts in a [space]
- Added back the comment variable, after realising I fucked up #2 and fixed it. (spaces was the key)
- Added a warning that fps is sometimes read really, really wrong.
New in v0.1.20070816:
- First version made