如何在Ubuntu中使用Xampp配置FFMPEG

时间:2015-01-03 06:35:00

标签: php ubuntu ffmpeg xampp

您好我正在尝试使用ffmpeg合并视频与Php.Now我在ubuntu中安装了Xampp.and FFMEPG也安装在Ubuntu中。我搜索了ffmpeg.dll文件,但它没有在目录中。但是我添加了扩展名在php.ini文件中,如下面的代码

 ;extension=php_bz2.dll
 ;extension=php_ffmpeg.dll
 ;extension=php_curl.dll
 ;extension=php_dba.dll
 ;extension=php_exif.dll
 ;extension=php_fileinfo.dll

这是我对ffmpeg的测试代码。

     <?php
    extension_loaded('ffmpeg') or die('Error in loading ffmpeg');
    $vid = realpath('1.mp4');
   $ffmpegInstance = new ffmpeg_movie($vid);
    echo "getDuration: " . $ffmpegInstance->getDuration() . "<br />".
   "getFrameCount: " . $ffmpegInstance->getFrameCount() . "<br />".
   "getFrameRate: " . $ffmpegInstance->getFrameRate() . "<br />".
   "getFilename: " . $ffmpegInstance->getFilename() . "<br />".
   "getComment: " . $ffmpegInstance->getComment() . "<br />".
   "getTitle: " . $ffmpegInstance->getTitle() . "<br />".
   "getAuthor: " . $ffmpegInstance->getAuthor() . "<br />".
   "getCopyright: " . $ffmpegInstance->getCopyright() . "<br />".
   "getArtist: " . $ffmpegInstance->getArtist() . "<br />".
   "getGenre: " . $ffmpegInstance->getGenre() . "<br />".
   "getTrackNumber: " . $ffmpegInstance->getTrackNumber() . "<br />".
   "getYear: " . $ffmpegInstance->getYear() . "<br />".
   "getFrameHeight: " . $ffmpegInstance->getFrameHeight() . "<br />".
   "getFrameWidth: " . $ffmpegInstance->getFrameWidth() . "<br />".
   "getPixelFormat: " . $ffmpegInstance->getPixelFormat() . "<br />".
   "getBitRate: " . $ffmpegInstance->getBitRate() . "<br />".
   "getVideoBitRate: " . $ffmpegInstance->getVideoBitRate() . "<br />".
   "getAudioBitRate: " . $ffmpegInstance->getAudioBitRate() . "<br />".
   "getAudioSampleRate: " . $ffmpegInstance->getAudioSampleRate() . "<br />".
   "getVideoCodec: " . $ffmpegInstance->getVideoCodec() . "<br />".
   "getAudioCodec: " . $ffmpegInstance->getAudioCodec() . "<br />".
   "getAudioChannels: " . $ffmpegInstance->getAudioChannels() . "<br />".
   "hasAudio: " . $ffmpegInstance->hasAudio();?>

当我在xammp中运行时,输出就像这样

加载ffmpeg时出错

请给我一些解决方案 提前谢谢。

0 个答案:

没有答案