Added ffmpeg version checking in the ComplexMediaTest::testXStackFilter().
This commit is contained in:
parent
f20ad8a82e
commit
6dc260fd3d
3 changed files with 21 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ use FFMpeg\Media\ComplexMedia;
|
||||||
*/
|
*/
|
||||||
class XStackFilter extends AbstractComplexFilter
|
class XStackFilter extends AbstractComplexFilter
|
||||||
{
|
{
|
||||||
|
const MINIMAL_FFMPEG_VERSION = '4.1';
|
||||||
const LAYOUT_2X2 = '0_0|0_h0|w0_0|w0_h0';
|
const LAYOUT_2X2 = '0_0|0_h0|w0_0|w0_h0';
|
||||||
const LAYOUT_1X4 = '0_0|0_h0|0_h0+h1|0_h0+h1+h2';
|
const LAYOUT_1X4 = '0_0|0_h0|0_h0+h1|0_h0+h1+h2';
|
||||||
const LAYOUT_3X3 = '0_0|0_h0|0_h0+h1|w0_0|w0_h0|w0_h0+h1|w0+w3_0|w0+w3_h0|w0+w3_h0+h1';
|
const LAYOUT_3X3 = '0_0|0_h0|0_h0+h1|w0_0|w0_h0|w0_h0+h1|w0+w3_0|w0+w3_h0|w0+w3_h0+h1';
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,14 @@ class ComplexMediaTest extends FunctionalTestCase
|
||||||
public function testXStackFilter()
|
public function testXStackFilter()
|
||||||
{
|
{
|
||||||
$ffmpeg = $this->getFFMpeg();
|
$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'));
|
$inputs = array(realpath(__DIR__ . '/../files/Test.ogv'));
|
||||||
$format = new X264('aac', 'libx264');
|
$format = new X264('aac', 'libx264');
|
||||||
$output = __DIR__ . '/output/' . self::PATH_PREFIX . 'xstack_test.mp4';
|
$output = __DIR__ . '/output/' . self::PATH_PREFIX . 'xstack_test.mp4';
|
||||||
|
|
|
||||||
|
|
@ -14,4 +14,16 @@ abstract class FunctionalTestCase extends TestCase
|
||||||
{
|
{
|
||||||
return FFMpeg::create(array('timeout' => 300));
|
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];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue