Initila Import

This commit is contained in:
Romain Neutron 2012-04-13 10:20:54 +02:00
commit 11345d6367
17 changed files with 773 additions and 0 deletions

52
src/FFMpeg/FFProbe.php Normal file
View file

@ -0,0 +1,52 @@
<?php
namespace FFMpeg;
class FFProbe extends Binary
{
public function probeFormat($pathfile)
{
if ( ! is_file($pathfile))
{
throw new \RuntimeException($pathfile);
}
$cmd = $this->binary . ' ' . $pathfile . ' -show_format';
return $this->executeProbe($cmd);
}
public function probeStreams($pathfile)
{
if ( ! is_file($pathfile))
{
throw new \RuntimeException($pathfile);
}
$cmd = $this->binary . ' ' . $pathfile . ' -show_streams';
return $this->executeProbe($cmd);
}
protected function executeProbe($command)
{
$process = new \Symfony\Component\Process\Process($command);
$process->run();
if ( ! $process->isSuccessful())
{
throw new \RuntimeException('Failed to probe');
}
return $process->getOutput();
}
protected static function getBinaryName()
{
return 'ffprobe';
}
}