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: convert, flv, video.
1 Comment Add your own
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


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