* 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>
		
			
				
	
	
		
			31 lines
		
	
	
	
		
			772 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
	
		
			772 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace Tests\FFMpeg\Functional;
 | |
| 
 | |
| use FFMpeg\Format\Audio\Mp3;
 | |
| use FFMpeg\Media\Audio;
 | |
| 
 | |
| class AudioConcatenationTest extends FunctionalTestCase
 | |
| {
 | |
|     public function testSimpleAudioFileConcatTest()
 | |
|     {
 | |
|         $ffmpeg = $this->getFFMpeg();
 | |
| 
 | |
|         $files = [
 | |
|             realpath(__DIR__ . '/../files/Jahzzar_-_05_-_Siesta.mp3'),
 | |
|             realpath(__DIR__ . '/../files/02_-_Favorite_Secrets.mp3'),
 | |
|         ];
 | |
| 
 | |
|         $audio = $ffmpeg->open(reset($files));
 | |
| 
 | |
|         $this->assertInstanceOf('FFMpeg\Media\Audio', $audio);
 | |
| 
 | |
|         clearstatcache();
 | |
|         $filename = __DIR__ . '/output/concat-output.mp3';
 | |
| 
 | |
|         $audio->concat($files)->saveFromSameCodecs($filename, TRUE);
 | |
| 
 | |
|         $this->assertFileExists($filename);
 | |
|         unlink($filename);
 | |
|     }
 | |
| }
 |