HTTP-TS: Support guess_has_av for audio only stream. v6.0.141 #4063
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe
http_remux feature support config
has_audio
,has_video
&guess_has_av
prop.srs/trunk/src/app/srs_app_http_stream.cpp
Lines 630 to 632 in 282d94d
Take
http_flv
as example,srs
can accept both RTMP streams with only audio, only video or both audio and video streams. It is controlled by above three properties.But
guess_has_av
is not implemented byhttp_ts
. The problem is that if I want publish a RTMP stream with audio or video track, thehas_audio
andhas_video
, which are default true/on, must to be config to match the RTMP stream, otherwise thempegts.js
player can't play thehttp-ts
stream.How to reproduce
export SRS_VHOST_HTTP_REMUX_HAS_AUDIO=on; export SRS_VHOST_HTTP_REMUX_HAS_VIDEO=on; export SRS_VHOST_HTTP_REMUX_GUESS_HAS_AV=on; ./objs/srs -c conf/http.ts.live.conf
ffmpeg -re -stream_loop -1 -i srs/trunk/doc/source.200kbps.768x320.flv -vn -acodec copy -f flv rtmp://localhost/live/livestream
http://localhost:8080/players/srs_player.html?schema=http
, go toLivePlayer
, input URL:http://localhost:8080/live/livestream.ts
, click play.http://localhost:8080/live/livestream.ts
can not play.Solution
Let
http-ts
supportguess_has_av
,http-flv
already supported. Theguess_has_av
default value is ture/on, so thehttp-ts|flv
can play any streams with audio, video or both.