Letterbox, you morons!

You probably remember my rant about letterbox on ffmpeg. Or the lack of it. Anyways, I decided to try a number of encoder apps to find the one that suits my needs best. I tried about 6-7 apps under Windows, 2-3 apps under Unix and 4 apps on OSX. And guess, what. *None* of them supports automatic letterboxing. In the best case, 1-2 apps provide manual padding (the user has to manually enter the number of pixels required to pad all the way to the requested resolution) and in the worst case that’s completely broken and results in a weird shaped video (e.g. MediaCoder v0.6). But you know, I can’t hold anything against these apps because at least they did try to provide a half-assed letterbox support, recognizing that there is such a need in the market.

My problem is with the rest, *the bulk* of the encoder apps that simply do not offer the ability at all. Which means that if I have a widescreen movie and I need to turn it into QVGA so my phone can play it (most phones only support specific video resolutions, e.g. 176×144, 320×240, 128×96), I would end up with a whacky aspect ratio that makes all the actors’ heads look like snake eggs. Have these morons ever asked their users what they actually need or do they just implement a dumb front-end to an encoder during the weekends?

The BEST user interface for an encoder that simply does the job so incredibly well, is QuickTime Pro’s. Problem is, Quicktime’s encoder quality sucks compared to x264’s, which is why I tried to find an alternative. You know, we have quite a few friends who happen to be ex-Apple engineers and who have mentioned how bad and messy the Quicktime source code is. But man, speaking as user, the damn thing WORKS as I expect it to.

13 Comments »

memson wrote on April 23rd, 2007 at 2:00 AM PST:

> Besides, even if we all get proficient in Bash, the Windows
> users are still in the cold.

Cygwin would handle most of this (bash, scripts and possibly even building of tools from source.) I’m quite amazed how good Cygwin is. I used it to mess about with a SDK for my Zaurus – with full “emulation” of the QTe environment using the rootless Xserver. Usually, you’d need LINUX for this. If only the Cygwin shared memory was a little less flakey.


William Eggington wrote on April 23rd, 2007 at 2:06 AM PST:

Ahead Nero bundles in a little encoder that I have found to work quite well for cross compatible .mp4 and it has an automatic “letterbox” square pixel option in its re-sizing.

Nero Recode. Link


Dave wrote on April 23rd, 2007 at 5:26 AM PST:

The real problem is that the players don’t know how to deal with the aspect ratio which is encoded right there in the file for them to read. All the desktop-based players know how to do it. I ended up writing scripts to do the padding for both my TiVo and my N80 when I reencode.


This is the admin speaking...
Eugenia wrote on April 23rd, 2007 at 5:35 AM PST:

For a person who can’t write scripts to parse outputs, making a batch conversion of 10 videos at a time that have different original resolutions, adding the right amount of padding can be hell… Besides, even if we all get proficient in Bash, the Windows users are still in the cold.

What I tried to show with this blog post was that the letterbox absence is universal. Developers of encoders somehow forget about this feature…


This is the admin speaking...
Eugenia wrote on April 23rd, 2007 at 6:35 AM PST:

It seems that Nero’s approach is pretty good, only bad thing is, I need to install the whole thing. I had installed Nero a few years back and it hosed my internet connection (the AIM client stopped working for example). No matter how you put it, it’s a complex, big, piece of software, while I just need something small and simple to get by. Although I might retry Nero.


Fei wrote on April 23rd, 2007 at 7:29 AM PST:

Have you tried the x264 encoding component for quicktime? Is not really intuitive but maybe it can do the trick:
http://www003.upp.so-net.ne.jp/mycometg3/
Unfortunately this component generates .mov files. But i think you can convert those mov to mp4 easily from quicktime using mp4 export with passtrought for audio/video setting.
If that don’t work you can use the command line tool mp4box.


This is the admin speaking...
Eugenia wrote on April 23rd, 2007 at 7:47 AM PST:

First of all, please use HTML in my blog to represent links. Second, thanks for the link, but I need these addons for Windows’ Quicktime Pro. My Mac is very slow, it is not suitable for encoding, while my Windows PC (and my Linux laptop) are much faster.


This is the admin speaking...
Eugenia wrote on April 24th, 2007 at 2:14 AM PST:

>You do have to enter manually the padding, but that’s not too uncomfortable.

It actually is, because I want to do batch conversion, all through the night while I am sleeping. Videos are not all the same.

Also, Avidemux crashes all too easily. I tried it recently.


William Eggington wrote on April 24th, 2007 at 2:28 AM PST:

It is quite large and often does crazy “trying to sell you things” stuff like. . . when you press the “burn” button to encode your movie it always pops up a URL to some hardware you can buy that is Nero compatible. But. . . the files it creates are high quality, it is considerably faster than other encoders that I have used and its very in-expensive. I just did a search and. . . Is this too good to be true?


William Eggington wrote on April 24th, 2007 at 2:30 AM PST:

Luis wrote on April 24th, 2007 at 12:29 PM PST:

Probably the best free option is Avidemux. It’s available for both Linux and Windows, and it allows you to do what you want with good quality.

You do have to enter manually the padding, but that’s not too uncomfortable. Using the MPlayer resize filter, check the “16 round up” option and move the handle until you reach your desired size. If it says, for example, 176×96 and you want 176×144, you then know you have to “add black borders” (another filter) to fill the rest, i.e, 24px to the top and 24px to the bottom.

If you’re using a DVD file as input, choose 16:9 (or 4:3) as the source pixel size in the resize filter. If it’s an AVI file, leave it 1:1

The 2 pass encoding for x264 is slow, but gives very good quality.


Hugo wrote on April 24th, 2007 at 12:37 PM PST:

Virtualdub was supposed to get a new resize filter that should do this, i don’t know if it did though, i haven’t used virtualdub for a while.


Domas wrote on April 28th, 2007 at 12:21 PM PST:

I’ve done something like this:

mencoder “input.avi” -nosound -ovc lavc -lavcopts vcodec=h264 -vf scale=320:-2,expand=320:240 -o movie.avi -ofps 12 -quiet

mplayer -vo null -ao pcm:file=”movie.wav” -af resample=8000,volume=+16db:sc “input.avi” -quiet

ffmpeg -i movie.avi -i movie.wav -vcodec h264 -b 200 -ac 1 -ab 50 -map 0.0 -map 1.0 movie.3gp

rm movie.wav movie.avi

It does letterboxing correctly. Videos seem fine on my Nokia 6233.


Comments are closed as this blog post is now archived.

Lines, paragraphs break automatically. HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

The URI to TrackBack this blog entry is this. And here is the RSS 2.0 for comments on this post.