Video Compression Using FOSS
Note: Step 2 for Windows and Linux users are still incomplete - if users those platforms who participated in the workshop could fill in, that would be much appreciated.
This workshop assumes that you have basic video production skills, and have managed to produce, shoot and edit your film already, and are now at the stage where you're looking to distribute your finished product.
VIDEO ENCODING AND COMPRESSION BASICS
What is compression?
Video information is encoded in order to transport it over various networks and protocols, and to deliver it to various kinds of video players. Along the way it is often compressed in order to make the filesize smaller and more transportable.
Types of Compression
Two types of video compression, lossy and lossless compression, are achieved by using algorithms to manipulate and reduce the amount of bits in a video file. Lossless compression results in zero loss of video information in the compression process, similar to the way zipped files are compressed. This process can reduce filesize, but not usually by very much. Lossy compression results in the loss of video information that is not considered to be so important - information that either cannot generally be perceived - or information that has been prioritised as less important perceptually. The more compressed the video is, the less quality you can retain, and the more degraded the image usually becomes. Lossy compression is always a compromise between quality and file size, but does allow you to create much smaller files, relatively.
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, in a video player such as VLC, or Quicktime, or using a hardware decoder chip inside a DVD or other media player.
What is a format?
A format or "container format", such as Quicktime (.mov) or AVI (.avi) is a piece of wrapper code that is used to bind together video and audio information, along with other information such as metadata, subtitles and interactivity code. Quicktime is the native format for Macintoshes, and AVI was the native format for Windows, until Windows Media really came to the fore. In the case of streaming formats, such as Windows Media (.asf or .wmv) this format might also contain information on the small pieces, or packets, of video data that the file is segmented into, and how fast, or using which protocol, these packets must be streamed to the end user.
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, as in any other area of engineering, 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. The MPEG4 standard, as it has been known, contains design elements that have been implemented in codecs such as xVid, vp6, DivX and others. 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.
Our example - xVid
Today we'll be encoding to xVid. xVid is a codec that was built using the MPEG4 standard, and uses the AVI format. xVid is the open source version of DivX. DivX itself was a hack of a codec that Microsoft built using the MPEG4 standard and using the Windows Media format. The first version of DivX popularised the file-sharing of movies over the internet, as it was the first codec that allowed video files to be small enough, at decent enough viewing quality for them to be freely uploaded and downloaded as entire movie files over the web. DivX Networks became a fully-fledged commercial company which still produces good codecs that are usually free when you download the basic version. However, coders who were interested in promoting a free open-source alternative used the DivX codebase to produce xVid which is free for anyone to download and use, and is one of the most popular codecs on the web today.
HOW TO GET YOUR VIDEO ONLINE USING FFMPEGX. MEDIACODER, GTRANSCODE AND PLUMI
There are many different methods of distributing your video over the internet. We've chosen one method that uses a free open source video codec, a shareware video encoder for the mac, free software video encoders for windows and linux, that 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.
Many of the principles we use in this method are applicable to other methods you may use in future.
In this workshop we'll show you how to convert your finished video into a compressed xVid file, and upload this to the Transmission Plumi Video-Sharing site, where it will be hosted for free under a Creative Commons open license.
We will start by using some video exported from FinalCutPro as a DV PAL Quicktime, compress this file in ffmpegX, or MediaCoder and then publish this to the Plumi TX site.
The software for this workshop has already been downloaded on this disc, but here are links to the pages you'll need when installing at home:
Step 1 - Export Video as DV PAL
- Open FinalCut project containing the video you wish to export (in this case we'll use the Electrofringe project) - Goto File menu and click Export>Quicktime Movie - Export 10 SECONDS OF VIDEO AS TEST.mov from the timeline as a DV PAL MOV
THIS STEP HAS ALREADY BEEN COMPLETED - BUT YOU WOULD USUALLY HAVE TO DO THIS AT HOME
Step 2 - Encode Video to xVid Using ffmpegX (Mac Users)
- Open ffmpegX - Load video Test_Video.mov into ffmpegX - Choose target format xVid AVI - Select Video tab and change Autosize to 4:3 - Change Video Size to 320x240 - Leave Framerate as PAL (25) - Change Video Bitrate to 1400kbit/s - Select Audio tab and check settings for 128k mp3 Stereo - Select Filters tab and tick Deinterlace box - Ignore Options and Tools Tabs and return to Summary tab - Goto File menu and Save Preset as "xVid 320x240 1000k 128mp3" - Hit Encode button and wait until video has finished encoding
Step 2 alternative - Encode Video to xVid Using MediaCoder (Windows Users)
- Open Media Coder - Load video Test_Video.mov into
OTHER NOTES WILL BE POSTED TO WIKI
Step 2 alternative - Encode Video to xVid Using gTranscode (Linux Users)
OTHER NOTES WILL BE POSTED TO WIKI
Step 3 - Upload Video to Plumi TX
- register a username - set up your profile (if there is time) - publish your video - title, desc - classify - video and image - download your video and watch in VLC (or flash player)