mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
This commit is contained in:
parent
4b6f1b0fd6
commit
d5bf0ba2da
7 changed files with 44 additions and 11 deletions
|
@ -1460,23 +1460,23 @@ vhost http.remux.srs.com {
|
||||||
drop_if_not_match on;
|
drop_if_not_match on;
|
||||||
# Whether stream has audio track, used as default value for stream metadata, for example, FLV header contains
|
# Whether stream has audio track, used as default value for stream metadata, for example, FLV header contains
|
||||||
# this flag. Sometimes you might want to force the metadata by disable guess_has_av.
|
# this flag. Sometimes you might want to force the metadata by disable guess_has_av.
|
||||||
# See https://github.com/ossrs/srs/issues/939#issuecomment-1351385460
|
# For HTTP-FLV, use this as default value for FLV header audio flag. See https://github.com/ossrs/srs/issues/939#issuecomment-1351385460
|
||||||
# TODO: Only support HTTP-FLV stream right now.
|
# For HTTP-TS, use this as default value for PMT table. See https://github.com/ossrs/srs/issues/939#issuecomment-1365086204
|
||||||
# Overwrite by env SRS_VHOST_HTTP_REMUX_HAS_AUDIO for all vhosts.
|
# Overwrite by env SRS_VHOST_HTTP_REMUX_HAS_AUDIO for all vhosts.
|
||||||
# Default: on
|
# Default: on
|
||||||
has_audio on;
|
has_audio on;
|
||||||
# Whether stream has video track, used as default value for stream metadata, for example, FLV header contains
|
# Whether stream has video track, used as default value for stream metadata, for example, FLV header contains
|
||||||
# this flag. Sometimes you might want to force the metadata by disable guess_has_av.
|
# this flag. Sometimes you might want to force the metadata by disable guess_has_av.
|
||||||
# See https://github.com/ossrs/srs/issues/939#issuecomment-1351385460
|
# For HTTP-FLV, use this as default value for FLV header video flag. See https://github.com/ossrs/srs/issues/939#issuecomment-1351385460
|
||||||
# TODO: Only support HTTP-FLV stream right now.
|
# For HTTP-TS, use this as default value for PMT table. See https://github.com/ossrs/srs/issues/939#issuecomment-1365086204
|
||||||
# Overwrite by env SRS_VHOST_HTTP_REMUX_HAS_VIDEO for all vhosts.
|
# Overwrite by env SRS_VHOST_HTTP_REMUX_HAS_VIDEO for all vhosts.
|
||||||
# Default: on
|
# Default: on
|
||||||
has_video on;
|
has_video on;
|
||||||
# Whether guessing stream about audio or video track, used to generate the flags in, such as FLV header. If
|
# Whether guessing stream about audio or video track, used to generate the flags in, such as FLV header. If
|
||||||
# guessing, depends on sequence header and frames in gop cache, so it might be incorrect especially your stream
|
# guessing, depends on sequence header and frames in gop cache, so it might be incorrect especially your stream
|
||||||
# is not regular. If not guessing, use the configured default value has_audio and has_video.
|
# is not regular. If not guessing, use the configured default value has_audio and has_video.
|
||||||
# See https://github.com/ossrs/srs/issues/939#issuecomment-1351385460
|
# For HTTP-FLV, enable guessing for av header flag, because FLV can't change the header. See https://github.com/ossrs/srs/issues/939#issuecomment-1351385460
|
||||||
# TODO: Only support HTTP-FLV stream right now.
|
# For HTTP-TS, ignore guessing because TS refresh the PMT when codec changed. See https://github.com/ossrs/srs/issues/939#issuecomment-1365086204
|
||||||
# Overwrite by env SRS_VHOST_HTTP_REMUX_GUESS_HAS_AV for all vhosts.
|
# Overwrite by env SRS_VHOST_HTTP_REMUX_GUESS_HAS_AV for all vhosts.
|
||||||
# Default: on
|
# Default: on
|
||||||
guess_has_av on;
|
guess_has_av on;
|
||||||
|
|
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
||||||
|
|
||||||
## SRS 6.0 Changelog
|
## SRS 6.0 Changelog
|
||||||
|
|
||||||
|
* v5.0, 2022-12-26, For [#465](https://github.com/ossrs/srs/issues/465): TS: Support disable audio or video to make mpegts.js happy. v6.0.9
|
||||||
* v5.0, 2022-12-26, For [#465](https://github.com/ossrs/srs/issues/465): TS: Fix bug for codec detecting for HTTP-TS. v6.0.8
|
* v5.0, 2022-12-26, For [#465](https://github.com/ossrs/srs/issues/465): TS: Fix bug for codec detecting for HTTP-TS. v6.0.8
|
||||||
* v5.0, 2022-12-25, For [#296](https://github.com/ossrs/srs/issues/296): Fix [#3338](https://github.com/ossrs/srs/issues/3338): MP3: Support play HTTP-MP3 by H5(srs-player). v6.0.7
|
* v5.0, 2022-12-25, For [#296](https://github.com/ossrs/srs/issues/296): Fix [#3338](https://github.com/ossrs/srs/issues/3338): MP3: Support play HTTP-MP3 by H5(srs-player). v6.0.7
|
||||||
* v6.0, 2022-12-17, Merge 5.0: FLV header and SRT bugfix. v6.0.6
|
* v6.0, 2022-12-17, Merge 5.0: FLV header and SRT bugfix. v6.0.6
|
||||||
|
|
|
@ -234,6 +234,15 @@ srs_error_t SrsTsStreamEncoder::dump_cache(SrsLiveConsumer* /*consumer*/, SrsRtm
|
||||||
return srs_success;
|
return srs_success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SrsTsStreamEncoder::set_has_audio(bool v)
|
||||||
|
{
|
||||||
|
enc->set_has_audio(v);
|
||||||
|
}
|
||||||
|
void SrsTsStreamEncoder::set_has_video(bool v)
|
||||||
|
{
|
||||||
|
enc->set_has_video(v);
|
||||||
|
}
|
||||||
|
|
||||||
SrsFlvStreamEncoder::SrsFlvStreamEncoder()
|
SrsFlvStreamEncoder::SrsFlvStreamEncoder()
|
||||||
{
|
{
|
||||||
header_written = false;
|
header_written = false;
|
||||||
|
@ -636,6 +645,8 @@ srs_error_t SrsLiveStream::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess
|
||||||
w->header()->set_content_type("video/MP2T");
|
w->header()->set_content_type("video/MP2T");
|
||||||
enc_desc = "TS";
|
enc_desc = "TS";
|
||||||
enc = new SrsTsStreamEncoder();
|
enc = new SrsTsStreamEncoder();
|
||||||
|
((SrsTsStreamEncoder*)enc)->set_has_audio(has_audio);
|
||||||
|
((SrsTsStreamEncoder*)enc)->set_has_video(has_video);
|
||||||
} else {
|
} else {
|
||||||
return srs_error_new(ERROR_HTTP_LIVE_STREAM_EXT, "invalid pattern=%s", entry->pattern.c_str());
|
return srs_error_new(ERROR_HTTP_LIVE_STREAM_EXT, "invalid pattern=%s", entry->pattern.c_str());
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,6 +110,9 @@ public:
|
||||||
public:
|
public:
|
||||||
virtual bool has_cache();
|
virtual bool has_cache();
|
||||||
virtual srs_error_t dump_cache(SrsLiveConsumer* consumer, SrsRtmpJitterAlgorithm jitter);
|
virtual srs_error_t dump_cache(SrsLiveConsumer* consumer, SrsRtmpJitterAlgorithm jitter);
|
||||||
|
public:
|
||||||
|
void set_has_audio(bool v);
|
||||||
|
void set_has_video(bool v);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Transmux RTMP with AAC stream to HTTP AAC Streaming.
|
// Transmux RTMP with AAC stream to HTTP AAC Streaming.
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 6
|
#define VERSION_MAJOR 6
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 8
|
#define VERSION_REVISION 9
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3176,6 +3176,7 @@ SrsTsTransmuxer::SrsTsTransmuxer()
|
||||||
tsmc = new SrsTsMessageCache();
|
tsmc = new SrsTsMessageCache();
|
||||||
context = new SrsTsContext();
|
context = new SrsTsContext();
|
||||||
tscw = NULL;
|
tscw = NULL;
|
||||||
|
has_audio_ = has_video_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsTsTransmuxer::~SrsTsTransmuxer()
|
SrsTsTransmuxer::~SrsTsTransmuxer()
|
||||||
|
@ -3186,6 +3187,16 @@ SrsTsTransmuxer::~SrsTsTransmuxer()
|
||||||
srs_freep(context);
|
srs_freep(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SrsTsTransmuxer::set_has_audio(bool v)
|
||||||
|
{
|
||||||
|
has_audio_ = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SrsTsTransmuxer::set_has_video(bool v)
|
||||||
|
{
|
||||||
|
has_video_ = v;
|
||||||
|
}
|
||||||
|
|
||||||
srs_error_t SrsTsTransmuxer::initialize(ISrsStreamWriter* fw)
|
srs_error_t SrsTsTransmuxer::initialize(ISrsStreamWriter* fw)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
@ -3198,9 +3209,11 @@ srs_error_t SrsTsTransmuxer::initialize(ISrsStreamWriter* fw)
|
||||||
|
|
||||||
writer = fw;
|
writer = fw;
|
||||||
|
|
||||||
|
SrsAudioCodecId acodec = has_audio_ ? SrsAudioCodecIdAAC : SrsAudioCodecIdForbidden;
|
||||||
|
SrsVideoCodecId vcodec = has_video_ ? SrsVideoCodecIdAVC : SrsVideoCodecIdForbidden;
|
||||||
|
|
||||||
srs_freep(tscw);
|
srs_freep(tscw);
|
||||||
// TODO: FIXME: Support config the codec.
|
tscw = new SrsTsContextWriter(fw, context, acodec, vcodec);
|
||||||
tscw = new SrsTsContextWriter(fw, context, SrsAudioCodecIdAAC, SrsVideoCodecIdAVC);
|
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1332,6 +1332,8 @@ class SrsTsTransmuxer
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
ISrsStreamWriter* writer;
|
ISrsStreamWriter* writer;
|
||||||
|
bool has_audio_;
|
||||||
|
bool has_video_;
|
||||||
private:
|
private:
|
||||||
SrsFormat* format;
|
SrsFormat* format;
|
||||||
SrsTsMessageCache* tsmc;
|
SrsTsMessageCache* tsmc;
|
||||||
|
@ -1340,6 +1342,9 @@ private:
|
||||||
public:
|
public:
|
||||||
SrsTsTransmuxer();
|
SrsTsTransmuxer();
|
||||||
virtual ~SrsTsTransmuxer();
|
virtual ~SrsTsTransmuxer();
|
||||||
|
public:
|
||||||
|
void set_has_audio(bool v);
|
||||||
|
void set_has_video(bool v);
|
||||||
public:
|
public:
|
||||||
// Initialize the underlayer file stream.
|
// Initialize the underlayer file stream.
|
||||||
// @param fw the writer to use for ts encoder, user must free it.
|
// @param fw the writer to use for ts encoder, user must free it.
|
||||||
|
|
Loading…
Reference in a new issue