Add ability to disable -b:v (#767)
* adds ability to disable -b:v * Fixed a bug in the way the paths to the test files were defined in the AudioConcatenationTest.php file * Added a test to make sure that a negative kilobit rate returns an exception * Added a test to check that the -b:v options are not set if the kilo bitrate is set to 0 * Disable 2pass when -b:v is disabled Co-Authored-By: Philipp Doblhofer <6283313+philipp-doblhofer@users.noreply.github.com> * Changed the way we call the class FFMpeg\Exception\InvalidArgumentException in tests * Changed the way we call the class FFMpeg\Exception\InvalidArgumentException in tests * Updated the README to include this new option Co-authored-by: Romain Biard <romain.biard@gmail.com> Co-authored-by: Philipp Doblhofer <6283313+philipp-doblhofer@users.noreply.github.com>
This commit is contained in:
parent
08ccabcd77
commit
afffd627ff
7 changed files with 52 additions and 12 deletions
|
|
@ -4,6 +4,7 @@ namespace Tests\FFMpeg\Unit\Media;
|
|||
|
||||
use FFMpeg\Exception\RuntimeException;
|
||||
use FFMpeg\Media\Video;
|
||||
use FFMpeg\Format\Video\X264;
|
||||
use Alchemy\BinaryDriver\Exception\ExecutionFailureException;
|
||||
use FFMpeg\Format\VideoInterface;
|
||||
|
||||
|
|
@ -677,6 +678,35 @@ class VideoTest extends AbstractStreamableTestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function testCaseWhereKiloBitRateIsEqualToZero()
|
||||
{
|
||||
$driver = $this->getFFMpegDriverMock();
|
||||
$ffprobe = $this->getFFProbeMock();
|
||||
|
||||
$pathfile = '/target/destination';
|
||||
$outputPathfile = '/target/file';
|
||||
|
||||
$format = new X264();
|
||||
$format->setKiloBitrate(0);
|
||||
|
||||
$configuration = $this->getMockBuilder('Alchemy\BinaryDriver\ConfigurationInterface')->getMock();
|
||||
|
||||
$driver->expects($this->any())
|
||||
->method('getConfiguration')
|
||||
->will($this->returnValue($configuration));
|
||||
|
||||
$driver->expects($this->exactly(1))
|
||||
->method('command')
|
||||
->with($this->isType('array'), false, $this->anything())
|
||||
->will($this->returnCallback(function ($commands, $errors, $listeners) {
|
||||
var_dump($commands);
|
||||
$this->assertTrue(!in_array('-b:v', $commands));
|
||||
}));
|
||||
|
||||
$video = new Video(__FILE__, $driver, $ffprobe);
|
||||
$video->save($format, $outputPathfile);
|
||||
}
|
||||
|
||||
public function getClassName()
|
||||
{
|
||||
return 'FFMpeg\Media\Video';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue