1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

refine ffmepg and encoder, extract ffmpeg.

This commit is contained in:
winlin 2014-04-07 09:34:36 +08:00
parent 095364a72b
commit 72c330d47c
6 changed files with 593 additions and 509 deletions

View file

@ -39,47 +39,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
class SrsConfDirective;
class SrsRequest;
class SrsPithyPrint;
/**
* a transcode engine: ffmepg,
* used to transcode a stream to another.
*/
class SrsFFMPEG
{
private:
bool started;
pid_t pid;
private:
std::string log_file;
int log_fd;
private:
std::string ffmpeg;
std::vector<std::string> vfilter;
std::string vcodec;
int vbitrate;
double vfps;
int vwidth;
int vheight;
int vthreads;
std::string vprofile;
std::string vpreset;
std::vector<std::string> vparams;
std::string acodec;
int abitrate;
int asample_rate;
int achannels;
std::vector<std::string> aparams;
std::string output;
std::string input;
public:
SrsFFMPEG(std::string ffmpeg_bin);
virtual ~SrsFFMPEG();
public:
virtual int initialize(SrsRequest* req, SrsConfDirective* engine);
virtual int start();
virtual int cycle();
virtual void stop();
};
class SrsFFMPEG;
/**
* the encoder for a stream,