Added ffmpeg version checking in the ComplexMediaTest::testXStackFilter().

This commit is contained in:
CaliforniaMountainSnake 2020-02-20 14:34:21 +03:00
commit 6dc260fd3d
3 changed files with 21 additions and 0 deletions

View file

@ -156,6 +156,14 @@ class ComplexMediaTest extends FunctionalTestCase
public function testXStackFilter()
{
$ffmpeg = $this->getFFMpeg();
$ffmpegVersion = $this->getFFMpegVersion();
if (version_compare($ffmpegVersion, XStackFilter::MINIMAL_FFMPEG_VERSION) === -1) {
$this->markTestSkipped('XStack filter is supported starting from '
. XStackFilter::MINIMAL_FFMPEG_VERSION . ' ffmpeg version, your version is '
. $ffmpegVersion);
return;
}
$inputs = array(realpath(__DIR__ . '/../files/Test.ogv'));
$format = new X264('aac', 'libx264');
$output = __DIR__ . '/output/' . self::PATH_PREFIX . 'xstack_test.mp4';

View file

@ -14,4 +14,16 @@ abstract class FunctionalTestCase extends TestCase
{
return FFMpeg::create(array('timeout' => 300));
}
/**
* Get ffmpeg version.
*
* @return string
*/
public function getFFMpegVersion()
{
preg_match('#version\s(\S+)#',
$this->getFFMpeg()->getFFMpegDriver()->command('-version'), $version);
return $version[1];
}
}