Skip to content

RTC2RTMP: No sound in the audio for the first six seconds #4076

Open
@xuxiaoshuo

Description

Describe the bug
When the rtc_to_rtmp feature is enabled, we push the stream via WebRTC and pull the stream via RTMP, but there is no sound in the audio for the first six seconds

Version
srs5.0

To Reproduce
Steps to reproduce the behavior:
1.From a computer, initiate a WebRTC stream.
2.On a mobile device, pull the stream via RTMP.
3.The video appears first, followed by the audio, which starts playing after a six-second delay.

Expected behavior
The video and audio should start simultaneously

Screenshots
None

Additional context
Add any other context about the problem here.

listen              1935;
max_connections     1000;
daemon              off;
srs_log_tank        console;

http_server {
    enabled         on;
    listen          8686;
    dir             ./objs/nginx/html;
}

http_api {
    enabled         on;
    listen          1985;
    auth {
        enabled on;
        username wp;
        password wp;
    }
}
stats {
    network         0;
}
rtc_server {
    enabled on;
    listen 8000; # UDP port
    # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate
    candidate $CANDIDATE;
}
vhost __defaultVhost__ {
    rtc {
        enabled     off;
        # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtmp-to-rtc
        rtmp_to_rtc off;
        # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp
        rtc_to_rtmp off;
    }
}

vhost 192.168.10.13 {
    #dvr {
    #    enabled             on;
    #    dvr_path            ./objs/nginx/html/dvr/[app]/[stream]/[2006]/[01]/[02]/[15].[04].[05].[999].mp4;
    #    dvr_plan            session;
    #    dvr_wait_keyframe   on;
    #}
    rtc {
        enabled     on;
        # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtmp-to-rtc
        rtmp_to_rtc on;
        # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp
        rtc_to_rtmp on;

        pli_for_rtmp 0.5;
    }
    http_hooks {
        enabled         on;
        on_publish      http://172.24.144.1:8181/callback/srs/serve;
        on_unpublish    http://172.24.144.1:8181/callback/srs/serve;
        on_play         http://172.24.144.1:8181/callback/srs/serve;
        on_stop         http://172.24.144.1:8181/callback/srs/serve;
    }
}

Metadata

Assignees

Labels

EnglishNativeThis issue is conveyed exclusively in English.WebRTCWebRTC, RTC2RTMP or RTMP2RTC.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions