Other to FLV file conversion in PHP

February 15, 2008

Hi using this php code any one can convert any video file to flv.

Requirements : ffmpeg software

You can download this software from

http://www.videohelp.com/tools/ffmpeg

Code :

$curdir = define (‘FULL_PATH’, dirname(__FILE__).’/');

if(strstr($_SERVER['SERVER_SOFTWARE'],”Win32″))
$ffmpeg_format = $curdir.”ffmpeg.exe -y -i %s %s”;
else
$ffmpeg_format = “LD_LIBRARY_PATH=. “.$curdir.”ffmpeg -y -i %s %s > /dev/null 2>&1″;

$ret_value = 0;
// prepare ffmpeg command

$ffmpeg_command = sprintf($ffmpeg_format, $video_file_name, $flv_name);

//echo $ffmpeg_command;

if (system($ffmpeg_command, $ret_value) === FALSE || $ret_value != 0) {
// ffmpeg was failed
return false;
}
return true;

Where this php page directory should ffmpeg.exe directory

By the help of flvtool2 mencoder software file conversion you can follow

http://reazulk.wordpress.com/2008/01/24/easy-way-to-convert-a-no-flash-movie-to-flash/

Entry Filed under: Video And FLV. Tags: , , .

1 Comment Add your own

  • 1. Ahsan  |  January 4, 2009 at 9:22 pm

    Hi Jewel,

    Please give solve me problem, how can set permission on server to ffmpeg.exe and video upload folder of video convoter to FLV in PHP

    Thanks

    Reply

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to the comments via RSS Feed



Jewel Ahmed's Facebook profile
Jewel Ahmed's Facebook profile

Pages

Categories

 

February 2008
M T W T F S S
    Mar »
 123
45678910
11121314151617
18192021222324
2526272829  

Blogroll

Recent Comments

Wardell on MySql Type Casting
Ahsan on Other to FLV file conversion i…
mySql Type Casting t… on MySql Type Casting
bibomedia on About

Recent Posts

Archives