Hi, i am a php programmer,I want to paly the video in my php site.I used the html object to play the video.But the user can upload any formated video(like .avi,mpeg,wmv).so for compatability i want to convert this formated video into .flv format(flash format) when they uploading.Does anyone know how to conert the vdieo using php script.my server is windeos server and php 5 version. thank u.
ffmpeg is the key. Here is how to use it to produce flv: http://www.db75.com/blog/archives/000025.html You can call ffmpeg from php by using system() function.
thanks for your reply. i am unaware to configure ffmpeg into my php script and i think ffmpeg is compatibility with linuz server but my server si windows. can u explain how to configure the ffmpef into my php site.expecting your reply.thank u.
Sorry. I missed the part about Windows. There are tutorials on how to build ffmpeg under Windows: http://arrozcru.no-ip.org/ffmpeg_wiki/tiki-index.php. But it sounds rather complicated. I'm much more acquainted with Linux that Windows, so I probably can't help you to find Windows specific software.
hi, i want to create a site that someone can download and convert directly. http://vixy.net/flv_converter i would like to ask on how you call the function of the engine... how do i put thing exactly like http://vixy.net/flv_converter, and when i click start, it convert by itself... i know to compile using gcc. what i want to know is to call the function using php. thanks in advance.
hello, i am working on an unix server where i am able to convert my video file into an flv format but the audio is nt available in the converted file can u tell me what would be the problem php file -------- <?php class media_handler { function convert_media($filename, $rootpath, $inputpath, $outputpath, $width, $height, $bitrate, $samplingrate) { $outfile = ""; // root directory path, where FFMPEG folder exist in your application. $rPath = $rootpath."\ffmpeg"; // which shows FFMPEG folder exist on the root. // Set Media Size that is width and hieght $size = $width."x".$height; // remove origination extension from file adn add .flv extension, becuase we must give output file name to ffmpeg command. $outfile =$filename; $out=explode(".",$outfile); // Media Size //$size = Width & "x" & Height; // remove origination extenstion from file and add .flv extension , becuase we must give output filename to ffmpeg command. $outfile = $out[0].".flv"; // Use exec command to access command prompt to execute the following FFMPEG Command and convert video to flv format. $ffmpegcmd1 = "/usr/local/bin/ffmpeg -i ".$inputpath."/".$filename. " -ar " .$samplingrate." -ab ".$bitrate." -f flv -s ".$size." ".$outputpath."/".$outfile; //$ffmpegcmd1 = "/usr/local/bin/ffmpeg -i ".$inputpath."/".$filename. " -b 500 -r 25 -s 320×240 -hq -deinterlace -ab 56 -ar 22050 -ac 1 ".$outputpath."/".$outfile." 2>&1"; $ret = shell_exec($ffmpegcmd1); // return output file name for other operations return $ffmpegcmd1; } function grab_image($filename, $rootpath, $inputpath,$outputpath, $no_of_thumbs, $frame_number, $image_format, $width, $height) { // root directory path $_rootpath = $rootpath."\ffmpeg"; // Media Size $size = $width."x".$height; // I am using static image, you can dynamic it with your own choice. $out=explode(".",$filename); $outfile = $out[0].".jpg"; $ffmpegcmd1 = "/usr/local/bin/ffmpeg -i ".$inputpath."/".$filename." -vframes ".$no_of_thumbs." -ss 00:00:03 -an -vcodec ". $image_format." -f rawvideo -s ".$size. " ". $outputpath."/".$outfile; $ret = shell_exec($ffmpegcmd1); // Execute this command using exec command or any other tool to grab image from converted flv file. return $ffmpegcmd1; } } ?> i am using this for converison ................... can u help me out....... thanku
sridivya, if you would only look into the help for ffmpeg it says: Audio options: -aframes number set the number of audio frames to record -ab bitrate set audio bitrate (in kbit/s) -ar rate set audio sampling rate (in Hz) -ac channels set number of audio channels -an disable audio -acodec codec force audio codec ('copy' to copy stream) -vol volume change audio volume (256=normal) so, remove -an from your params list, and it will work
ffmpeg is the key. Here is how to use it to produce flv: http://www.db75.com/blog/archives/000025.html You can call ffmpeg from php by using system() function. Reply With Quote Nice share. Thank you
Are you tryed Video to Flash Converter Pro ( geovid )? When I needed in converting video to flash this program helped me...
Convert video to flv using PHP FFMPEG Here is my code it will convert to flv but size can be 0KB. ANy one HELp???? <?php function makeMultipleTwo ($value){ $sType = gettype($value/2); if($sType == "integer"){ return $value; } else { return ($value-1); } } $srcFile = "kabhi-alvida.avi"; $destFile = ".flvs/kabhi-alvida.flv"; $ffmpegPath = "/usr/local/bin/ffmpeg"; $flvtool2Path = "/usr/local/bin/flvtool2"; $ffmpegObj = new ffmpeg_movie($srcFile); $srcWidth = makeMultipleTwo($ffmpegObj->getFrameWidth()); $srcHeight = makeMultipleTwo($ffmpegObj->getFrameHeight()); $srcFPS = $ffmpegObj->getFrameRate(); $srcAB = intval($ffmpegObj->getAudioBitRate()/1000); $srcAR = $ffmpegObj->getAudioSampleRate(); $command = $ffmpegPath . " -i " . $srcFile . " -ar " . $srcAR . " -ab " . $srcAB . " -f flv -s " . $srcWidth . "x" . $srcHeight . " " . $destFile . " | " . $flvtool2Path . " -U stdin " . $destFile; $convert = exec($command); if(!$convert){ echo "FAILED!!!"; } ?>
I did try ffmpegx. After a lengthy conversion, the movie & audio only played in slow motion. Or you may try this Video Encoder Engine for Adobe Flash, my friends recommend it to me. It can help you convert video format to .flv(flash format) using php script, C++, Visual Basic, Delphi, ASP, .NET, ColdFusion, it's safe and works pretty well for me, I think it deserves for a try. http://www.flash-video-soft.com/flash-video-sdk/ Hope it helps.
Hi.. I have a problem converting video using ffmpeg. I am trying something like this $ffmpegcmd = escapeshellcmd("ffmpeg -i mysrc.mov target.flv"); echo $ret = shell_exec($ffmpegcmd); This works perfectly fine in local wamp server. But if i try same thing in server its not working. No error nothing.. I have tried all file permission and everything nothing worked. Please help..
Hi! Are you still here?)) You can try to use another program to convert video files to flash! I prefer to use VisiFly program, it is very easy in use, step by step program. You can convert all video (avi, wmv, mpeg, mp4, mov) to flv or swf. Also these program allows to create HTML to use it on your website.