Fix #44 : throw an exception in case of older ffprobe
This commit is contained in:
parent
8bb596a919
commit
3bdb341abb
2 changed files with 26 additions and 1 deletions
|
|
@ -11,8 +11,10 @@
|
|||
|
||||
namespace FFMpeg\FFProbe;
|
||||
|
||||
use Alchemy\BinaryDriver\Exception\ExecutionFailureException;
|
||||
use Doctrine\Common\Cache\Cache;
|
||||
use FFMpeg\Driver\FFProbeDriver;
|
||||
use FFMpeg\Exception\RuntimeException;
|
||||
|
||||
class OptionsTester implements OptionsTesterInterface
|
||||
{
|
||||
|
|
@ -55,7 +57,11 @@ class OptionsTester implements OptionsTesterInterface
|
|||
return $this->cache->fetch($id);
|
||||
}
|
||||
|
||||
$output = $this->ffprobe->command(array('-help', '-loglevel', 'quiet'));
|
||||
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->cache->save($id, $output);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue