Transcode - The video transcoder to rule them all
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.
Index entries for this article | |
---|---|
GuestArticles | Fancella, Dave |
Posted Oct 21, 2004 8:39 UTC (Thu)
by lolando (guest, #7139)
[Link] (1 responses)
Posted Oct 21, 2004 14:38 UTC (Thu)
by NAR (subscriber, #1313)
[Link]
And they worked for me when I had the same situation as the author of the article (i.e. creating SVCDs from AVIs and the script bundled with MPlayer didn't work).
Posted Oct 21, 2004 13:08 UTC (Thu)
by smeg4brains (guest, #207)
[Link]
When I last tried to use it (at least a year ago), it was very difficult to tell which options were referring to which stages of the process (incoming/input, internal, outgoing/output). Mplayer by contrast, always figured everything out for the input side, and had a nice simple -vop -aop to specify the output video/audio plugins and their options. Transcode literally had hundreds and hudreds of switches, all of which had vague or missing documentation.
For my purposes, mplayer is usually a much better tool, just because of it's simplicity. There are only about 3 things I'd ever want to do with a video. 1) make a quick svcd: The shell script that comes with mplayer always worked just fine for me, once I grabbed 2 or 3 things it needed using apt. 2) make a dvd: There is a pike script out there (written by the author of pike) called mkdvd.pike or something like that. It's a dream come true for simple dvd creation. Give it a list of files, a couple a switches to tell it what image to use for the menu background etc, and out comes a dvd.iso file. It uses mplayer as the back end, of course with a few other toys required.. But once again with atrpms/apt they're a synch to install. 3) convert it to a reasonable format for saving (divx?): google -> "mencoder examples" -> I feel lucky.
Kino also works very well for the dv editing side, and will export to dvd/svcd/vcd/etc formatted files, right from the gui.
Transcode is a great bit of software. Lots of projects use it as a back end, and it does a great job of actually handling the video. Someone needs to write a wrapper or something though that makes it more usable from the command line. Maybe the documentation has improved (I hope it has) since I last used it. The author of mkdvd.pike was going to have a switch to allow you to use transcode as the backend instead of mplayer, but he could never figure out all the transcode options to properly support the switches in his script... and let's face it.. He's no slouch.. he did write his own programming language at some point.
Posted Oct 21, 2004 15:31 UTC (Thu)
by stock (guest, #5849)
[Link]
Robert
Posted Oct 21, 2004 19:39 UTC (Thu)
by pivot (guest, #588)
[Link]
Posted Oct 25, 2004 10:32 UTC (Mon)
by alex (subscriber, #1355)
[Link]
The gotcha on mencoder is the default output format is AVI (which confuses vcdimager) even if your copying a mpeg stream to fix the errors. A simple -oaf fixes this.
For anyone interested I keep track of various command lines on my wiki page for easy reference:
http://www.bennee.com/~alex/wiki/index.php/mencoder
Still it never hurts to have more than one free software tool for these sort of things ;-)
Posted Oct 28, 2004 17:10 UTC (Thu)
by Marrakesh (guest, #25726)
[Link] (1 responses)
I really like the command line, but for things like cutting away advertisements or black borders or setting codec options I really prefer a nice graphical gui with a real time preview of what I really am doing.
Is there such a thing available for Linux? Up to now I find myself pressed to use Windows only programs for these tasks :(.
Posted Nov 15, 2004 23:57 UTC (Mon)
by barrygould (guest, #4774)
[Link]
Transcode uses some codecs that are either non-free or patent-incumbered, and can therefore not be included in an official Debian release. There are, however, unofficial packages by Christian Marillat available (at ftp://ftp.nerim.net/debian-marillat/ and below).Transcode in Debian
there are, however, unofficial packages by Christian Marillat available
Transcode in Debian
It's been a while since I've messed with transcode, so things may have changed, but the one problem I had with transcode, was very poor design of it's syntax/switches. When you've got something that has 4.2 million different ways it can be used from the command line, it's very important that you design a syntax that is both machine, and human parsable. Transcode - The video transcoder to rule them all
yes this surely looks like a winner, but it gets even better: Add your
dual Opteron or AMD64 iron with a native X86_64 build Linux distro : from
the Changelog :
http://www.zebra.fh-weingarten.de/~transcode/pre/ChangeLog :
Transcode - The video transcoder to rule them all
transcode-0.6.12
* Terse/less technical ChangeLog:
Changes:
o tccat: use '-T 1,-1 -P' instead of '-P 1'.
o --avi_limit option: Defaults to 0 (disabled) instead of 2GB.
Fixes:
o avilib: 64bit issues and other compiler support. <=======X86_64
o v4l: building with linux-2.6 headers.
o xvid import: check for more library sonames.
o dvd import: The DVD device may be a char device (osx).
o im import: segmentation fault at closing time.
o tcrequant: upstream bugfixes.
o xvid import: fix library loading on MacOSX.
o dv import: Do NOT apply a setup when decoding the DV frame. Last
frame was skipped in NTSC.
o yuv4mpeg import: read files produced by streamer.
o -c option: rounding error, only 99 frames of 100 for NTSC.
o make distcheck: correct inclusion of config.h file.
o libavcodec: building without mmx.
o maintaining: included sdl.m4 and glib.m4 in acinclude.m4
New:
o avilib: Writing AVI 2.0 (OpenDML) files.
xine (with my submitted patch) plays such files nicely.
o denoise3d filter: very fast denoiser.
o fraps import: decode AVI files from www.fraps.com.
o v4l2: reading from a video4linux2 device.
o control filter: read and executes a control "script"
o ffmpeg import: DV raw decoding support (-i file.dv -x ffmpeg).
o sh import: executes the input file and reads its output.
o mp1e export: module based on mp1e, a mpeg1 encoder.
o os: Support for AMDs x86_64 architecture. <================X86_64
o --export_par option: sets the pixel/sample aspect ratio.
o script: bash completion for transcode with tccomplete.source.
o docs: layout fixes so it will look good on www.transcoding.org
o ffmpeg export: new codecs namely ffv1, asv1 and asv2.
o --export_prof option: sets mpeg "profiles" so that transcode
tries can be smart and guess clipping and zooming options.
o docs: DV to DVD HOWTO including scripts.
Linux is starting to move ahead in the 64bit Multimedia and Workstation
world. Another nice commandline driven script is tovid which can be found
here :
http://www.linuxquestions.org/questions/showthread.php?s=&threadid=190354
and here : http://tovid.sourceforge.net/
What about an article about the various PVRs available for linux, MythTV, VDR and freevo?Transcode - The video transcoder to rule them all
The main difference is documentation. The mplayer documentation has it all there (although I wish it had more actual examples). It was frustrating getting going and I tried the various GUI frontends to little avail. However once I had actually read through the documention I was able to come of with some command lines that work and everything has been good since.I still like mplayer/mencoder
Working with videos is a highly graphical thing.GUI?
Film Gimp is supposedly a GUI-based video editor.GUI?
(I haven't tried it myself.)