Images to Video making php script using FFMPEG

Hi Geeks,

This Article is based on

Images to Video making php script using FFMPEG

,  So I am providing you the complete steps to setup the FFMPEG in windows and linux environment.

FFMPEG is very good Extension for php where we can process many type of operations on audio and video like

Images to video convert ,images and audio to video ,Generate Thumbnail file from video. So I have tried it on my windows system .

Steps to install FFMPEG on windows or localhost:

Step 1: Download the Static build for windows from following page

http://ffmpeg.zeranoe.com/builds/

there will be a button for download as in the screenshotdownload_ffmpeg

 

Step 2: Install prerequisite extensions

Before making any php script please make available the GD2 Library from your php.ini by just uncommenting following lines(removing semicolons from start of these lines

;extension=php_gd.dll
;extension=php_gd2.dll

Step 3: Extract the downloaded zip and Inside Bin folder you will find ffmpeg.exe

Copy that file in your project folder in htdocs Eg: slideshow_project

Now we have all images which we need to convert into video are in any folder of this projects like Images:

there should be pattern of images name like pic1.jpg,pic2.jpg as so on…

Step 4: write and execute a command for images to video conversion, following is the command

above command is useful with creating a slideshow video where 2 second images will change and if you want to increase slide change duration for 3 second then you need to replace 1/1 to 1/3   from above command.

Now if you want to mix audio along with images then following command will work

Assuming you have my_recording.mp3 in audio folder of project

Installing FFMPEG in linux servers by following command

In that case you don’t need to follow  Step 1 and Step 3

If you are having any problem then please put your comments below , I would love to help you

Implement Stripe in 3 steps using php

Hi Geeks,
This Article is focused on Implement Stripe in 3 steps using php, where you can easily accept payments through stripe by using this code. the stripe checkout.js
is used here with server side code also.

Step 1: Create a product list page named index.php with following code:

Output Screen for this will look like this:

1

Note: you can get products from database also,but here for demonstration i am showing these static.

Step 2: Create a Checkout Page with name pay.php, here you need to replace the stripe public key mention in the comment also.

Output Screen:

2

Step 3: Create a server side script for charge customer named as charge.php with following code, here you need to replace the Stripe private key mention in comment also:

Output Screen:

3

Note: there should be a stripe library in the root folder you can download it from here:
https://github.com/stripe/stripe-php/archive/v4.7.0.zip
and extract it with name stripe as you can see in following screenshot

4

Still you have any problem in integrating you can directly call me and i will send you the complete working code,

you can comment here or send me a email on jeetendra.apps@gmail.com

Thanks

 

CREATE OWN CAPTCHA FOR YOUR WEBSITE

Hi Geeks,
I am sharing you a program for creating a captcha script using php and javascript. Following are the simple steps to create captcha in php

Step 1: Create a php script named ‘captcha.php’ with following code that generate and return a captcha image.

Step 2: Now create a captcha.js file and put following code in the file.

Step 3: Now we need to create a Placeholder Element inside the form as following:

Step 4: Now after submitting you from validate the captcha was right or not. So in your form submit action use following code.

Note 1: In which page/form you are using the capcha , there should be session start in top of the file as following:

and also include the js file in your php page head section. jquery should be available before the captcha.js inclusion as following:

Note 2: PHP GD LIBRARY SHOULD BE INSTALLED ON YOUR SERVER.

 

Pagination code using php and mysql

Hi Geeks,
We have gone through some user requests for pagination code for php mysql project.So we have created a simple class where you can easily create pagination for any grid or listing. following are the simple steps for making a pagination system in php.

Step 1: Create a class file ‘Paginator.class.php’ in your project with following code snippet

Step 2: Include the paging class before extracting data to show

Step 3: Now extract the data for any page as following

Step 4 : Now we are ready with data. So just showing the data and links as following

> Show the data first and after it showing the pagination links as following:

> Show the paging links after the data

 

 

form validation library in php

Hi Geeks,

Today i am sharing a generic class for

Form validation library in php

&  it also populate if form validation failed. First of all you can download the ‘form validation library in php’ by clicking on following url.

https://github.com/g10dra/form_validation_php/blob/master/class.validation.php

Now in this class you can validate the require,numeric,file-extension,match password & confirm password,validate url and other validation also.

It is having a validation with database like is_unique in mysql database where you need pass the db connection if you want to user is_unique validation.

Step 1: Include & Initialize the class in header or before your form s following:

Step 2: Create a HTML FORM

we are assuming that we have a form for add/edit ‘Advertise campaign’ form

Read the full comments in code

 

Step 3: Create a Table for advertise add/edit using following sql dump

Step 4: Now need to post the form and recieve data and show errors, Recieve post Before the HTML form

Please Comment If any problem in this. I’ll assist you to use this form validation library

How to work with AngularJS as frontend and PHP MYSQL as backend

Hi Geeks,

In this tutorial you will learn that how to work with AngularJs as web frontend or in any hybrid app and get retrieve data from database using php and mysql. We have created restful webservice for return records to angular app.

Now steps for making a angularjs app with php and mysql –
Step 1) Create a database and table for fetching content from the table
Note: If you want to use existing database then select you db else create a new db with ‘news_db’ or whatever you want to take a db name.
Now Create a table named ‘news’ for getting data by following sql statement

