代码拉取完成,页面将自动刷新
<?php
/**
* This file is part of the PHP-FFmpeg-video-streaming package.
*
* (c) Amin Yazdanpanah <contact@aminyazdanpanah.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tests\FFMpegStreaming;
use Streaming\DASH;
use Streaming\Stream;
use Streaming\Format\StreamFormat;
use Streaming\Representation;
class DASHTest extends TestCase
{
public function testDASHClass()
{
$this->assertInstanceOf(Stream::class, $this->getDASH());
}
public function testFormat()
{
$dash = $this->getDASH();
$dash->HEVC();
$this->assertInstanceOf(StreamFormat::class, $dash->getFormat());
}
public function testAutoRepresentations()
{
$dash = $this->getDASH();
$dash->HEVC()
->autoGenerateRepresentations();
$representations = $dash->getRepresentations()->all();
$this->assertIsArray($representations);
$this->assertInstanceOf(Representation::class, current($representations));
$this->assertEquals('256x144', $representations[0]->size2string());
$this->assertEquals('426x240', $representations[1]->size2string());
$this->assertEquals('640x360', $representations[2]->size2string());
$this->assertEquals(103, $representations[0]->getKiloBitrate());
$this->assertEquals(138, $representations[1]->getKiloBitrate());
$this->assertEquals(207, $representations[2]->getKiloBitrate());
}
public function testSet()
{
$dash = $this->getDASH();
$dash->setAdaption('test-adaption');
$this->assertEquals('test-adaption', $dash->getAdaption());
}
public function testSave()
{
$dash = $this->getDASH();
$export_class = $dash->HEVC()
->autoGenerateRepresentations()
->save($this->srcDir . '/dash/test.mpd');
$this->assertFileExists($this->srcDir . '/dash/test.mpd');
$this->assertInstanceOf(Stream::class, $export_class);
}
private function getDASH()
{
return new DASH($this->getVideo());
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。