Hi all! I have purchased an ffmpeg installed hosting (ffmpeg, mencoder, flv2tool etc installed). I was able to sucessfully install phpmotion, but i don't really need it, i would like to use my own simple converting codes to run, but i really can't get it working, please help to make it work Here is the code: <?php $srcFile="/home/berber/public_html/".$_REQUEST['my_inputfile']; $destFile="/home/berber/public_html/finished/".$_REQUEST['my_destfile']; $subtitlepath="/home/berber/public_html/".$_REQUEST['my_sub']; $mencoderPath = "/usr/bin/mencoder"; $ffmpegPath = "/usr/bin/ffmpeg"; $flvtool2Path = "/usr/local/bin/flvtool2"; // Create our FFMPEG-PHP class $ffmpegObj = new ffmpeg_movie($srcFile); // Save our needed variables $srcWidth = "640"; $srcHeight = "480"; $srcFPS = $ffmpegObj->getFrameRate(); $srcAB = intval($ffmpegObj->getAudioBitRate()/1000); $srcAR = $ffmpegObj->getAudioSampleRate(); // Call our convert using exec() exec($ffmpegPath . " -i " . $srcFile . " -ar " . $srcAR . " -ab " . $srcAB . " -f flv -newsubtitle " . $subtitlepath . " -s " . $srcWidth . "x" . $srcHeight . " " . $destFile . " | " . $flvtool2Path . " -U stdin " . $destFile); ?> PHP: If i run this script, nothing happens... The thing i would like to achieve: i would like to add a subtitle to the video... please help me get it working, if it is possible just with mencoder, it is not a problem as that one is installed too... I'm waiting for help! Thanks!
Try 'echo exec()' instead of just exec() on its own. - besides, i don't know what you mean by 'nothing happens' - what, no output, no converted video, no error logs? very unlikely.
It seems that the problem is that the output of ffmpeg is not passed to flvtool2. Consider using this code: exec($ffmpegPath . " -i " . $srcFile . " -ar " . $srcAR . " -ab " . $srcAB . " -f flv -newsubtitle " . $subtitlepath . " -s " . $srcWidth . "x" . $srcHeight . " - 2>/tmp/errors_output | " . $flvtool2Path . " -U stdin " . $destFile); Code (markup): /tmp/errors_output will contain debug messages and the binary movie will be passed to flvtool2 on stdout - this is specified by "-" sign before "2>"
Hi! After a lot of searching and reading i came up with this code: $encode_cmd="$mencoderPath -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=460 -sub /home/blabla/public_html/familytrip.srt -o $destFile $srcFile"; exec($encode_cmd); PHP: It is working perfectly except the subtitle! It is not hardcoded into the file (as it should be). So the movie is transcoded but there are no subtitles! Please help in this! Thanks!