Jump to content

covert video files to .flv format using ffmpeg.


vanik

Recommended Posts

Hi  All,

 

              I converted all the video files to .flv format by using ffmpeg in cmd.When i call this in my file it was not converting.Please help me about this.Here is my code.....

 

        <?

$srcFile = "/FFmpeg/monkeydog.wmv";

$destFile = "/FFmpeg/mn.flv";

$ffmpegPath = "/FFmpeg/ffmpeg";

echo exec('cmd /c echo Hello World!');

exec($ffmpegPath . " -i " . $srcFile . " -ar 22050 -ab 32 -f flv -s 420 * 320 " . $destFile);

//$x=exec('cmd /c ffmpeg.exe -i  monkeydog.wmv -ar 22050 -ab 32 -f flv -s 320×240 video2.flv');

//exec("/usr/local/bin/ffmpeg -i /your/dir/uploadedfile.flv -an -ss 00:00:03 -an -r 2 -vframes 1 -y /your/dir/%d.jpg");

// Make multiples function

?>

use this, and post what the output is (by output i mean text generated by the script):

 

<?php
  $srcFile = "/FFmpeg/monkeydog.wmv";
  $destFile = "/FFmpeg/mn.flv";
  $ffmpegPath = "/FFmpeg/ffmpeg";
  if(!is_executable($ffmpegPath))
    die("Bad ffmpegPath");
  print "ffmpegPath: ".realpath($ffmpegPath)."\n";
  if(!is_readable($srcFile))
    die("SrcFile not readable");
  print "srcFile: ".realpath($srcFile)."\n";
  if(!is_writable(dirname($destFile)))
    die("Can not write to destination folder");
  $cmd = $ffmpegPath . " -i " . $srcFile . " -ar 22050 -ab 32 -f flv -s 420 * 320 " . $destFile;
  print $cmd."\n\n";
  passthru($cmd,$rval);
  print "\nReturn Value: $rval";
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.