PHP-FFMpeg: Your FFProbe version is too old and does not support `-help` option, please upgrade.
When trying to use FFprobe in this package, it throws an exception saying it is too old, yet I have upgraded to the latest version of FFmpeg and FFprobe, and running ffprobe -help
works in the console/terminal.
Installed the package via composer as so:
"require": {
"php-ffmpeg/php-ffmpeg": "0.4.4"
}
The error traces to line 60 of /vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/OptionsTester.php
:
try {
$output = $this->ffprobe->command(array('-help', '-loglevel', 'quiet'));
} catch (ExecutionFailureException $e) {
throw new RuntimeException('Your FFProbe version is too old and does not support `-help` option, please upgrade.', $e->getCode(), $e);
}
This is locally on a Mac OS 10.9.1, I’ve updated FFmpeg via:
brew update
brew upgrade ffmpeg
This upgraded my ffmpeg and ffprobe versions to 1.2.4, as ffmpeg -version
and ffprobe -version
, both give 1.2.4.
I’ve created an FFprobe instance with configuration passed through it, with the binary paths I get from executing which ffmpeg
and which ffprobe
. But then when trying to read a file, it throws the exception:
$config = array(
'ffmpeg.binarie' => '/usr/local/bin/ffmpeg'
'ffprobe.binaries' => '/usr/local/bin/ffprobe'
'timeout' => 3600
'ffmpeg.threads' => 12
)
$ffprobe = FFMpeg\FFProbe::create($config);
$file_path = '/htdocs/mp4/test1.mp4';
$file_info = $ffprobe
->streams($file_path)
->videos()
->first()
->get('duration');
echo '<pre>';
print_r($file_info);
echo '</pre>';
Any thoughts as to why or how to fix? Many thanks!
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 33 (11 by maintainers)
Sometimes you get this error because you are using wrong version of ffmpeg or ffprobe,
for example if you are using linux and your architecture is
x86_64
and you have binaries of ffmpeg foramd64
then it shows this error :Your FFProbe version is too old
, it was that case in my case, so if you are using binaries of different architecture and you have some different architecture then the binaries you have, then it can happen, it also happen in the case of different binaries of os like you are usingffprobe.exe
on linux OS.in my case i am only putting binaries in bin folder as it is, i am not installing it, but if you have installed it then it may be not happen in your case.
then the issue comes from the webserver. I don’t know MAMP, but you can now try to run this script through the server and show me the output
I was also stuck with the same problem. The problem is that ffprobe was looking for the latest version and it depends on which OS you are using Download link: https://ffbinaries.com/downloads Get the correct exe files from here and use it like for linux live server
<?php return [ 'default_disk' => 'yourdiskname', 'ffmpeg.binaries' => '/home/username/sitename/usr/local/bin/ffmpeg', 'ffprobe.binaries' => '/home/username/sitename/usr/local/bin/ffprobe', 'timeout' => 3600, ]; and for windows use it like <?php return [ 'default_disk' => 'yourdiskname', 'ffmpeg.binaries' => 'C:/FFmpeg/bin/ffmpeg.exe', 'ffprobe.binaries' => 'C:/FFmpeg/bin/ffprobe.exe', 'timeout' => 3600, ];@atiberius
I faced the same error and this helped me aswell. Though with my setup it was LD_LIBRARY_PATH=/usr/bin export LD_LIBRARY_PATH
I had this problem myself on XAMPP and I solved it by putting this line: DYLD_LIBRARY_PATH=/usr/bin just before the line: export DYLD_LIBRARY_PATH from /Applications/XAMPP/bin/envvars and then restarted XAMPP. Thanks, lukedanielson and codeclown!
Definitely, a webserver does not provide the same environment as the CLI.
Let’s try in the CLI. If it works, we’ll find out why it fails with the webserver