Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP-TS: Support guess_has_av for audio only stream. v6.0.141 #4063

Merged

Conversation

suzp1984
Copy link
Contributor

@suzp1984 suzp1984 commented May 21, 2024

Describe

http_remux feature support config has_audio, has_video & guess_has_av prop.

bool has_audio = _srs_config->get_vhost_http_remux_has_audio(req->vhost);
bool has_video = _srs_config->get_vhost_http_remux_has_video(req->vhost);
bool guess_has_av = _srs_config->get_vhost_http_remux_guess_has_av(req->vhost);

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 by http_ts. The problem is that if I want publish a RTMP stream with audio or video track, the has_audio and has_video, which are default true/on, must to be config to match the RTMP stream, otherwise the mpegts.js player can't play the http-ts stream.

How to reproduce

  1. 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
  2. publish rtmp stream without video: ffmpeg -re -stream_loop -1 -i srs/trunk/doc/source.200kbps.768x320.flv -vn -acodec copy -f flv rtmp://localhost/live/livestream
  3. open chrome browser, open http://localhost:8080/players/srs_player.html?schema=http, go to LivePlayer, input URL: http://localhost:8080/live/livestream.ts, click play.
  4. the http://localhost:8080/live/livestream.ts can not play.

Solution

Let http-ts support guess_has_av, http-flv already supported. The guess_has_av default value is ture/on, so the http-ts|flv can play any streams with audio, video or both.

@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label May 21, 2024
@suzp1984 suzp1984 marked this pull request as ready for review May 21, 2024 14:50
@winlinvip winlinvip changed the title let http-remux ts stream support guess_has_av feature; let http-remux ts stream support guess_has_av feature;. v6.0.141 Jul 24, 2024
@winlinvip winlinvip added the RefinedByAI Refined by AI/GPT. label Jul 24, 2024
@winlinvip winlinvip changed the title let http-remux ts stream support guess_has_av feature;. v6.0.141 HTTP-TS: Support guess_has_av for audio only stream. v6.0.141 Jul 24, 2024
@winlinvip winlinvip merged commit eb788a6 into ossrs:develop Jul 24, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EnglishNative This issue is conveyed exclusively in English. RefinedByAI Refined by AI/GPT.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants