Add audio formats MP3 and Flac

This commit is contained in:
Romain Neutron 2012-04-13 14:15:56 +02:00
commit 5b53381904
9 changed files with 123 additions and 5 deletions

View file

@ -71,6 +71,7 @@ class FFMpegTest extends \PHPUnit_Framework_TestCase
$this->object->encode(new Format\Video\WebM(32, 32), './invalid.file');
}
/**
* @covers FFMpeg\FFMpeg::encode
* @expectedException \RuntimeException
@ -87,6 +88,39 @@ class FFMpegTest extends \PHPUnit_Framework_TestCase
/**
* @covers FFMpeg\FFMpeg::encode
* @covers FFMpeg\FFMpeg::encodeAudio
*/
public function testEncodeMp3()
{
$dest = __DIR__ . '/../../files/encode_test.mp3';
$this->object->open(__DIR__ . '/../../files/Audio.mp3');
$this->object->encode(new Format\Audio\Mp3(), $dest);
$this->probe->probeFormat($dest);
unlink($dest);
}
/**
* @covers FFMpeg\FFMpeg::encode
* @covers FFMpeg\FFMpeg::encodeAudio
*/
public function testEncodeFlac()
{
$dest = __DIR__ . '/../../files/encode_test.flac';
$this->object->open(__DIR__ . '/../../files/Audio.mp3');
$this->object->encode(new Format\Audio\Flac(), $dest);
$this->probe->probeFormat($dest);
unlink($dest);
}
/**
* @covers FFMpeg\FFMpeg::encode
* @covers FFMpeg\FFMpeg::encodeVideo
*/
public function testEncodeWebm()
{
@ -102,6 +136,7 @@ class FFMpegTest extends \PHPUnit_Framework_TestCase
/**
* @covers FFMpeg\FFMpeg::encode
* @covers FFMpeg\FFMpeg::encodeVideo
*/
public function testEncodeOgg()
{
@ -117,6 +152,7 @@ class FFMpegTest extends \PHPUnit_Framework_TestCase
/**
* @covers FFMpeg\FFMpeg::encode
* @covers FFMpeg\FFMpeg::encodeVideo
*/
public function testEncodeX264()
{

View file

@ -107,7 +107,7 @@ class DefaultAudioFormatTest extends \PHPUnit_Framework_TestCase
*/
public function testGetKiloBitrate()
{
$this->assertEquals(1000, $this->object->getKiloBitrate());
$this->assertEquals(128, $this->object->getKiloBitrate());
}
/**

View file

@ -187,6 +187,14 @@ class DefaultVideoFormatTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(16, $this->object->getMultiple(8, 16));
}
/**
* @covers FFMpeg\Format\DefaultVideoFormat::getKiloBitrate
*/
public function testGetKiloBitrate()
{
$this->assertEquals(1000, $this->object->getKiloBitrate());
}
}
class DefaultVideoFormatTester extends DefaultVideoFormat