Fix CS
This commit is contained in:
parent
634e67d7ec
commit
3a080613e6
8 changed files with 12 additions and 23 deletions
|
|
@ -12,8 +12,6 @@
|
|||
namespace FFMpeg;
|
||||
|
||||
use Doctrine\Common\Cache\ArrayCache;
|
||||
use FFMpeg\FFMpeg;
|
||||
use FFMpeg\FFProbe;
|
||||
use Silex\Application;
|
||||
use Silex\ServiceProviderInterface;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
namespace FFMpeg\Filters\Audio;
|
||||
|
||||
use FFMpeg\Media\Audio;
|
||||
use FFMpeg\Filters\Audio\AudioResamplableFilter;
|
||||
|
||||
class AudioFilters
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class CustomFilter implements VideoFilterInterface
|
|||
* A custom filter, useful if you want to build complex filters
|
||||
*
|
||||
* @param string $filter
|
||||
* @param int $priority
|
||||
* @param int $priority
|
||||
*/
|
||||
public function __construct($filter, $priority = 0)
|
||||
{
|
||||
|
|
@ -46,6 +46,7 @@ class CustomFilter implements VideoFilterInterface
|
|||
public function apply(Video $video, VideoInterface $format)
|
||||
{
|
||||
$commands = array('-vf', $this->filter);
|
||||
|
||||
return $commands;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class VideoFilters extends AudioFilters
|
|||
|
||||
/**
|
||||
* @param string $imagePath
|
||||
* @param array $coordinates
|
||||
* @param array $coordinates
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ namespace FFMpeg\Filters\Video;
|
|||
|
||||
use FFMpeg\Format\VideoInterface;
|
||||
use FFMpeg\Media\Video;
|
||||
use FFMpeg\Coordinate\TimeCode;
|
||||
|
||||
class WatermarkFilter implements VideoFilterInterface
|
||||
{
|
||||
|
|
@ -24,7 +23,6 @@ class WatermarkFilter implements VideoFilterInterface
|
|||
/** @var integer */
|
||||
private $priority;
|
||||
|
||||
|
||||
public function __construct($watermarkPath, array $coordinates = array(), $priority = 0)
|
||||
{
|
||||
$this->watermarkPath = $watermarkPath;
|
||||
|
|
@ -47,25 +45,21 @@ class WatermarkFilter implements VideoFilterInterface
|
|||
{
|
||||
$position = isset($this->coordinates['position']) ? $this->coordinates['position'] : 'absolute';
|
||||
|
||||
switch($position) {
|
||||
switch ($position) {
|
||||
case 'relative':
|
||||
if (isset($this->coordinates['top'])) {
|
||||
$y = $this->coordinates['top'];
|
||||
}
|
||||
elseif (isset($this->coordinates['bottom'])) {
|
||||
} elseif (isset($this->coordinates['bottom'])) {
|
||||
$y = sprintf('main_h - %d - overlay_h', $this->coordinates['bottom']);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$y = 0;
|
||||
}
|
||||
|
||||
if (isset($this->coordinates['left'])) {
|
||||
$x = $this->coordinates['left'];
|
||||
}
|
||||
elseif (isset($this->coordinates['right'])) {
|
||||
} elseif (isset($this->coordinates['right'])) {
|
||||
$x = sprintf('main_w - %d - overlay_w', $this->coordinates['right']);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$x = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ namespace FFMpeg\Media;
|
|||
use FFMpeg\Driver\FFMpegDriver;
|
||||
use FFMpeg\FFProbe;
|
||||
use FFMpeg\Filters\FiltersCollection;
|
||||
use FFMpeg\Media\MediaTypeInterface;
|
||||
|
||||
abstract class AbstractMediaType implements MediaTypeInterface
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ use FFMpeg\Driver\FFMpegDriver;
|
|||
use FFMpeg\FFProbe;
|
||||
use FFMpeg\Exception\RuntimeException;
|
||||
use FFMpeg\Coordinate\TimeCode;
|
||||
use FFMpeg\Media\Video;
|
||||
|
||||
class Frame extends AbstractMediaType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ use FFMpeg\Format\FormatInterface;
|
|||
use FFMpeg\Format\ProgressableInterface;
|
||||
use FFMpeg\Format\AudioInterface;
|
||||
use FFMpeg\Format\VideoInterface;
|
||||
use FFMpeg\Media\Frame;
|
||||
use Neutron\TemporaryFilesystem\Manager as FsManager;
|
||||
|
||||
class Video extends Audio
|
||||
|
|
@ -69,12 +68,12 @@ class Video extends Audio
|
|||
if ($this->driver->getConfiguration()->has('ffmpeg.threads')) {
|
||||
$filters->add(new SimpleFilter(array('-threads', $this->driver->getConfiguration()->get('ffmpeg.threads'))));
|
||||
}
|
||||
if ($format instanceOf VideoInterface) {
|
||||
if ($format instanceof VideoInterface) {
|
||||
if (null !== $format->getVideoCodec()) {
|
||||
$filters->add(new SimpleFilter(array('-vcodec', $format->getVideoCodec())));
|
||||
}
|
||||
}
|
||||
if ($format instanceOf AudioInterface) {
|
||||
if ($format instanceof AudioInterface) {
|
||||
if (null !== $format->getAudioCodec()) {
|
||||
$filters->add(new SimpleFilter(array('-acodec', $format->getAudioCodec())));
|
||||
}
|
||||
|
|
@ -84,7 +83,7 @@ class Video extends Audio
|
|||
$commands = array_merge($commands, $filter->apply($this, $format));
|
||||
}
|
||||
|
||||
if ($format instanceOf VideoInterface) {
|
||||
if ($format instanceof VideoInterface) {
|
||||
$commands[] = '-b:v';
|
||||
$commands[] = $format->getKiloBitrate() . 'k';
|
||||
$commands[] = '-refs';
|
||||
|
|
@ -109,7 +108,7 @@ class Video extends Audio
|
|||
$commands[] = '1';
|
||||
}
|
||||
|
||||
if ($format instanceOf AudioInterface) {
|
||||
if ($format instanceof AudioInterface) {
|
||||
if (null !== $format->getAudioKiloBitrate()) {
|
||||
$commands[] = '-b:a';
|
||||
$commands[] = $format->getAudioKiloBitrate() . 'k';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue