Remove suffix of Format classes
This commit is contained in:
parent
cd33043f78
commit
3a9544a124
1 changed files with 10 additions and 10 deletions
|
|
@ -14,8 +14,8 @@ namespace FFMpeg;
|
||||||
use FFMpeg\Exception\InvalidArgumentException;
|
use FFMpeg\Exception\InvalidArgumentException;
|
||||||
use FFMpeg\Exception\LogicException;
|
use FFMpeg\Exception\LogicException;
|
||||||
use FFMpeg\Exception\RuntimeException;
|
use FFMpeg\Exception\RuntimeException;
|
||||||
use FFMpeg\Format\AudioFormat;
|
use FFMpeg\Format\Audio;
|
||||||
use FFMpeg\Format\VideoFormat;
|
use FFMpeg\Format\Video;
|
||||||
use Symfony\Component\Process\Process;
|
use Symfony\Component\Process\Process;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -108,14 +108,14 @@ class FFMpeg extends Binary
|
||||||
/**
|
/**
|
||||||
* Encode the file to the specified format
|
* Encode the file to the specified format
|
||||||
*
|
*
|
||||||
* @param AudioFormat $format The output format
|
* @param Audio $format The output format
|
||||||
* @param string $outputPathfile The pathfile where to write
|
* @param string $outputPathfile The pathfile where to write
|
||||||
* @param integer $threads The number of threads to use
|
* @param integer $threads The number of threads to use
|
||||||
* @return \FFMpeg\FFMpeg
|
* @return \FFMpeg\FFMpeg
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
* @throws LogicException
|
* @throws LogicException
|
||||||
*/
|
*/
|
||||||
public function encode(AudioFormat $format, $outputPathfile, $threads = 1)
|
public function encode(Audio $format, $outputPathfile, $threads = 1)
|
||||||
{
|
{
|
||||||
if ( ! $this->pathfile) {
|
if ( ! $this->pathfile) {
|
||||||
throw new LogicException('No file open');
|
throw new LogicException('No file open');
|
||||||
|
|
@ -124,11 +124,11 @@ class FFMpeg extends Binary
|
||||||
$threads = max(min($threads, 64), 1);
|
$threads = max(min($threads, 64), 1);
|
||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case $format instanceof VideoFormat:
|
case $format instanceof Video:
|
||||||
$this->encodeVideo($format, $outputPathfile, $threads);
|
$this->encodeVideo($format, $outputPathfile, $threads);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case $format instanceof AudioFormat:
|
case $format instanceof Audio:
|
||||||
$this->encodeAudio($format, $outputPathfile, $threads);
|
$this->encodeAudio($format, $outputPathfile, $threads);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -139,13 +139,13 @@ class FFMpeg extends Binary
|
||||||
/**
|
/**
|
||||||
* Encode to audio
|
* Encode to audio
|
||||||
*
|
*
|
||||||
* @param AudioFormat $format The output format
|
* @param Audio $format The output format
|
||||||
* @param string $outputPathfile The pathfile where to write
|
* @param string $outputPathfile The pathfile where to write
|
||||||
* @param integer $threads The number of threads to use
|
* @param integer $threads The number of threads to use
|
||||||
* @return \FFMpeg\FFMpeg
|
* @return \FFMpeg\FFMpeg
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
protected function encodeAudio(AudioFormat $format, $outputPathfile, $threads)
|
protected function encodeAudio(Audio $format, $outputPathfile, $threads)
|
||||||
{
|
{
|
||||||
$cmd = $this->binary
|
$cmd = $this->binary
|
||||||
. ' -y -i '
|
. ' -y -i '
|
||||||
|
|
@ -180,13 +180,13 @@ class FFMpeg extends Binary
|
||||||
/**
|
/**
|
||||||
* Encode to video
|
* Encode to video
|
||||||
*
|
*
|
||||||
* @param VideoFormat $format The output format
|
* @param Video $format The output format
|
||||||
* @param string $outputPathfile The pathfile where to write
|
* @param string $outputPathfile The pathfile where to write
|
||||||
* @param integer $threads The number of threads to use
|
* @param integer $threads The number of threads to use
|
||||||
* @return \FFMpeg\FFMpeg
|
* @return \FFMpeg\FFMpeg
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
protected function encodeVideo(VideoFormat $format, $outputPathfile, $threads)
|
protected function encodeVideo(Video $format, $outputPathfile, $threads)
|
||||||
{
|
{
|
||||||
$cmd_part1 = $this->binary
|
$cmd_part1 = $this->binary
|
||||||
. ' -y -i '
|
. ' -y -i '
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue