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

use libfdk_aac for srs2.

This commit is contained in:
winlin 2015-06-08 15:02:19 +08:00
parent 00a25ee5c5
commit 574cf6a094
5 changed files with 37 additions and 35 deletions

View file

@ -2860,13 +2860,15 @@ vector<string> SrsConfig::get_engine_vfilter(SrsConfDirective* engine)
string SrsConfig::get_engine_vcodec(SrsConfDirective* engine)
{
static string DEFAULT = "";
if (!engine) {
return "";
return DEFAULT;
}
SrsConfDirective* conf = engine->get("vcodec");
if (!conf) {
return "";
return DEFAULT;
}
return conf->arg0();
@ -2998,13 +3000,15 @@ vector<string> SrsConfig::get_engine_vparams(SrsConfDirective* engine)
string SrsConfig::get_engine_acodec(SrsConfDirective* engine)
{
static string DEFAULT = "";
if (!engine) {
return "";
return DEFAULT;
}
SrsConfDirective* conf = engine->get("acodec");
if (!conf) {
return "";
return DEFAULT;
}
return conf->arg0();

View file

@ -783,7 +783,7 @@ public:
virtual std::vector<std::string> get_engine_vfilter(SrsConfDirective* engine);
/**
* get the vcodec of engine,
* the codec of video, copy or libx264
* the codec of video, can be vn, copy or libx264
*/
virtual std::string get_engine_vcodec(SrsConfDirective* engine);
/**
@ -827,7 +827,7 @@ public:
virtual std::vector<std::string> get_engine_vparams(SrsConfDirective* engine);
/**
* get the acodec of engine,
* the audio codec can be copy or libaacplus
* the audio codec can be an, copy or libfdk_aac
*/
virtual std::string get_engine_acodec(SrsConfDirective* engine);
/**

View file

@ -48,6 +48,7 @@ using namespace std;
// for example, libaacplus, aac, fdkaac
#define SRS_RTMP_ENCODER_ACODEC "aac"
#define SRS_RTMP_ENCODER_LIBAACPLUS "libaacplus"
#define SRS_RTMP_ENCODER_LIBFDKAAC "libfdk_aac"
SrsFFMPEG::SrsFFMPEG(std::string ffmpeg_bin)
{
@ -174,7 +175,7 @@ int SrsFFMPEG::initialize_transcode(SrsConfDirective* engine)
}
// @see, https://github.com/simple-rtmp-server/srs/issues/145
if (acodec == SRS_RTMP_ENCODER_LIBAACPLUS) {
if (acodec == SRS_RTMP_ENCODER_LIBAACPLUS && acodec != SRS_RTMP_ENCODER_LIBFDKAAC) {
if (abitrate < 16 || abitrate > 72) {
ret = ERROR_ENCODER_ABITRATE;
srs_error("invalid abitrate for aac: %d, must in [16, 72], ret=%d", abitrate, ret);