< Day Day Up > |
Hack 29. Transcode a Movie's Codec
Just because you are using one digital video format, that doesn't mean you can't distribute others. By converting from one format to another, you can reach a new audience. You might initially intend on distributing your video on DVD, only to discover there is a market for online distribution. Moving digital video from one format to another is easy, if you know which tools to use. There are a large number of applications, both commercial and free, that will enable you to change your footage from one codec to another. Of the applications available, Discreet's Cleaner (http://www.discreet.com/ products/cleaner/; $549) and FFmpeg (http://ffmpeg.sourceforge.net/index. php; free, open source) are two solid options. Both programs are available for Macintosh and Windows operating systems. FFmpeg is also available on Linux. 3.5.1. Using CleanerCleaner is capable of doing much more than simply transcoding a movie file; for example, it can enable a movie to open a URL [Hack #84]. However, it is known for being one of the best video encoders available. Additionally, it makes encoding video easy for beginners, because it has a wide variety of presets, while also allowing advanced users to fine-tune the encoding process. Here's how to create an MPEG-4-compliant, streaming video, suitable for a 1Mbps connection:
Before encoding, Cleaner asks you to provide a name for the file and a location on your hard drive to store it. Once the encoding process begins, Cleaner displays a Progress window. The Progress window updates throughout the process, providing both visual feedback in the video portion of the window, as well as in the Status, Data Rate, and Statistics tabs. Figure 3-9 shows the Progress window for a movie after it has been encoded. Cleaner will ding like an egg timer when the process has completed. You can then proceed to distribute the resulting movie as you see fit. 3.5.2. Using FFmpegFFmpeg is an open source audio and video tool that can record, convert, and stream media files. Although it is developed and targeted for Linux, it can also be used on Macintosh and Windows. You can find instructions for downloading the current release at http://ffmpeg.sourceforge.net/download.php. FFmpeg uses a command-line interface (CLI), so you use the program by typing and not using a mouse. After you have either built or obtained a binary of FFmpeg, locate the application on your hard drive from a command-line prompt. Using the -i argument followed by the video file you want to convert and the video file you would like to convert to, you can easily convert your video from one format to another:
Replace mymovie. dv with the movie you're converting and mymovie. mpg with the name you would like to save the converted movie. FFmpeg is capable of encoding many different formats, including asf, mpeg-1, mpeg-2, mpeg-4, dv, mjpeg, and many more. Documentation is extensive and available on the FFmpeg web site (http://ffmpeg.sourceforge.net). Figure 3-9. Displaying statistics for a completely encoded movieFigure 3-10 shows FFmpeg converting an MJPEG-encoded movie named Promo.mov to an ASF-encoded movie named Promo.asf using the command ffmpeg -i /tmp/Promo.mov /tmp/Promo.asf. 3.5.3. Distributing Your MovieEvery distribution method has a preferred codec, or set of codecs, associated with it. There are numerous ways you can distribute your movie, including on video tape, on DVD [Hack #79], on VCD [Hack #78], streaming on the Internet [Hack #83], via peer-to-peer network [Hack #86], and even via cell phone [Hack #89].
Figure 3-10. FFmpeg in actionIn the end, you should always make sure your distribution method and your encoding match up [Hack #77]. There is a slight "chicken and egg" paradox with distribution and encoding, but once you know which comes first (e.g., you are distributing via DVD), then you can easily figure out which comes second (e.g., use the MPEG-2 codec). 3.5.4. See Also
|
< Day Day Up > |