mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 19:31:53 +00:00
Ingest: Still use -re for stream to ingest HLS better.
This commit is contained in:
parent
dd37a041b9
commit
7d47017a00
8 changed files with 32 additions and 27 deletions
|
@ -73,7 +73,7 @@ vhost demo.srs.com {
|
|||
achannels 2;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
engine sd {
|
||||
enabled on;
|
||||
|
@ -96,7 +96,7 @@ vhost demo.srs.com {
|
|||
achannels 2;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
ingest {
|
||||
|
@ -108,7 +108,7 @@ vhost demo.srs.com {
|
|||
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
|
||||
engine {
|
||||
enabled off;
|
||||
output rtmp://127.0.0.1:[port]/live?vhost=[vhost]/livestream;
|
||||
output rtmp://127.0.0.1:[port]/live/livestream?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ vhost players {
|
|||
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
|
||||
engine {
|
||||
enabled off;
|
||||
output rtmp://127.0.0.1:[port]/live?vhost=[vhost]/demo;
|
||||
output rtmp://127.0.0.1:[port]/live/demo?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ vhost __defaultVhost__ {
|
|||
acodec libfdk_aac;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1716,7 +1716,7 @@ vhost ingest.srs.com {
|
|||
# [999], replace this const to current millisecond.
|
||||
# [timestamp],replace this const to current UNIX timestamp in ms.
|
||||
# @remark we use golang time format "2006-01-02 15:04:05.999" as "[2006]-[01]-[02]_[15].[04].[05]_[999]"
|
||||
output rtmp://127.0.0.1:[port]/live?vhost=[vhost]/livestream;
|
||||
output rtmp://127.0.0.1:[port]/live/livestream?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1764,7 +1764,7 @@ vhost transcode.ingest.srs.com {
|
|||
profile:a aac_low;
|
||||
}
|
||||
oformat flv;
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1914,7 +1914,7 @@ vhost example.transcode.srs.com {
|
|||
# [999], replace this const to current millisecond.
|
||||
# [timestamp],replace this const to current UNIX timestamp in ms.
|
||||
# @remark we use golang time format "2006-01-02 15:04:05.999" as "[2006]-[01]-[02]_[15].[04].[05]_[999]"
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1944,7 +1944,7 @@ vhost mirror.transcode.srs.com {
|
|||
achannels 2;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1977,7 +1977,7 @@ vhost crop.transcode.srs.com {
|
|||
achannels 2;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2008,7 +2008,7 @@ vhost logo.transcode.srs.com {
|
|||
achannels 2;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2028,7 +2028,7 @@ vhost audio.transcode.srs.com {
|
|||
achannels 2;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2047,7 +2047,7 @@ vhost vn.transcode.srs.com {
|
|||
achannels 2;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2061,7 +2061,7 @@ vhost copy.transcode.srs.com {
|
|||
enabled on;
|
||||
vcodec copy;
|
||||
acodec copy;
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2101,7 +2101,7 @@ vhost all.transcode.srs.com {
|
|||
profile:a aac_low;
|
||||
}
|
||||
oformat flv;
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
engine ffhd {
|
||||
enabled on;
|
||||
|
@ -2121,7 +2121,7 @@ vhost all.transcode.srs.com {
|
|||
achannels 2;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
engine ffsd {
|
||||
enabled on;
|
||||
|
@ -2141,7 +2141,7 @@ vhost all.transcode.srs.com {
|
|||
achannels 2;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
engine fffast {
|
||||
enabled on;
|
||||
|
@ -2161,7 +2161,7 @@ vhost all.transcode.srs.com {
|
|||
achannels 2;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
engine vcopy {
|
||||
enabled on;
|
||||
|
@ -2172,7 +2172,7 @@ vhost all.transcode.srs.com {
|
|||
achannels 2;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
engine acopy {
|
||||
enabled on;
|
||||
|
@ -2187,13 +2187,13 @@ vhost all.transcode.srs.com {
|
|||
vparams {
|
||||
}
|
||||
acodec copy;
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
engine copy {
|
||||
enabled on;
|
||||
vcodec copy;
|
||||
acodec copy;
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ vhost __defaultVhost__ {
|
|||
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
|
||||
engine {
|
||||
enabled off;
|
||||
output rtmp://127.0.0.1:[port]/live?vhost=[vhost]/livestream;
|
||||
output rtmp://127.0.0.1:[port]/live/livestream?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ vhost __defaultVhost__ {
|
|||
}
|
||||
vcodec copy;
|
||||
acodec copy;
|
||||
output rtmp://127.0.0.1:[port]/live?vhost=[vhost]/livestream;
|
||||
output rtmp://127.0.0.1:[port]/live/livestream?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ vhost __defaultVhost__ {
|
|||
acodec libfdk_aac;
|
||||
aparams {
|
||||
}
|
||||
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
|
||||
output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ vhost source.srs.com {
|
|||
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
|
||||
engine {
|
||||
enabled off;
|
||||
output rtmp://127.0.0.1:[port]/live?vhost=[vhost]/livestream;
|
||||
output rtmp://127.0.0.1:[port]/live/livestream?vhost=[vhost];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -369,6 +369,11 @@ srs_error_t SrsIngester::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsConfDirective*
|
|||
output = srs_string_replace(output, "[vhost]", vhost->arg0());
|
||||
output = srs_string_replace(output, "[port]", srs_int2str(port));
|
||||
output = srs_path_build_timestamp(output);
|
||||
// Remove the only param with default vhost.
|
||||
output = srs_string_replace(output, "vhost=" SRS_CONSTS_RTMP_DEFAULT_VHOST, "");
|
||||
output = srs_string_replace(output, "?&", "?");
|
||||
output = srs_string_replace(output, "?/", "/"); // For params over app.
|
||||
output = srs_string_trim_end(output, "?");
|
||||
if (output.empty()) {
|
||||
return srs_error_new(ERROR_ENCODER_NO_OUTPUT, "empty output url, ingest=%s", ingest->arg0().c_str());
|
||||
}
|
||||
|
@ -427,8 +432,8 @@ srs_error_t SrsIngester::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsConfDirective*
|
|||
return srs_error_new(ERROR_ENCODER_NO_INPUT, "empty intput url, ingest=%s", ingest->arg0().c_str());
|
||||
}
|
||||
|
||||
// for stream, no re.
|
||||
ffmpeg->append_iparam("");
|
||||
// For stream, also use -re, to ingest HLS better.
|
||||
ffmpeg->append_iparam("-re");
|
||||
|
||||
if ((err = ffmpeg->initialize(input_url, output, log_file)) != srs_success) {
|
||||
return srs_error_wrap(err, "init ffmpeg");
|
||||
|
|
Loading…
Reference in a new issue