Category Archives: Flash/Flex

PHP script for convert video format to flv(flash) format file

Convert any video format to .flv format using php script

Developers often need to convert/encode files from any video format to FLV (flash format) using FFMPEG & PHP.

 

As this is the most commonly requested feature that is asked of web developers is to convert existing video’s to another format. As flash has found its home in providing players, it has become most common to convert video’s into flash video’s. The ffmpeg library can convert most any existing video format, to any other format.

 

Convert video file to flv in php

 

In PHP, the ffmpeg library is typically called using the exec() or system() functions. This provides the fastest method of video conversion without reading the whole video, or multiple video’s into memory.

 

FFMPEG is a PHP extension that is used to convert audio, video and images from one format to another one and also supports grabbing and encoding in real time from a TV card.

 

For execution of conversion script successfully, you must have ffmpeg extension loaded in your php. You can check this by the below code.

 

<?php

if(extension_loaded('ffmpeg')){
    echo 'Loaded ffmpeg';
}else{
    echo 'Failed loading ffmpeg';
}

?>

 

 

You can also check this by viewing phpinfo();

Download the full (video file format conversion) code by the link below.

 

video-flv-convertor.zip