public function testSimpleMerge() { $filename = __DIR__ . '/output/output-merged.ogv'; if (is_file($filename)) { unlink(__DIR__ . '/output/output-merged.ogv'); } $ffmpeg = $this->getFFMpeg(); $inputFile = __DIR__ . '/../../files/Test.ogv'; $video = $ffmpeg->open($inputFile); $this->assertInstanceOf('FFMpeg\\Media\\Video', $video); $video->filters()->merge(array($inputFile)); $lastPercentage = null; $phpunit = $this; $codec = new Ogg(); $codec->on('progress', function ($video, $codec, $percentage) use($phpunit, &$lastPercentage) { if (null !== $lastPercentage) { $phpunit->assertGreaterThanOrEqual($lastPercentage, $percentage); } $lastPercentage = $percentage; $phpunit->assertGreaterThanOrEqual(0, $percentage); $phpunit->assertLessThanOrEqual(100, $percentage); }); $video->save($codec, $filename); $this->assertFileExists($filename); unlink($filename); }
/** * @covers FFMpeg\FFMpeg::encode * @covers FFMpeg\FFMpeg::encodeVideo */ public function testEncodeOgg() { $dest = __DIR__ . '/../../files/encode_test.ogv'; $format = new Format\Video\Ogg(); $format->setDimensions(32, 32); $this->object->open(__DIR__ . '/../../files/Test.ogv'); $this->object->encode($format, $dest); $this->probe->probeFormat($dest); unlink($dest); }