How to edit .wmv videos on Linux using asfbin (UPDATED 12-16-09)
Thanks to a handy little command line utility called Asfbin, Linux users can edit .wmv videos without having to re-encode them. So your edited .wmv’s look every bit as good as the originals. Plus, asfbin is free and very fast at doing its work.
Getting & installing asfbin
Go to the download section of the Radioactive Pages and download the Linux AsfBin command line version. Extract the program from the zip file and place it in the /usr/bin directory. Chmod it something like 755, and you should be able to easily call the program from a terminal.
How to edit a .wmv video
Since this is a command line utility you are going to have to use another program to figure out where you want to make your edits. So I simply open my .wmv video in something like mplayer or vlc and write down the time points where I need to make the edits.
So say I have a 10 minute 5 second video long where I only want to keep the first 5 minutes and 23 seconds. Then the command to edit my wmv would be as follows:
asfbin-bin -i myvideo.wmv -start 00:00 -stop 05:23 -o my.edited.video.wmv
Note the above example assumes I am running the command in the same directory of the video I want to edit.
More complex edits
In this example let us assume we are editing the same 10 minute 5 second video, but this time I want to keep everything that happens between 02:13 (that’s 2 minutes and 13 seconds) and 04:01 (4 minutes and 1 second), and also everything that happens between 08:05 and 09:51. So now my command should be:
asfbin-bin -i myvideo.wmv -start 02:13 -stop 04:01 -start 08:05 -stop 09:51 -o my.edited.video.wmv
If you need to add more segments, simply add another -start/stop pair to the command. The syntax of this utility seems pretty easy to understand.
Running asfbin under 64 bit Linux systems
In the past I have had some problems running asfbin on 64 bit Linux systems — presumably asfbin is a 32 bit executable. The way I fixed this was installing the the ia32-libs package which provides a sub-set of standard Debian libraries compiled in 32-bit mode:
sudo apt-get install ia32-libs
This seems to work if you are using a Debian bases Linux distro like Ubuntu that has a ia32-libs package. I have no idea what to do if you are on a non Debian bases system. Let me know if you find a simple fix for 64 bit Arch Linux.
Thanking the author of asfbin
The author of asfbin has made a very useful tool available to the Linux community free of charge. So far as I know, there are no other linux utilities for editing .wmv files without having to re-encode. If you find asfbin useful be sure to thank it’s maker.
12-16-09 UPADATE: Fix for Ubuntu 9.10 (Karmic) on 64 bit systems
On my 64 bit Ubuntu Karmic system I was getting a “libstdc++.so.5: cannot open shared object file: No such file or directory” error when attempting to run asfbin-bin. Apparently libstdc++.so.5 was depreciated in Karmic so it takes more than just installing the ia32-libs package on 64 bit systems.
I found fix for this problem over on the Lets Bootstrap this World blog. Basically you extract libstdc++.so.5.0.7 from a deb package then create a symbolic link to libstdc++.so.5. Everything is working fine after doing this.