We add a missing parameter to the ffmpeg command
This commit is contained in:
		
					parent
					
						
							
								9f970c5d5a
							
						
					
				
			
			
				commit
				
					
						18845d406e
					
				
			
		
					 2 changed files with 10 additions and 3 deletions
				
			
		|  | @ -185,10 +185,12 @@ class Video extends Audio | ||||||
|     /** |     /** | ||||||
|      * Gets the waveform of the video. |      * Gets the waveform of the video. | ||||||
|      * |      * | ||||||
|  |      * @param  integer $width | ||||||
|  |      * @param  integer $height | ||||||
|      * @return Waveform |      * @return Waveform | ||||||
|      */ |      */ | ||||||
|     public function waveform() |     public function waveform($width = 640, $height = 120) | ||||||
|     { |     { | ||||||
|         return new Waveform($this, $this->driver, $this->ffprobe); |         return new Waveform($this, $this->driver, $this->ffprobe, $width, $height); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -23,11 +23,15 @@ class Waveform extends AbstractMediaType | ||||||
| { | { | ||||||
|     /** @var Video */ |     /** @var Video */ | ||||||
|     private $video; |     private $video; | ||||||
|  |     private $width; | ||||||
|  |     private $height; | ||||||
| 
 | 
 | ||||||
|     public function __construct(Video $video, FFMpegDriver $driver, FFProbe $ffprobe) |     public function __construct(Video $video, FFMpegDriver $driver, FFProbe $ffprobe, $width, $height) | ||||||
|     { |     { | ||||||
|         parent::__construct($video->getPathfile(), $driver, $ffprobe); |         parent::__construct($video->getPathfile(), $driver, $ffprobe); | ||||||
|         $this->video = $video; |         $this->video = $video; | ||||||
|  |         $this->width = $width; | ||||||
|  |         $this->height = $height; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  | @ -79,6 +83,7 @@ class Waveform extends AbstractMediaType | ||||||
|          */ |          */ | ||||||
|         $commands = array( |         $commands = array( | ||||||
|             '-i', 'input', '-filter_complex', |             '-i', 'input', '-filter_complex', | ||||||
|  |             'showwavespic=s='.$this->width.'x'.$this->height, | ||||||
|             '-frames:v', '1', |             '-frames:v', '1', | ||||||
|             $this->pathfile |             $this->pathfile | ||||||
|         ); |         ); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue