How to compress video
VIDEO ENCODING AND COMPRESSION BASICS
What is compression?
Video information is encoded in order to transport it over the internet and to deliver it to various kinds of video players. Along the way it is often compressed in order to make the file size smaller and more transportable. The more compressed the video is, the less quality is retained, and the more degraded the image usually becomes. Compression is always a compromise between quality and file size.
What is a codec?
The word "codec" stands for compression-decompression. A codec is a compression algorithm that is used to compress the video information at one end, using an encoding program, and decompress it at the other end for playback, such as in a video player like VLC, or Quicktime, or using a hardware decoder chip inside a DVD player. Basically it's the piece of software that makes your video readable by your computer and allows you to play it. Without the correct codec you won't be able to play the either the audio or video or both.
What is a format?
A format or "container format", is used to bind together video and audio information, along with other information such as metadata or even subtitles. You will of heard of things like .mp4, .mov, .wmv etc. These are all container formats that put the audio and the video together. For example an .mp4 might use the mp3 audio codec together with the h264 video codec, or an .avi containter might use aac audio with an xvid video codec.
What is a standard?
A standard, such as the MPEG standards set by the Motion Picture Experts Group, are a set of rules that video codecs and formats must be designed to adhere to. This standardisation allows manufacturers and software designers to anticipate the kind of video, audio and other information that their software, or microchips, will have to deal with.
For example MPG1 is used in VCDs, MPEG2 is used in DVDs. A new more advanced part of the MPEG4 codec, known as H.264, is set to become the standard that is used by the next generation of HD-DVD and other video formats and codecs.
Using Handbrake to create an Mp4 container with AAC audio and XviD video
Mp4 is a very common container format that a good number of computers should be able to play. It gives a quite good quality to file size ratio.
There are many different methods of compressing video for online distribution. This method will result in a video file that is of good enough quality to screen in addition to being watched on your audience's home computers. Most online video sites will create a smaller flash video preview version for you, so we'll be concentrating on creating a file of greater quality.
Many of the principles we use in this method are applicable to other methods you may use in future.
Start by using some video exported from your video editing system (FinalCutPro/Premiere etc.) as a DV PAL Quicktime, or open an already existing file you have, or open a DVD you have, with the Handbrake application.If you don't already have Handbrake you can download it here: http://handbrake.fr
Step 1 - Export Video as DV PAL
- Open FinalCut or Premiere project containing the video you wish to export
- Goto File menu and click Export>Quicktime Movie
- Export 10-60 SECONDS OF VIDEO AS TEST.mov from the timeline as a DV PAL MOV
Step 2 - Encode Video to Mp4 using Handbrake
- Open Handbrake
- Load video your file
- Destination: Select where you want the transcoded video file to be saved
- Give the file a good name that will help you easily identify it later. Appending to the name the bitrate value you saved it as is quite useful
- Choose target format MP4
- For video codec choose MPEG-4 (XviD)
- Choose framerate as PAL (25)
- Choose Video Bitrate between 1000-1500 kbit/s
- Select picture settings to change the size, deselect anamorphic
- Change video size to 640x480
- Select deinterlace (fast or slow is ok, depending on how much of a hurry you are in)
- Select the Audio tab and select AAC audio
- Leave the audio as stereo
- Sample rate at 44.1
- Bitrate at no less than 112
- Hit Start button and wait until video has finished encoding
- Check video file in VLC and compare it with others you have tested
- If you like the settings you are using you can save them as a preset by clicking the + sign in the bottom right
Alternative - Encode Video to xVid Using MediaCoder
- Open Media Coder
- Click button Add > Add File
- Select Video Tab
- Mode = Bitrate-based
- Enable Video = 1400 Kbps
- Format = XviD
- Container = AVI
- Select LAME MP3
- Rate Mode = CBR
- Bitrate = 128 Kbps
- Click Start
- Click Save As Preset
- Save this file as "xVid 720x576 1000k 128mp3"
- Check video file in VLC
Upload the video!