ffmpeg

It is a good tool for playing around video files.

Installation

Recently I compiled ffmpeg from its repository for supporting VP8.

One can refer following for installation instructions.

libx264

The latest version if libx264 is needed by ffmpeg.

Install as:.

$ git clone git://git.videolan.org/x264.git

$ git pull

$ ./configure

$ make

$ make install

ffmpeg

prerequsits

yasm

libfaac

libmp3lame

libopencore-amrnb-dev

libopencore-amrwb-dev

libtheora

libvorbis

libxvidcore4

libavutil

libsdl

libxvid

the above packages along with their dev. package are needed for compilation

obtained the source code from svn repo as

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

$ svn update

configure

$

./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --disable-ffprobe

$ make

$ make install

ffprobe

ffmpeg package provides utilities like

ffmpeg,

ffplay,

ffserver and

ffprobe.

ffprobe provides information about video file.

an enhanced ffprobe version can be checkout as following

download as

$svn co https://ffprobe.svn.sourceforge.net/svnroot/ffprobe ffprobe

prerequsits

autoconf

texi2html

update as

$svn update

if configure file is not present

$ autoconf

$ ./configure

$ make

$ make install

ffprobe binary can be found in ffprobe/trunk/src/

Usages

ffmpeg is a versatile tool.

It can be a good trans-coding tool

$ ffmpeg -i a.flv -f webm -vcodec libvpx_vp8 -acodec vorbis a.webm

$ ffmpeg -i a.flv -b 614k -fs 6000000 -f flv b.flv

$ ffmpeg -i a.wav -s 640x480 -i a.mpg

$ ffmpeg -i a.wav -ab 64k a.mp2 -ab 128k b.mp2 -map 0:0 -map 0:0

$ ffmpeg -i a.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k b.avi

$ ffmpeg -i a.avi -r 10 -s WxH -f image2 a-%03d.jpeg

$ ffmpeg -f image2 -i a-%03d.jpeg -r 10 -s WxH a.avi

$ ffmpeg -i a.avi -i b.avi -vcodec copy -acodec copy -vcodec copy -acodec copy ab.avi -newvideo -newaudio

set bit rate to 64k

$ ffmpeg -i input.avi -b 64k output.avi

set frame rate to 24 fps

$ ffmpeg -i input.avi -r 24 output.avi

set frame rate at i/o

$ ffmpeg -r 1 -i input.m2v -r 24 output.avi

for t time only

$ ffmpeg -i earth -t 0:0:5 earth.mpeg

limit size to 1 kb

$ffmpeg -i earth -fs 1000 a.mpeg

Streaming

For streaming there are three components

  • feed
    • for generating Input or primary video sourcelink
  • server
    • for streaming or broadcasting/uni-casting feed soucelink
  • client
    • for receiving transmitted streamlink