Create an thumbnail image from a video file using php with ffmpeg library

For generating an image (thumbnail) from a video file using php with ffmpeg library, use the following code to achieve this.

 

Use php exec() function to do this. In the above code $target_path is the path where your video file located. $imgPath is the path where you want to store the image to be created. Size of the image to be generated, you can change by changing the value 200×200.

If you don’t know, how to install ffmpeg library in a LAMP environment see the post

Read More

Install ffmpeg library in LAMP environment

To install ffmpeg library in a LAMP environment is very easy. We can do this within few steps as explained below.

1) Open the Terminal and enter the following commands in the order, they are specified.

2) sudo apt-get install ffmpeg

3) sudo apt-get install ffmpeg libavcodec-extra-52

To verify the installation put the following code in a php file which should be located in web root path of your web server.

<?php

echo phpinfo();

?>

Check the output of the above code by accessing that php file through the browser and do search with word ffmpeg.

Read More

Command to clear DNS both in Linux & Windows

LINUX:

Install nscd if not present in your machine by running the following command via terminal,

sudo apt-get install nscd

To clear/flush the DNS, execute the following command,

sudo /etc/init.d/nscd restart

WINDOWS:

run the below command  via command prompt,

ipconfig/flushdns

Read More

Get second largest value in mysql

follow the below query to get the second largest value of any number field

 

Read More

Get user’s actual IP address

Use the below function for getting the IP address of site visitors:

 

 

Read More