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.

Linux : ethernet interface supported media

Posted by Antonin AMAND Sat, 30 Sep 2006 20:54:00 GMT

I was just checking on my machines if all my ethernet cards supports 1Gb ethernet. On OS X ifconfig will give you what you want under the section supported media, but on Linux Debian it doesn’t. For this you have to use ethtool :

sudo ethtool eth0

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 !

Creating favicon.ico on Unix machines

Posted by Antonin AMAND Sat, 23 Sep 2006 14:27:00 GMT

Favicon are little icons that you can see in your browser before URL address.

To create this icons on unix-likes proceed as follow.

Open your favourite Image manipulator program, for me It will be The GIMP.

Create a 16×16 px PNG, and optionally a 32×32 px PNG.

Install png2ico from sources, package or compile it via darwinports.

For OS X with darwinports :

$ sudo port install png2ico

and create your favicon file :

$ png2ico favicon.ico favicon16.png favicon32.png

Now that you have your favicon file, just put it in your web server root directory.

You can had the following for IE compatibily in your web pages :


<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

Egroupware : hide private contacts in LDAP

Posted by Antonin AMAND Mon, 28 Aug 2006 14:47:00 GMT

Egroupware can store contacts from address book in an LDAP server. So, it is possible to access address book from a Mail client that supports LDAP.

The problem is that users would see any contact, even if it is private.

To prevent this from happening you can add this in slapd.conf :

access to dn.sub="ou=contacts,dc=example,dc=com"
        filter="(&(objectClass=phpgwContact)(phpgwContactAccess=private))"
        by dn="cn=admin,dc=example,dc=com" write
        by * none

access to dn.sub="ou=contacts,dc=example,dc=com"
        by dn="cn=admin,dc=example,dc=com" write
        by * read
Remember to add this before :
access to *
        by dn="cn=admin,dc=example,dc=com" write
        by * read

pam_ldap : Impossible to connect with local account when ldap server is down

Posted by Antonin AMAND Mon, 28 Aug 2006 10:23:00 GMT

Versions (debian packages):

  • libnss_ldap : 251-1
  • libpam-ldap : 180-1

When using ldap authentification with pam_ldap, if ldap server fails it may be impossible, or very slow to login even with a local account.

This happen when libnss-ldap is configured with the option :

bind_policy hard_open

To fix this, use :

bind_policy soft