Archive for December, 2008

Using FFMPEG to extract or convert videos to Images

Friday, December 12th, 2008

The simple command to use to convert a given video video.ext to a set of images preferably with the naming format XXXX.png is :

ffmpeg -i video.ext %4d.png

It will produce images with the naming : 0001.png 0002.png and so on. You can try different image format if needed ( Jpeg, bmp…)

In case you want to extract and convert only a specific portion of the video :

ffmpeg -ss hh:mm:ss -t hh:mm:ss -i video.ext %4d.png
-ss option is the starting point whilst -t option is the duration to be converted.

SQL : Using Count within the Where clause

Monday, December 8th, 2008

As trying to make a condition inside an SQL where clause based on the COUNT function or other functions, the trivial one is to use :

SELECT count(items) as cnt from user_items where cnt>3

This is not going to work, and therefore you need to use the following one instead :

SELECT count(items) as cnt from user_items having count(items)>3

In case you want to add a where clause to the SQL statement, here is how it should look :

SELECT count(items) as cnt from user_items where id>1000 having count(items)>3


imed.ws - Imed Bouchrika Website© 2003-2007.