Fix #46 : A/V synchronization works on flash player, not on html5 one
This commit is contained in:
parent
8bd6700377
commit
543d9aaeaf
3 changed files with 7 additions and 69 deletions
|
|
@ -3,56 +3,16 @@
|
|||
namespace FFMpeg\Tests\Filters\Video;
|
||||
|
||||
use FFMpeg\Tests\TestCase;
|
||||
use FFMpeg\FFProbe\DataMapping\StreamCollection;
|
||||
use FFMpeg\FFProbe\DataMapping\Stream;
|
||||
use FFMpeg\Filters\Video\SynchronizeFilter;
|
||||
|
||||
class SynchronizeFilterTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider provideStreams
|
||||
*/
|
||||
public function testApply($streams, $expected)
|
||||
public function testApply()
|
||||
{
|
||||
$video = $this->getVideoMock();
|
||||
$format = $this->getMock('FFMpeg\Format\VideoInterface');
|
||||
$video->expects($this->once())
|
||||
->method('getStreams')
|
||||
->will($this->returnValue($streams));
|
||||
$video->expects($this->any())
|
||||
->method('getPathfile')
|
||||
->will($this->returnValue(__FILE__));
|
||||
|
||||
$filter = new SynchronizeFilter();
|
||||
$this->assertEquals($expected, $filter->apply($video, $format));
|
||||
}
|
||||
|
||||
public function provideStreams()
|
||||
{
|
||||
$audio = new StreamCollection(array(new Stream(array(
|
||||
'index' => 0,
|
||||
'codec_type' => 'audio',
|
||||
))));
|
||||
$synced = new StreamCollection(array(new Stream(array(
|
||||
'index' => 0,
|
||||
'codec_type' => 'video',
|
||||
)), new Stream(array(
|
||||
'index' => 1,
|
||||
'codec_type' => 'audio',
|
||||
))));
|
||||
$video = new StreamCollection(array(new Stream(array(
|
||||
'index' => 0,
|
||||
'codec_type' => 'video',
|
||||
'start_time' => '0.123456',
|
||||
)), new Stream(array(
|
||||
'index' => 1,
|
||||
'codec_type' => 'audio',
|
||||
))));
|
||||
|
||||
return array(
|
||||
array($audio, array()),
|
||||
array($synced, array()),
|
||||
array($video, array('-itsoffset', '0.123456', '-i', __FILE__, '-map', '1:0', '-map', '0:1')),
|
||||
);
|
||||
$this->assertEquals(array('-async', '1'), $filter->apply($video, $format));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue