O'Reilly logo

Linux Multimedia Hacks by Kyle Rankin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #68. Resize a Video

Use the powerful transcode utility to resize videos completely from the command line.

Normally, I don't find myself resizing videos. After all, you end up losing video quality if you lower the resolution, and usually I want to watch a video in the highest possible quality. However, there are certain instances where it can be useful to resize a video. One main reason people resize videos is simply to lower the file size. Each pixel in a video takes up space, so resizing a video is one good method for lowering the file size. Also, more and more portable devices are now supporting video playback. Since these devices often have screen resolutions of 640 x 480 or lower, they don't typically support playback of videos larger than their native resolution.

transcode is a versatile tool when it comes to video conversion, and [Hack #63] provides examples of conversions between video codecs using transcode. This hack takes that process a step further and uses transcode's video-resiz-ing options. Because this hack uses transcode exclusively, you will definitely need to install it on your system. [Hack #63] explains transcode installation.

There are three primary arguments that transcode uses to resize video: -B, -X, and -Z. The -B and -X options are complementary—the -B option shrinks video resolution while -X increases video resolution. Both options perform a fast resize on the video, but have some rather particular requirements to use. The main requirement is that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required