October 20, 2004
This article was contributed by Dave Fancella
Transcode
(also available here),
is the knock-out punch of video processing tools under
Linux. What began life as an AVI-file transcoding tool has blown up
into a general purpose video processing tool that is capable of taking
virtually any video file and encoding it to any other video codec. If
you've ever tried to coerce
MPlayer
or its accompanying Mencoder into doing any sort of work, then you're
familiar with what transcode does on a small scale. Like MPlayer,
transcode does everything conceivable within its paradigm.
I stumbled across transcode under some interesting circumstances.
A year ago I tried to coerce Mencoder into making MPEG files that I
could image with VCDImager
so I could burn my collection of Hitchhiker's Guide to the
Galaxy TV episodes to SVCD. In doing so I downloaded a virtual metric ton
of
yuvscaler,
mpeg2enc,
and all sorts of other tools. I literally filled up my home directory
trying to build the toolchain that every Linux/SVCD How-To instructed
me to build. None of them built, and I wasted many hours at it.
More recently I was fooling around with
KDEnlive,
trying to determine on a whim whether or not I could actually edit
movies with it. I've entertained a fantasy about chaining the Back
in the Red series of Red Dwarf episodes into one long movie. After
wasting several hours by not reading the fine manual, I learned that
to work KDEnlive I needed input files in the venerable DV format.
Not knowing what DV was, I Googled it. DV, of course, is what your
digital camcorder gives you. Upon learning that, I went in search of
a tool that would convert the MPEG files I had to DV, so I could make
a poor man's Red Dwarf movie. I found transcode, and it appeared to be
the only tool that even came close to what I was trying to do at that
particular moment in time. So I started reading the documentation and
quickly discovered that transcode, with the help of only some of the
toolchain I had previously tried to build, would make the SVCD-compatible
MPEGs I needed to burn off my Hitchhiker's collection. I found
the missing pieces by doing a quick search
through the available Mandrake packages, and I completely
forgot about making DV files. Instead, three hours later I finally burned
my first SVCD in the first truly productive tangent I had taken in months.
It was the first episode of the Hitchhiker's Guide to the Galaxy.
I was amazed, to say the least. My wife had to physically stop me
from bouncing off the walls.
Transcode works by utilizing a heavy plugin-based architecture.
Everything transcode does is with a plugin of some sort. First it
decodes the video/audio stream to an internal format. Then you can
have it process the stream internally, if you wish. Then it streams
to an output plugin where you can do additional processing before/during
the final encoding.
This web page has a pretty picture
that's worth a lot more than a thousand words.
The transcode documentation is fairly thin if you don't already know a lot
about video processing, but it is pretty complete otherwise. There
are numerous man pages for each tool bundled with transcode, but there
isn't a lot of information on the web to help you get started.
Conversely, there are two mailing lists specifically for transcode that
will help you solve virtually any problem you encounter, and there are
also several Linux distribution mailing lists where you'll find most of
the problems you may encounter already solved. After reading the
documentation, I realized I hadn't actually learned anything. This is
mostly due to the fact that I know next to nothing about video processing.
I can list a few codecs and almost know what I'm talking about, and
I'm fairly well acquainted with the standards for VCDs and SVCDs.
I can also use the word "multiplex" in a conversation and sound like
I know what it means. Other than that, I felt like I had been drop-kicked
into a rugby match. So I went looking for the idiot guides and found
them. They are thin on details, but thick on command line examples,
so I was pretty confident I could convince transcode to make my SVCD
for me. I also felt pretty certain I knew exactly what I needed to
make it work.
Armed with this new information, I searched my package manager looking
for the mjpeg-tools that I had previously wasted so much time trying to
build. I didn't expect to find them, so it was a happy surprise that I
only had to install a package rather than build a tool chain. Then I
searched for VCDImager
and cdrdao,
the two tools you need to build and burn an SVCD image.
I still had to build the multiplexer, but luckily this time it built and
installed without any trouble. I finally felt like I was ready to make
an SVCD, and at long last I thought I was finally going to see if the
light at the end of the tunnel was really a train. I estimated that I
was only about halfway through the process at this time, figuring it
would still take me at least as long to figure out how to get each tool
to do its part.
I was really wrong about how much time I had left on this tangent.
Using the provided command line examples for transcoding an AVI file
to an MPEG file compliant with the SVCD standard was a matter of copy,
paste, and light edit. Then I waited about an hour for my slow-as-lava
machine to finish working on it.
Next, I ran VCDImager with a command line created by doing a
simple copy and paste operation.
I followed that up with another feat of
middle-clicking the terminal, waited another half-hour and then told
my 4 year old to put the CD back in the tray, it was done.
Then I relaxed, got some iced tea, grabbed two of my kids, and sat back
to watch Arthur Dent lay in front of the bulldozer and pat myself on
the back for doing such a good job of copy and paste.
Transcode is an interesting tool. It builds
easily without dependency problems. It is also provided in packages
for most distributions. Packages are available for
Fedora, SuSE, and Gentoo. I assume Debian packages are available, I
generally assume Debian has a package for anything I find until proven
otherwise.
Google even showed me a
fink package for it.
I was mystified, however, by the fact that I had never
uncovered this tool before.
I had literally spent days searching for something to convert my
AVI files to SVCD-styled MPEGs and turned up nothing. The best I could
hope for was a bash script bundled with MPlayer that probably only works
on the machine it was written on. So I Googled transcode and turned up
the kind of search results that tell you its time to bury the tarball
with a nice-looking headstone. Upon taking a closer look I found that
most of what I was seeing was recent, and there is even transcode news
on both of its homepages that are recent enough to indicate vitality.
I can't account for how it seems to have just appeared like it fell
through a wormhole from another dimension in time to send me careening
back into the tunnel which can only end in a train.
Transcode is about as full-featured as you
would expect from a solid command-line video processor. It supports
every codec under the sun, both as input and as output. This support
includes MPEG (all flavors), still pictures, Ogg Theora, DivX, Xvid,
QuickTime MOV, and more.
Transcode's supported audio formats includes PCM, AC3, Ogg
Vorbis, MP3 (with Lame), and others.
The maximum video resolution transcode will work with is 1920x1088.
It also comes with a bunch of
tools that fulfill a number of uses, such as merging/splitting AVI files,
fixing broken AVI files and indexes, and probing media files so you can
determine the best way to encode them. You can rip DVDs with it, even
encrypted DVDs using the controversial
libdvdcss.
Since transcode supports DV files, you can take your home videos and
transcode them to SVCD MPEGs to burn and send to your friends and family.
You can put images in the finished file just like your least favorite TV
station, and you can even try to remove images other people have placed
in the file.
Transcode is extraordinarily powerful, and when it comes to transcoding
a video file from one codec to another, it's second to none. If you need
to do anything of this sort, I recommend giving it a spin.
(
Log in to post comments)