Blender Multimedia

by Malefico



Editing our videos and adding sound using only GPL tools is a matter of patience

The secret charm of not paying

Besides being an excellent modelling an animation program, Blender is quite a nice video editor. It supports AVI, AVIJPG and let us add static images like TGA or JPG in our videos (very useful for credits screens or compositing jobs). However a very important feature has been missed by Ton & Co, this is adding a sound track to our animations. This feature was not available till the appearance of Blender Publisher 2.25, the commercial branch of Blender. Interesting coincidence.

Those of you who are legal owners of a copy of this software might now want to surf another site since you won't read anything of interest in this article. The rest of you, poor mortals (like me) could benefit from the knowledge I acquired after long hours of surfing the web and testing software in the search of getting sound in my videos without spending a cent.
To add sound FX, music and stuff you can use a number of excellent commercial applications ranging from Adobe Premiere (under Windows) to MainActor (both under Linux and Windows). However not only the rich and pretty can enjoy an AVI with sound.

The ammount of software I have downloaded plus the time it consumed to compile them, counting software, libraries, codecs and more things, have already paid many commercial licenses of Adobe Premiere, but I never gave up, HA !

There are several free GPL tools either for Linux or Windows for our pleasure. These are VirtualDub for Windows (though it works flawlessly using WINE under Linux), which was freeware for non-commercial use for long time and had recently became GPL, and Broadcast2000, a powerful, GPLed, audio and video editor available for Linux.

Broadcasting Blender

An excelent video and audio editor which gained fame in the linux multimedia world is (or was) Broadcast 2000. This soft of professional quality can read and write audio in WAV and MP3 format, as well as Quicktime videos compressed with several schemes (JPG, DV, YUV, etc). It was available at HeroineWarrior but the authors have put it out of public access because of legal paranoia.

So, why do I bother writing about this ? Good question Watson. The reason is that there is a community which continued Broadcast 2000 development and not only kept it available in the web but also hacked the original code adding to it several interesting and convenient features. One of such versions is Broadcast2000c MF2. Its source code as well as the original code can be downloaded from here. This hacked version can write video using Open DivX compression and also reads from OGG Vorbis audio files.

So we'll download and compile the software as a first step. Compilation shouldn't be an issue to the average linux user even when the source code doesn't bring the usual "configure" script the Makefile is well written and should work OK without trouble (remember: as user root type 'make' and then 'make install'). Once finished installation we could start it by typing "bcast" in any X terminal.

However it is not adviseable to load a Blender AVI file from Broadcast2000. All you'll get is a hundred of audio tracks and maybe an application crash. The reason for this is that Broadcast2000 and hacks, work with video in Quicktime format or lists of JPG images. That's why in order to use our AVI files we have to convert them to Quicktime or alternatively render the animations as JPG and then generate a jpglist. To convert to Quicktime, best solution is to use the miraculous GMerlin which will let us read an AVI and save it as Quicktime with whatever compression scheme we may want and even load a WAV in the meantime. If we are reluctant to download and compile the package (~ 5MB) we can always choose to create a JPG list.

To do this the first thing we should do is to render our animation in Blender using the JPG format. This will render every frame as a JPG image in the folder we indicate in the Pics box (render buttons). It is smart to create a special folder to store frames for each animation we're going to render instead of using an common folder.

When we'll click on the ANIM button the images will be rendered and saved in the hard disk as files with sequential names (my_anim_0000, my_anim_0001, my_anim_0002 and so on).


After rendering the sequence we'll generate the JPG list in a text file. This can be done by manually editing a file including in it the names of all JPG files or more automatically by typing "ls > list.txt" in the folder containing the images.

For Broadcast2000 can understand and read this list, it must contain the following heading :

JPEGLIST # any comments after character '#'
24.000000 #frame rate used in Blender
640 #frame X resolution
480 #frame Y resolution

(...) and the filenames of the JPG images. It is better to write these filenames including the full path (like "/home/malefico/blender/image0001") or if using relative names, to start Broadcast2000 from the same folder the images are stored in.

JPG List

However if the animation is long we might prefer using a short script I wrote for your convenience (and mine), jpglistgen.sh, which will iteractively generate the god damn list. To use it, just copy it into the folder with the images, gunzip the .gz file (Winzip will do it too) and be sure there aren't any other files than the JPG files and the script in the folder BEFORE running it (otherwise that filename will be included in the list and Broadcast will try to load it).

Once the list has been generated (a text file called JPGLIST.TXT if we used the script or the manually edited file called "whatever"), we'll load it into Broadcast2000 with FILE -> OPEN as if it was an animation. If everything went right, we'll see the frames loaded.

Later we'll add the sound tracks using the menu FILE -> APPEND. As this is not a Broadcast2000 tutorial, I strongly recommend reading the documentation shipped with the sources to learn the editor use and abuse.
Once the audio edition is finished we'll have to render all together using the OpenDivX compression scheme. This will generate a MOV file (the Quicktime format) with OpenDivX compression.
This is not the same thing as having an AVI with DivX compression, but it's quite similar.
Last step is re-encoding this file to the more popular AVI DivX format. This can also be done with Gmerlin as above or alternatively with a very useful tool that is included with the MPlayer movie player, the MEncoder. This encoder will read the compressed MOV and then re-encode it using the DivX codecs we should already have installed in our system.

Same thing, easier

In Windows we can use VirtualDub which has the advantage of being capable of directly reading the Blender AVI file without any preprocessing making unnecessary the JPG list. Maybe with a little luck the linux users can enjoy a conversion given the fact that it has been GPLed. For the moment we have to conform ourselves using it thru WINE.
All we have to do is downloading the binary ZIP, unzip it in a folder WINE can see, and run "wine VirtualDub.exe" from an X terminal. This software is an excellent video editor though it's not as suitable for audio edition as Broadcast 2000. In fact, it will be needed to create our sound track using another software and then add it to our video track with VirtualDub and render.

Encoding can be done within VirtualDub too provided we have installed the necessary codecs for windows

Libraries, Codecs and other

If you reach this far you might have realized that the installed software would require a somewhat important number of auxiliary libraries. Particularly it wil be necessary to install: Quicktime4Linux, Avifile and the DivX and OpenDivX codecs. To handle sound our system should have the libraries Mad (audio MPEG decoder), OGG Vorbis, Libsnd (for WAV). It will be convenient to have installed SDL and some other derivated libraries like SDL_mixer, to use some video players in fullscreen mode.

Almost all of these components are already present in most of the modern linux distribution though upgrading of some of them might be necessary.

I hope this brief article has been useful for you and please show me your multimedia animations when you have them !