Hack 29. Transcode a Movie s Codec

 < 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 Cleaner

Cleaner 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:

  1. Launch Cleaner.

  2. Drag and drop your movie file onto the Batch window.

  3. Choose Batch Specify Setting.

  4. MPEG-4 IMSA Profile 1 1 Mbps streaming.

  5. Choose Batch Encode.

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 FFmpeg

FFmpeg 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:

ffmpeg -i mymovie. dv mymovie. mpg

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 movie


Figure 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 Movie

Every 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].

Running FFmpeg From the Command Line

To run a command line program on:


Mac OS X

Open the Terminal application, located in the Utilities folder.


Windows

Open the Run…item from the Start menu, and then type command.

If you are not familiar with using the command line, or if you've never compiled a software program, you will probably achieve more success if you can locate either a binary or GUI release of FFmpeg for your particular operating system:.


Mac OS X

FFmpegX (http://homepage.mac.com/major4/; $15.00)


Windows

MeWiG (http://mewig.sourceforge.net/; free, open source)


Figure 3-10. FFmpeg in action


In 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

  • QuickTime Pro (http://www.apple.com/quicktime/) can convert to and from a wide variety of file formats. See http://www.apple.com/quicktime/ products/qt/specifications.html for a complete list.

  • Windows Media Encoder (http://www.microsoft.com/windows/windowsmedia/9series/encoder/default.aspx) is able to convert various Windows Media-compatible formats (.wav, .wma, .wmv, .asf, .avi, mpg, .mp3, .bmp, and .jpg) to the Windows Media Video format.

     < Day Day Up > 


    Digital Video Hacks
    Digital Video Hacks: Tips & Tools for Shooting, Editing, and Sharing (OReillys Hacks Series)
    ISBN: 0596009461
    EAN: 2147483647
    Year: 2005
    Pages: 158
    Authors: Joshua Paul

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net