Added custom filter support
This commit is contained in:
		
					parent
					
						
							
								475d1a508a
							
						
					
				
			
			
				commit
				
					
						72d7a8c236
					
				
			
		
					 2 changed files with 71 additions and 0 deletions
				
			
		
							
								
								
									
										51
									
								
								src/FFMpeg/Filters/Video/CustomFilter.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								src/FFMpeg/Filters/Video/CustomFilter.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,51 @@ | |||
| <?php | ||||
| 
 | ||||
| /* | ||||
|  * This file is part of PHP-FFmpeg. | ||||
|  * | ||||
|  * (c) Alchemy <dev.team@alchemy.fr> | ||||
|  * | ||||
|  * For the full copyright and license information, please view the LICENSE | ||||
|  * file that was distributed with this source code. | ||||
|  */ | ||||
| namespace FFMpeg\Filters\Video; | ||||
| 
 | ||||
| use FFMpeg\Format\VideoInterface; | ||||
| use FFMpeg\Media\Video; | ||||
| 
 | ||||
| class CustomFilter implements VideoFilterInterface | ||||
| { | ||||
|     /** @var string */ | ||||
|     private $filter; | ||||
|     /** @var integer */ | ||||
|     private $priority; | ||||
| 
 | ||||
|     /** | ||||
|      * A custom filter, useful if you want to build complex filters | ||||
|      * | ||||
|      * @param string $filter | ||||
|      * @param int $priority | ||||
|      */ | ||||
|     public function __construct($filter, $priority = 0) | ||||
|     { | ||||
|         $this->filter = $filter; | ||||
|         $this->priority = $priority; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritdoc} | ||||
|      */ | ||||
|     public function getPriority() | ||||
|     { | ||||
|         return $this->priority; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritdoc} | ||||
|      */ | ||||
|     public function apply(Video $video, VideoInterface $format) | ||||
|     { | ||||
|         $commands = array('-vf', $this->filter); | ||||
|         return $commands; | ||||
|     } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue