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

WebRTC: Support publish with pure video or audio stream. How to only publish video or only publish audio. #2513

Closed
shinoi2 opened this issue Aug 6, 2021 · 6 comments
Assignees
Labels
good first issue Easy to fix issues, good for newcomers TransByAI Translated by AI/GPT. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.
Milestone

Comments

@shinoi2
Copy link

shinoi2 commented Aug 6, 2021

Description'

Please ensure that the markdown structure is maintained.

Description of the issue encountered:
I hope to be able to push only video or only audio when using Webrtc for streaming.
SRS version: v4.0.95
SRS configuration (Config): rtc2rtmp.conf

Reproduction:

Steps to reproduce the bug:
For example, if I only have a microphone and no camera, I can choose to only transmit audio. Here is an example of only transmitting audio:

  1. Comment out the camera-related code in srs.sdk.js.
  2. Start SRS.
    self.constraints = {
        audio: true,
        // video: {
        //     width: {ideal: 320, max: 576}
        // }
    };
    // self.pc.addTransceiver("video", {direction: "sendonly"});
    // self.pc.addTransceiver("video", {direction: "recvonly"});

2. At this point, WebRTC can transmit only audio and play pure audio. However, the RTMP stream cannot be played, and the third-party WebRTC (jswebrtc) cannot play it either.

3. If audio is commented out and only video is transmitted, WebRTC can transmit only video and play pure video. However, the RTMP stream has a large playback delay (about 6 seconds), the third-party WebRTC (jswebrtc) cannot play it, and it causes the SRS service to crash.

Expected Behavior (Expect)

Can push only video or only audio normally, and can play normally.

TRANS_BY_GPT3

@shinoi2
Copy link
Author

shinoi2 commented Aug 12, 2021

The reason for the error is that when webrtc only pushes audio, encoding fails when encountering NACK. It should be that NACK is not handled properly.

TRANS_BY_GPT3

@winlinvip winlinvip changed the title Webrtc 推流,如何只推视频或者只推音频 WebRTC: 推流,如何只推视频或者只推音频 Aug 18, 2021
@winlinvip winlinvip added this to the SRS 5.0 release milestone Aug 25, 2021
@winlinvip winlinvip added the WebRTC WebRTC, RTC2RTMP or RTMP2RTC. label Jan 17, 2022
@gyf19
Copy link

gyf19 commented Mar 19, 2022

I also want to know if the app's Flutter version has this bug. Thank you.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Mar 19, 2022

Welcome Patch.

TRANS_BY_GPT3

@winlinvip winlinvip added the good first issue Easy to fix issues, good for newcomers label Mar 19, 2022
@strangemk2
Copy link

strangemk2 commented Oct 11, 2022

Can you only push audio to HLS? It seems like there is no logic for segmenting and generating AAC in the code.

TRANS_BY_GPT3

@SuperChrisliu
Copy link

SuperChrisliu commented Oct 25, 2022

Has this problem been resolved now? Test it out. Webrtc only pushes audio, rtmp pulling is possible, but it takes about 7 seconds for rtmp to receive data.

TRANS_BY_GPT3

@winlinvip winlinvip changed the title WebRTC: 推流,如何只推视频或者只推音频 WebRTC: Support publish with pure video or audio stream. 推流,如何只推视频或者只推音频 Jan 2, 2023
@winlinvip winlinvip modified the milestones: 5.0, 6.0 Jan 2, 2023
@winlinvip winlinvip changed the title WebRTC: Support publish with pure video or audio stream. 推流,如何只推视频或者只推音频 WebRTC: Support publish with pure video or audio stream. How to only publish video or only publish audio. Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
@winlinvip
Copy link
Member

Already fixed by #3964. To use this feature, should upgrade to latest SRS player, allowing user to select audio or video only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Easy to fix issues, good for newcomers TransByAI Translated by AI/GPT. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.
Projects
None yet
Development

No branches or pull requests

7 participants