Вход Регистрация
Файл: vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Clip.php
Строк: 38
<?php

namespace FFMpegMedia;

use 
FFMpegCoordinateTimeCode;
use 
FFMpegDriverFFMpegDriver;
use 
FFMpegFFProbe;
use 
FFMpegFormatFormatInterface;

/**
 * Video clip.
 *
 * Use input seeking, see http://trac.ffmpeg.org/wiki/Seeking
 */
class Clip extends Video
{
    
/** @var TimeCode Start time */
    
private $start;

    
/** @var TimeCode Duration */
    
private $duration;

    
/** @var Video Parrent video */
    
private $video;

    public function 
__construct(Video $videoFFMpegDriver $driverFFProbe $ffprobeTimeCode $start, ?TimeCode $duration null)
    {
        
$this->start $start;
        
$this->duration $duration;
        
$this->video $video;

        
parent::__construct($video->getPathfile(), $driver$ffprobe);
    }

    
/**
     * Returns the video related to the frame.
     *
     * @return Video
     */
    
public function getVideo()
    {
        return 
$this->video;
    }

    
/**
     * Return base part of command.
     *
     * @return array
     */
    
protected function basePartOfCommand(FormatInterface $format)
    {
        
$arr = ['-y''-ss', (string) $this->start'-i'$this->pathfile];

        if (
false === is_null($this->duration)) {
            
$arr[] = '-t';
            
$arr[] = (string) $this->duration;
        }

        return 
$arr;
    }
}
Онлайн: 1
Реклама