mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix #119: use iformat and oformat for ffmpeg transcode.
This commit is contained in:
parent
9bf7b722db
commit
f8423dfa90
5 changed files with 15 additions and 6 deletions
|
@ -208,6 +208,7 @@ Supported operating systems and hardware:
|
|||
* 2013-10-17, Created.<br/>
|
||||
|
||||
## History
|
||||
* v1.0, 2014-07-19, fix [#119](https://github.com/winlinvip/simple-rtmp-server/issues/119), use iformat and oformat for ffmpeg transcode. 0.9.163.
|
||||
* <strong>v1.0, 2014-07-13, [1.0 mainline6(0.9.160)](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0.mainline8) released. 50029 lines.</strong>
|
||||
* v1.0, 2014-07-13, refine the bandwidth check/test, add as/js library, use srs-librtmp for linux tool. 0.9.159
|
||||
* v1.0, 2014-07-12, complete rtmp stack utest. 0.9.156
|
||||
|
|
|
@ -76,6 +76,11 @@ void SrsFFMPEG::set_iparams(string iparams)
|
|||
_iparams = iparams;
|
||||
}
|
||||
|
||||
void SrsFFMPEG::set_oformat(string format)
|
||||
{
|
||||
oformat = format;
|
||||
}
|
||||
|
||||
string SrsFFMPEG::output()
|
||||
{
|
||||
return _output;
|
||||
|
@ -243,7 +248,7 @@ int SrsFFMPEG::start()
|
|||
}
|
||||
|
||||
// input.
|
||||
if (iformat != "off") {
|
||||
if (iformat != "off" && !iformat.empty()) {
|
||||
params.push_back("-f");
|
||||
params.push_back(iformat);
|
||||
}
|
||||
|
@ -346,7 +351,7 @@ int SrsFFMPEG::start()
|
|||
}
|
||||
|
||||
// output
|
||||
if (oformat != "off") {
|
||||
if (oformat != "off" && !oformat.empty()) {
|
||||
params.push_back("-f");
|
||||
params.push_back(oformat);
|
||||
}
|
||||
|
|
|
@ -75,6 +75,7 @@ public:
|
|||
virtual ~SrsFFMPEG();
|
||||
public:
|
||||
virtual void set_iparams(std::string iparams);
|
||||
virtual void set_oformat(std::string format);
|
||||
virtual std::string output();
|
||||
public:
|
||||
virtual int initialize(std::string in, std::string out, std::string log);
|
||||
|
|
|
@ -317,12 +317,14 @@ int SrsIngester::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsConfDirective* vhost, S
|
|||
ingest->arg0().c_str(), input_type.c_str(), ret);
|
||||
}
|
||||
|
||||
// set output format to flv for RTMP
|
||||
ffmpeg->set_oformat("flv");
|
||||
|
||||
std::string vcodec = _srs_config->get_engine_vcodec(engine);
|
||||
std::string acodec = _srs_config->get_engine_acodec(engine);
|
||||
// whatever the engine config, use copy as default.
|
||||
if (!engine || vcodec.empty() || acodec.empty()
|
||||
|| !_srs_config->get_engine_enabled(engine)
|
||||
) {
|
||||
bool engine_disabled = !engine || !_srs_config->get_engine_enabled(engine);
|
||||
if (engine_disabled || vcodec.empty() || acodec.empty()) {
|
||||
if ((ret = ffmpeg->initialize_copy()) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
// current release version
|
||||
#define VERSION_MAJOR "0"
|
||||
#define VERSION_MINOR "9"
|
||||
#define VERSION_REVISION "162"
|
||||
#define VERSION_REVISION "163"
|
||||
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
|
||||
// server info.
|
||||
#define RTMP_SIG_SRS_KEY "SRS"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue