First release of ffmpeg-ruby 1

Posted by Antonin AMAND Sun, 12 Oct 2008 18:47:00 GMT

ffmpeg-ruby is a ruby C extension binding to ffmpeg/libav* library.

It's main purpose (at least for now) is to extract frame in order to make video thumbnails. It also give access to main video attributes (frame rate, bit rate, duration, codecs, ...)

I've been working on this for some time now but I finally took the time to clean and package it

So here it is version 0.1.0

You can checkout the code with git :

git clone git://github.com/gwik/ffmpeg-ruby.git

Here is a example of what it can do : creating an animated gif from a video

Extract an image screenshot from a Video with ffmpeg 3

Posted by Antonin AMAND Mon, 27 Nov 2006 18:17:00 GMT

Here is a way to extract a sample image from a video with ffmpeg :

$ ffmpeg  -itsoffset -4  -i sample.mov -vcodec png -vframes 1 -an -f rawvideo -s 320x240 test.png
  • -itsoffset -4 : means that you want to extract the image 4 seconds after video starts.

FLV encoding with ffmpeg 15

Posted by Antonin AMAND Mon, 25 Sep 2006 17:22:00 GMT

ffmeg is a command-line tool for video encoding which has the ability to encode videos in FLV format (Macromedia plugin for direct-streaming).

First, you need to install ffmpeg with liblame support.

You may grab it as package or compile from sources.

We will compile from sources in this article for more compatibility.

first step : Installing lame get sources at http://lame.sourceforge.net, untar the archive and chdir to unpacked sources directory.

$ ./configure && make && sudo make install

second step : Installing ffmpeg

Getting sources from svn :

 $ svn export svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

Change dir to ffmpeg and compile with liblame

$ ./configure --enable-mp3lame && make && sudo make install

Your now setup. You can continue with encoding your first video

$ /usr/local/bin/ffmpeg  -i input.mov -ar 22050 -ab 56 -aspect 4:3 \
 -b 200 -r 12 -f flv -s 320x240 -acodec mp3 -ac 1 output.flv

to view the result download a swf FLV player and create a html file :

<html>
<head>
<title>Flash FLV Player</title>
</head>
<body>
<h3>My First FLV video</h3>
<object type="application/x-shockwave-flash" width="320" height="260" wmode="transparent" data="flvplayer.swf?file=output.flv&amp;autoStart=false">
<param name="movie" value="flvplayer.swf?file=output.flv&amp;autoStart=false" />
<param name="wmode" value="transparent" />
</object>

</body>
</html>

Enjoy !