Improvements in the way we deal with filters for the waveform
This commit is contained in:
		
					parent
					
						
							
								7ce571119a
							
						
					
				
			
			
				commit
				
					
						dab2ae5a8c
					
				
			
		
					 2 changed files with 5 additions and 11 deletions
				
			
		|  | @ -41,19 +41,13 @@ class WaveformRatioFixerFilter implements WaveformFilterInterface | ||||||
|         $dimensions = null; |         $dimensions = null; | ||||||
|         $commands = array(); |         $commands = array(); | ||||||
| 
 | 
 | ||||||
|         foreach ($waveform->getVideo()->getStreams() as $stream) { |         foreach ($waveform->getAudio()->getStreams() as $stream) { | ||||||
|             if ($stream->isVideo()) { |             if ($stream->isAudio()) { | ||||||
|                 try { |                 try { | ||||||
|                      |                      | ||||||
|                     // Get the dimensions of the video
 |  | ||||||
|                     $dimensions = $stream->getDimensions(); |  | ||||||
|                      |  | ||||||
|                     // If the downmix parameter is set to TRUE, we add an option to the FFMPEG command
 |                     // If the downmix parameter is set to TRUE, we add an option to the FFMPEG command
 | ||||||
|                     if(!$this->downmix) { |                     if($this->downmix == TRUE) { | ||||||
|                         $commands[] = '"showwavespic=s=' . $dimensions->getWidth() . 'x' . $dimensions->getHeight().'"'; |                         $commands[] = '"aformat=channel_layouts=mono"'; | ||||||
|                     } |  | ||||||
|                     else { |  | ||||||
|                         $commands[] = '"aformat=channel_layouts=mono,showwavespic=s=' . $dimensions->getWidth() . 'x' . $dimensions->getHeight().'"'; |  | ||||||
|                     } |                     } | ||||||
|                      |                      | ||||||
|                     break; |                     break; | ||||||
|  |  | ||||||
|  | @ -26,7 +26,7 @@ class Waveform extends AbstractMediaType | ||||||
|     private $width; |     private $width; | ||||||
|     private $height; |     private $height; | ||||||
| 
 | 
 | ||||||
|     public function __construct(Video $video, FFMpegDriver $driver, FFProbe $ffprobe, $width, $height) |     public function __construct(Audio $audio, FFMpegDriver $driver, FFProbe $ffprobe, $width, $height) | ||||||
|     { |     { | ||||||
|         parent::__construct($video->getPathfile(), $driver, $ffprobe); |         parent::__construct($video->getPathfile(), $driver, $ffprobe); | ||||||
|         $this->video = $video; |         $this->video = $video; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue