Crop Video During Playback

Get rid of those annoying black bars at the top and bottom of movies using special features from MPlayer.

For the longest time, I was living in a 4:3 aspect ratio world and I didn’t even know it. When I watched a VHS movie on the television, I didn’t know that parts of the image had been cropped or what “pan and scan” was. As I got older and DVDs came out, I noticed that they often had widescreen and fullscreen options, and I finally started to understand that movies generally have a widescreen aspect ratio (such as 5:3 or 16:9) that, when displayed correctly on a TV, results in black bars along the top and bottom.

Of course, when playing back a movie on the computer, most video players adjust their size so that all you see is the movie without any black bars (until you fullscreen the image at least). However, if you watch a VCD or SVCD (videos formatted so that they can be played off of a CD in many modern DVD players) on the computer, the black bars are part of the image and are there whether you watch at fullscreen or not. My laptop’s display has a widescreen aspect ratio (5:3) so it’s perfect for watching DVDs—especially on a plane trip—but when I play back VCD or SVCD files fullscreen, I get large black bars and an even smaller video (Figure 3-1). My widescreen display goes to waste. I found that with a few simple command-line tweaks to mplayer, however, I could crop those black bars from the top and the bottom so the video would completely fill my ...

Get Linux Multimedia Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.