loading, one second please...

How To Clip And Crop An Avi Video

alexsandralyn By alexsandralyn on
Badge: Advisor | Level: 17 | Computers & Laptops Expertise:
Image for How to Clip and Crop an AVI Video

Whenever I take a photograph, I use a JPEG photo editor to zoom in on the subject of my photograph and crop out the rest, and then I resize the photograph. And I wanted to be able to do the same thing with an AVI movie that I took with my digital camera.

Now this demonstration example that I'm using happens to be a really bad digital camera AVI video of me singing a Beatles song into my CRT television set that led to a really good question about AVI editing. Could I somehow remove the gray box of my television set from the AVI movie and just see the television screen?

There is a very good, open source, freeware AVI editing program that's called VirtualDub 1.9.8 that can do the job. VirtualDub 1.9.8 will work on 32-bit and 64-bit Windows platforms (98/ME/NT4/2000/XP/Vista/7). I downloaded VirtualDub-1.9.8.zip from SourceForge.net. I thought I would need a zip utility such as WinZip or the freeware version of StuffIt Expander to extract these compressed files, but it turned out that I could extract the compressed files with Windows Explorer just by right clicking on the zip folder and selecting open. To run VirtualDub 1.9.8, open the extracted VirtualDub-1.9.8 folder and click on the VirtualDub.exe application file.

What opens up when you first start VirtualDub is an empty screen. Go to File in the menu and select "Open video file...", then choose the video that you want to edit. My original AVI video is 376MB and 3 minutes 17 seconds long. See photo 1. I really don't want that green screen at the beginning of the video, so I'm going to move the slider bar that's just below the video to find the frame that I want to start the AVI movie with, and then mark that spot at frame 200 with the first of the black tab buttons. See photo 2. Then I'm going to move the slider all the way to the right to find the exact frame where I want to end the AVI movie and mark it with the second black tab button. Then I go to Edit and click on "Crop to selection". See photo 3. This is actually known as clipping the movie, not cropping it.

I still want to remove that gray box of a television set from my AVI movie so that I can just view the colorful screen. And to do that, I need to go to the Video menu and then click on Filters. There's nothing in the Filters screen yet and the Cropping tab is still grayed out without a filter in place, so I need to click Add... to find out all of the different things that I can do to my AVI movie with the VirtualDub program. I actually don't want to make any changes right now to my AVI movie, but I'll add a harmless brightness/contrast filter just so I can open up the Cropping tab that I want to use.

This VirtualDub cropping function is very easy to work with. There are four offsets that represent the four sides of the screen: X1 left, X2 right, Y1 top and Y2 bottom. See photo 4. And all you have to do is just increase or decrease the offset numbers to view exactly what you want to see in your AVI movie and nothing else. See photo 5. Then I just click on OK when I'm satisfied. VirtualDub will then show me both the input video of my original and the output video that has all of the filtered changes that I made. See photo 6. I can go back in and delete any filter changes that I didn't like in the output video without ruining the original AVI movie input.

Now that I have the cropped section of the AVI video that I wanted, I need to resize it a little to make it codec friendly for the video players. So I go back to Video > Filters > Add..., and I'm selecting resize from the filter list. On the resize screen, I'm selecting "Letterbox to aspect ratio" to keep my edited video at roughly the same dimensions as the original, and "Multiples of 16" so that this movie will play well with all movie player codecs, and I'm leaving everything else as it is in the default values. This will make minute pixel adjustments for me that will polish the cropping work that I just did. And I just want to view and preview the new work by itself for a minute, so I'm going to View > Pane Layout, and I'm going to select "Output pane only".

Now if I was to try to save this edited AVI movie at this point without first compressing it, I would end up with a 2 GB file for a 3 minute movie. And I discovered this by going to File and selecting "Run video analysis pass". The main tab of "Run video analysis pass" will give you the "Projected file size" given your currently selected compression codec. To compress the AVI video before saving it, go to Video > Compression and select a codec that best fits with your needs. The Cinepak Codec by Radius takes about 20 minutes to compress the 5000 frames of my 3 minute AVI movie, but I was able to retain 100% video quality and this codec had the smallest resulting file size of 223 MB. The Microsoft Video 1 codec that I tried had a very fast compression time of only a few minutes for 5000 frames, but I had to settle for only 80% of the video quality of the original file just to match the file size of the original file at 379 MB. So choosing a video compression codec is mostly a matter of trading processing time for video quality and file size. Using the "Run video analysis pass" function will help you sort out the best codec option from what's offered.

Once you've settled on a selected compression codec, then just go to File and select "Save as AVI" to begin the final compression. And from there, you can try out your freshly clipped and cropped AVI movie in your favorite movie player just by clicking on your saved file.

Update On Mar 11, 2010: The video sample is an 11 second clip of the really bad AVI movie of my CRT TV screen that I clipped and cropped for this article. To make the video clip small enough to fit with the 5 MB parameters of SharedReviews, I resized the clip to 60% of its original size, and I used the VP 61 Advanced Profile compression codec to make a 1.06 MB file without any video quality loss. I had to experiment a little before I found the codec that would work best for internet uploads.