Cropping and Resizing

After your video material is loaded into Avidemux and is playing back correctly, and you can hear the sound, you can use the editing features in the program before you perform the output encoding. Often, if you're preparing video for the Internet, you have to reduce the resolution, change the aspect ratio, or cut it in length. Skipping this step may mean your video is edited or resized automatically by the video server, which can lead to unacceptable results. Suppose you have some digital camcorder footage shot with each frame 600 pixels wide and 480 pixels high. The screenshots in the following example are from a camcorder video shot underwater, courtesy of the www.xlighter.org web site (see Figure 11-7). They show the shipwreck of X127, a Royal Navy lighter sunk in 1942 at a harbor on the island of Malta, in the Mediterranean Sea.

Figure 11-7. Camcorder footage can be cropped, resized, and edited before encoding.

The camcorder footage has been burned to DVD, which has 720 pixels wide by 576 pixels high native resolution, without being resized. This has left a black border around the moving part of the video, although the pixels are in almost the same condition as when the video was in the camera.

Just as when you resize still images, adding extra pixels can't improve the quality of the original. If you aren't sure which resolution and codecs you're working with, choose File > Properties to open a dialog that provides details about the source material (see Figure 11-8).

Codec 4CC:

MPEG

Image

720 Jf 576

Aspcct Kdlio:

RAL 4:3(10:15

Frame Rate:

Z5.00Q fps

Frame Count:

43774 frames

Total Duration:

00:39:10.960

Global Motion Compensation:

No

Packed Bitstrea

m:

No

Quarter Pixel;

NO

3-1000 a ps; 192 Vbps

3-1000 a ps; 192 Vbps

\AriAbfe > Ho loidl [-"i.i'ixi 00 ."' l : 00B

Figure 11-8. The Properties dialog provides details about the resolution and codecs of the source video.

You could leave the black border and resize the entire 720x576 pixel frame to the size required by the video web site. Unfortunately, doing so leaves the moving part of the picture quite small; it's much better in this situation to crop before resizing. To do so in Avidemux, select Video > Filters from the main menu bar to open the Video Filter Manager window (see Figure 11-9). The first filter on the default Transform tab is Crop.

Figure 11-9. The Video Filter Manager offers a good selection of options for modifying the appearance of your project.

Double-click the Crop filter, and a Crop Settings window appears. Just below the preview of your video is a timeline slider control. You may need to drag this a little with your mouse to find the frames that need cropping if your video starts with a fade from black. Although it's possible to calculate how many pixels need to be cropped and enter the numbers in the four boxes under the timeline slider, Avidemux has a couple of features that make this task unnecessary. First, the crop has a bright green preview color, which means you can adjust the crop by eye (see Figure 11-10). To do so, click the small up and down arrowheads next to the values for Crop Left, Crop Right, Crop Top, and Crop Bottom.

335B1

Crop Left: 60 ;] Crop Top: [His crop Right: 0 k crop Bottom: 0

335B1

Crop Left: 60 ;] Crop Top: [His crop Right: 0 k crop Bottom: 0

Figure 11-10. Avidemux allows you to adjust crops by eye, using a bright green preview color.

Second, when you crop black bars, you can click the Auto Crop button in the Crop Settings dialog and adjust the result a pixel either way, if necessary, using the arrowheads next to the displayed crop values. If you make a mistake and want to start again, click the Clear button; otherwise, click Apply to make the crop, and click OK to close the dialog. The Video Filter Manager dialog lists your crop in its Active Filters window, at right. A short description of the filter's effect is displayed under the filter's name. You can click the Preview button in this dialog to check the result of the filters before going further. You can also click the Save button at upper left to preserve your filter choices for another time. Then, click Close to return to the main Avidemux window. The effects of the crop filter aren't shown in the main window, which may come as a surprise. Instead, any active filters are applied when you perform the export later.

Resizing is performed much the same as cropping, except that Avidemux offers a choice of two filters: standard resize and MPlayer resize, which is said to be faster. Using the MPlayer resize filter requires you to set the aspect ratio for both the source and destination files (see Figure 11-11). Then, you can use the resize slider control to set a scaling factor—for example, 80%. As you move the slider, compare the pixel numbers displayed in the Width and Height controls to the video web site's specification. If the Width is correct but the height is wrong, or vice versa, you need to go back to the Crop stage and decide whether to lose a few pixels from the top, bottom, or sides of the frame. Alternatively, you can leave in some black bars either side of the frame to preserve all of the original image. Just as when you're resizing still images, it's important to get the aspect ratio correct; people, in particular, will look strange otherwise.

Figure 11-11. Adjust the output frame pixel dimensions with the MPlayer resize filter. If you can't get the correct numbers, you may need to go back to the cropping stage.

Returning to the Video Filter Manager dialog, you can preview the results of each filter independently. Filters are applied in sequence from the top to the bottom of the list; in this case, cropping is first and then resizing. You can adjust the sequence of filters using the small arrow icon buttons beneath the Active Filters window (see Figure 11-12).

Figure 11-12. Check the filters that have been set up, and preview each one if required.

Was this article helpful?

0 0

Post a comment