User Tools

Site Tools


computers:video_conversion

Video Conversion

Tutorial

Required Programs

Obtaining the source code and installation is pretty straightforward for the most part, basically just download the source code tar ball ( filename.tar.gz), decompress, untar, move to /usr/local/ (optional), and follow the installation instruction in the INSTALL file included in the source code. In short, do:

sudo ./configure
sudo make
sudo make check
sudo make install

FFmpeg is slightly different in that it is recommended to check out the latest version via svn:

svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg

The version that I got working on Mac OS 10.6.1 is:

Checked out external at revision 29714.
Checked out revision 20024.

Historically, I also had revision 19667 worked on Mac OS 10.5.8 and revision 19638 worked on Mac OS 10.5.7.

To configure and install, do:

./configure --enable-shared --enable-libmp3lame

The 2 additional arguments specify the build to enable shared libraries and LAME for mp3 support.

Because Mac OS 10.6 is a 64-bit OS, some additional flags are necessary when configuring the FFMpeg:

./configure --enable-shared --enable-libmp3lame --extra-cflags=-m64 --extra-ldflags=-m64 --arch=x86_64

In the case that the code can not be compiled, disable the mmx support by:

./configure --enable-shared --enable-libmp3lame --disable-mmx

This may result in slower encoding but should reduce the trouble when compiling.

Example

To use FFmpeg, the simplest command is:

ffmpeg -i input_file output_file

The program will recognize the file formats based on the filename extensions.

To add more control, run ffmpeg -h to see all possible options. The most commonly used ones include:

  • -b bitrate ⇒ set video bitrate (in bits/s)
  • -r rate ⇒ set frame rate (Hz value, fraction or abbreviation)
  • -s size ⇒ set frame size (WxH or abbreviation)
  • -ab bitrate ⇒ set audio bitrate (in bits/s)
  • -ar rate ⇒ set audio sampling rate (in Hz)

For example:

ffmpeg -i input.AVI -b 600k -r 24 -s 640x480 -ab 96k -ar 44100 output.FLV

Player

  • VLC: stand-alone media player
  • JW FLV Player: media player for HTML-embedded flash files
computers/video_conversion.txt · Last modified: 2013/04/17 22:12 by chkuo