Add audio formats MP3 and Flac
This commit is contained in:
parent
94775176c9
commit
5b53381904
9 changed files with 123 additions and 5 deletions
17
src/FFMpeg/Format/Audio/Flac.php
Normal file
17
src/FFMpeg/Format/Audio/Flac.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace FFMpeg\Format\Audio;
|
||||
|
||||
use FFMpeg\Format\DefaultAudioFormat;
|
||||
|
||||
class Flac extends DefaultAudioFormat
|
||||
{
|
||||
|
||||
protected $audioCodec = 'flac';
|
||||
|
||||
protected function getAvailableAudioCodecs()
|
||||
{
|
||||
return array('flac');
|
||||
}
|
||||
|
||||
}
|
||||
17
src/FFMpeg/Format/Audio/Mp3.php
Normal file
17
src/FFMpeg/Format/Audio/Mp3.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace FFMpeg\Format\Audio;
|
||||
|
||||
use FFMpeg\Format\DefaultAudioFormat;
|
||||
|
||||
class Mp3 extends DefaultAudioFormat
|
||||
{
|
||||
|
||||
protected $audioCodec = 'libmp3lame';
|
||||
|
||||
protected function getAvailableAudioCodecs()
|
||||
{
|
||||
return array('libmp3lame');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ abstract class DefaultAudioFormat implements AudioFormat
|
|||
|
||||
protected $audioCodec;
|
||||
protected $audioSampleRate = 44100;
|
||||
protected $kiloBitrate = 1000;
|
||||
protected $kiloBitrate = 128;
|
||||
|
||||
public function getExtraParams()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,9 +7,10 @@ abstract class DefaultVideoFormat extends DefaultAudioFormat implements VideoFor
|
|||
|
||||
protected $width;
|
||||
protected $height;
|
||||
protected $frameRate = 25;
|
||||
protected $frameRate = 25;
|
||||
protected $videoCodec;
|
||||
protected $GOPsize = 25;
|
||||
protected $GOPsize = 25;
|
||||
protected $kiloBitrate = 1000;
|
||||
|
||||
public function __construct($width, $height)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace FFMpeg\Format;
|
||||
|
||||
interface VideoFormat
|
||||
interface VideoFormat extends AudioFormat
|
||||
{
|
||||
|
||||
public function getWidth();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue