Ai
1 Star 0 Fork 1

艾合/PHP-FFmpeg-video-streaming

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
DASHTest.php 2.11 KB
一键复制 编辑 原始数据 按行查看 历史
Amin 提交于 2020-04-20 23:01 +08:00 . update 2
<?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());
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/torghay/PHP-FFmpeg-video-streaming.git
git@gitee.com:torghay/PHP-FFmpeg-video-streaming.git
torghay
PHP-FFmpeg-video-streaming
PHP-FFmpeg-video-streaming
master

搜索帮助