Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques conversion from avi,mpeg to flv using ffmpeg

  • conversion from avi,mpeg to flv using ffmpeg

    Posted by Alim Ziyan on August 27, 2011 at 9:09 am

    Hi,
    I am using a php script for converting avi,mpeg files to flv with ffmpeg.my code is
    $srcFile = "uploads/flame.avi";
    $destFile = "uploads/flame.flv";
    $ffmpegPath = "/usr/bin/ffmpeg";
    $flvtool2Path = "/usr/bin/flvtool2";

    $ffmpegObj = new ffmpeg_movie($srcFile);
    $srcWidth = 320;
    $srcHeight = 240;
    $command = $ffmpegPath . " -i " . $srcFile . " -f flv -s " . $srcWidth . "x" . $srcHeight . " " . $destFile . " | " . $flvtool2Path . " -U stdin " . $destFile;
    $convert = exec($command);
    if(!$convert)
    {
    echo "FAILED!!!";
    }
    else
    {
    echo "SUCCESS";
    }

    I can create a flv file using this script.But sometimes it creates a flv file with size 0 k.I don’t know why this is happening.With the same avi file,sometimes it creates correct flv file and sometimes flv with size 0k.How can I confirm whether the conversion is success. In both the cases it displays SUCCESS

    Alim Ziyan replied 15 years ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy