mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +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
|
@ -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…
Add table
Add a link
Reference in a new issue