ossrs / srs

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
25.32k stars 5.33k forks source link

WebRTC: Long time for the first picture when RTC2RTMP. Push RTC and pull RTMP, VLC takes a long time for the first screen, around 2 minutes. #3099

Open bbhxwl opened 2 years ago

bbhxwl commented 2 years ago

Please describe your issue here. I am running Docker with WebRTC push and VLC pull. It takes a long time to load, possibly up to 2 minutes, before it appears. Is this normal?

  1. SRS Version: 4.0.252
  1. SRS Log: Please provide the SRS log for further analysis.
xxxxxxxxxxxx
  1. SRS Config: Please ensure that the markdown structure is maintained for the SRS configuration.
# docker config for srs.
# @see full.conf for detail config.

listen              1935;
max_connections     1000;
# For docker, please use docker logs to manage the logs of SRS.
# See https://docs.docker.com/config/containers/logging/
srs_log_tank        console;
daemon              off;
http_api {
    enabled         on;
    listen          1985;
}
http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}
rtc_server {
    enabled on;
    listen 8000;
    # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#config-candidate
    candidate $CANDIDATE;
}
vhost __defaultVhost__ {
    hls {
        enabled         on;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
 http_hooks { 
        enabled          on;
        on_connect       http://***:5000/api/StreamingApi/on_connect;
        #on_close       http://***:5000/api/StreamingApi/on_close;
        on_publish       http://***:5000/api/StreamingApi/on_publish;
        #on_unpublish     http://***:5000/api/StreamingApi/on_unpublish;
        #on_play          http://***:5000/api/StreamingApi/on_play;        
       #on_stop          http://***:5000/api/StreamingApi/on_stop;                                 
           }
    rtc {
        enabled     on;
        # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtmp-to-rtc
        rtmp_to_rtc on;
        # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtc-to-rtmp
        rtc_to_rtmp on;
    }
}

Replay (重现): Please make sure to maintain the markdown structure.

> Please describe how to replay the bug? (重现Bug的步骤)

Please make sure to maintain the markdown structure.

  1. xxxxxx
  2. xxxxxx
  3. xxxxxx

Expect (期望行为)

Please make sure to maintain the markdown structure.

Please describe your expectation (描述你期望发生的事情) Make sure to maintain the markdown structure.

TRANS_BY_GPT3

winlinvip commented 2 years ago

WebRTC was not originally designed for live streaming, so there will be many issues if you use WebRTC for live streaming or convert it into a live streaming protocol.

However, there should be room for optimization.

TRANS_BY_GPT3