【问题标题】:FFMPEG-PHP Windows "Can't open movie file"FFMPEG-PHP Windows“无法打开电影文件”
【发布时间】:2010-03-02 18:50:03
【问题描述】:

ffmpeg 扩展已加载,如 phpinfo() 所示,我的文件和脚本位于同一位置,但我仍然收到此错误。

Warning: Can't open movie file Untitled.avi in C:\xampp\htdocs\skelbiu\fetch.php  on line 4

Fatal error: Call to a member function getDuration() on a non-object in C:\xampp\htdocs\skelbiu\fetch.php on line 5

我的脚本:

extension_loaded('ffmpeg') or die('Error in loading ffmpeg');

$ffmpegInstance = new ffmpeg_movie('Untitled.avi');
echo "getDuration: " . $ffmpegInstance->getDuration() .
"getFrameCount: " . $ffmpegInstance->getFrameCount() .
"getFrameRate: " . $ffmpegInstance->getFrameRate() .
"getFilename: " . $ffmpegInstance->getFilename() .
"getComment: " . $ffmpegInstance->getComment() .
"getTitle: " . $ffmpegInstance->getTitle() .
"getAuthor: " . $ffmpegInstance->getAuthor() .
"getCopyright: " . $ffmpegInstance->getCopyright() .
"getArtist: " . $ffmpegInstance->getArtist() .
"getGenre: " . $ffmpegInstance->getGenre() .
"getTrackNumber: " . $ffmpegInstance->getTrackNumber() .
"getYear: " . $ffmpegInstance->getYear() .
"getFrameHeight: " . $ffmpegInstance->getFrameHeight() .
"getFrameWidth: " . $ffmpegInstance->getFrameWidth() .
"getPixelFormat: " . $ffmpegInstance->getPixelFormat() .
"getBitRate: " . $ffmpegInstance->getBitRate() .
"getVideoBitRate: " . $ffmpegInstance->getVideoBitRate() .
"getAudioBitRate: " . $ffmpegInstance->getAudioBitRate() .
"getAudioSampleRate: " . $ffmpegInstance->getAudioSampleRate() .
"getVideoCodec: " . $ffmpegInstance->getVideoCodec() .
"getAudioCodec: " . $ffmpegInstance->getAudioCodec() .
"getAudioChannels: " . $ffmpegInstance->getAudioChannels() .
"hasAudio: " . $ffmpegInstance->hasAudio();

我正在使用 php 5.2.9 (XAMPP 1.7.1),Windows 7。 提前致谢!

【问题讨论】:

    标签: ffmpeg xampp


    【解决方案1】:

    您的电影路径必须是完整路径。您的脚本位于何处并不重要。因为您使用的是 Win 7 和 XAMPP,所以您的路径例如是

    $ffmpegInstance = new ffmpeg_movie('C:/xampp/htdocs/yourfolder/Untitled.avi');
    

    希望这能解决你的问题

    【讨论】:

    • 是的,谢谢,我已经解决了我的问题,但也许这对其他人有用!
    猜你喜欢
    • 2020-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-07
    • 2011-05-16
    • 2015-11-22
    • 1970-01-01
    • 2011-02-06
    相关资源
    最近更新 更多