Skip to content

SRT: Support configurable default_streamid option. v6.0.180#4515

Merged
winlinvip merged 1 commit intoossrs:6.0releasefrom
winlinvip:srs6/srt-vlc
Oct 2, 2025
Merged

SRT: Support configurable default_streamid option. v6.0.180#4515
winlinvip merged 1 commit intoossrs:6.0releasefrom
winlinvip:srs6/srt-vlc

Conversation

@winlinvip
Copy link
Copy Markdown
Member

@winlinvip winlinvip commented Oct 2, 2025

Add a new default_streamid configuration option for the SRT server to allow customization of the default streamid used when SRT clients connect without setting the SRTO_STREAMID socket option.

When SRT clients (like VLC) connect without properly setting the SRTO_STREAMID socket option, SRS previously used a hardcoded default value of "#!::r=live/livestream,m=publish". This caused conflicts when:

  1. A publisher connects without setting streamid (uses default publish mode)
  2. A player tries to connect without setting streamid (also uses default publish mode)
  3. The player gets a "Stream already exists or busy" error because both are trying to publish

Start SRS with default stream id as viewer:

./objs/srs -c conf/srt.vlc.conf

Publish SRT stream by FFmpeg:

ffmpeg -re -i ./doc/source.flv -c copy -pes_payload_size 0 -f mpegts \
  'srt://127.0.0.1:10080?streamid=#!::r=live/livestream,m=publish'

Play SRT stream by ffplay:

ffplay 'srt://127.0.0.1:10080?streamid=#!::r=live/livestream,m=request'

Play SRT stream by VLC:

✅ Correct - Use simple URL without streamid parameter:
srt://127.0.0.1:10080

❌ Wrong - VLC doesn't support streamid parameter:
srt://127.0.0.1:10080?streamid=#!::r=live/livestream,m=request

@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Oct 2, 2025
@winlinvip winlinvip changed the base branch from develop to 6.0release October 2, 2025 01:11
@winlinvip winlinvip changed the title SRT: Support configurable default_streamid option SRT: Support configurable default_streamid option. v6.0.180 Oct 2, 2025
@winlinvip winlinvip merged commit ac86885 into ossrs:6.0release Oct 2, 2025
winlinvip added a commit that referenced this pull request Oct 4, 2025
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.

Development

Successfully merging this pull request may close these issues.

1 participant