Now Dump some dummy records by following insert statement:

Step 2) Create a file named config.php with following code

change credential according to your database and server host
Step 3) Now create a file for webservices named wsdl.php
Define Cross origin headers in this file by following code

Now code for getting data from database and provide in restful json format by following code

So complete Code for wsdl.php is following

Step 4) Now Start with frontend
Step for Getting data from database using angularjs as frontend and php & mysql as backed
make a file named index.html
include the script which i have attached with this post

Now make a ng-app with following html

make a html table format inside the div for getting data from datasource(php/mysql restful service) as following

Now put the script that call the restful web service and load data to the table

Now complete Code for index.html

Congratulations you have completed with this tutorial please provide comments for this tutorial. [viraldownloader id=146 text=’DOWNLOAD COMPLETE CODE’]

Array to Xml Conversion and Xml to Array Convert in PHP

Hi Geeks,
Today i am sharing you a code snippet for converting xml to array with attributes also and vice versa (Convert array to xml). This class is very useful to parse rss feed and to make rss feed in php programming.

In this code snippet we have made a class to convert array XML using php code and also retaining its attibues stored into array . It returns the XML in form of DOMDocument class for further manipulation. This class will throw exception if the tag name or attribute name has illegal characters.

Usage of this class:

A. Steps for Convert Array to Xml

1.Create a class named Array2XML with following code in file Array2XML.php

2. Now Include the class

3. Defining Array or get it from database then call the createXML method for generating xml file

Now Call createXML method as following

B. Steps for Convert Xml to Array

1. Define the xml oe get the xml string into a varribale

2.Now call the XML_TO_ARR function as following

[viraldownloader id=138 text=’DOWNLOAD COMPLETE CODE’]

Progress bar for php form post , Download the Code

Hi Geeks,
Now php has a feature for tracking the progress of multipart form submit. we can show the progress in percentage for user convenience .you can download the source code if you want to create progress bar in php form.
Following are the steps to create a progress bar for php form post.
Step 1. Add script and css for upload progress functionality working

Step 2. Form Tag should look like

Note: form id we have used myform so if you want to change the form id then you need to change in upload_script.js file also

Step 3. Add the placement for showing progress bar

Step  4. In your upload or form post action you can add your code for demo purpose we have use as following:

[viraldownloader id=126 text=’Download the Source code by sharing us on facebook.’]

Text to Image Convert using php code . Download source Code

Hi Geeks,
In this tutorial we will learn that how to Create and save dynamic image in php using gd library or Text to Image Convert using php code . in this example we have a requirement to create a image with specific width and height and specific background and watermark also.
So that we have created a PHP Class to generate and save the image to specific folder or path.
please follow the steps to achive this task.
Step 1. Create a class file for generate image with name class.img.php with following code:

Step 2. make another php file with any name.
and include the class file as follow:

Now create a instance of img class with font file names and sizes as following :

Init with font files and font sizes as follow:

Now generate a single image as follow:

Generate multiple images in loop as following code :

Complete Code of above snippets:

[viraldownloader id=113 text=’Download the Complete Code by Sharing this post and click on generate button after sharing’]

Note: please confirm GD library on your php server. and create a images folder in project with 755 or 775 or 777 permissions.