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

One listener Multi-caller #2864

Open
eurekao opened this issue Jan 30, 2024 · 7 comments
Open

One listener Multi-caller #2864

eurekao opened this issue Jan 30, 2024 · 7 comments
Labels
Type: Question Questions or things that require clarification

Comments

@eurekao
Copy link

eurekao commented Jan 30, 2024

set obs like srt://127.0.0.1:10080?mode=listener&timeout=5000000 to push stream
run 2 VLC read stream like srt://127.0.0.1:10080?mode=caller
just the first vlc can show the stream, the second connect error
what i can do?

@eurekao eurekao added the Type: Question Questions or things that require clarification label Jan 30, 2024
@ethouris
Copy link
Collaborator

SRT offers a solution of a listener, which works merely like the listen and accept function for TCP. But it's the application's choice how it makes use of it.

Many simply accept one connection and then don't accept anything at all until this one connection is broken. Others accept multiple connections, but then the application's code must be prepared to manage multiple receivers and distribute the stream throughout them. If OBS rejects the second connection then it likely doesn't do it. You should check this with OBS if it offers something like this. From the perspective of SRT there's no problem with having that (at least potentially).

@matiaspl
Copy link

FFmpeg's implementation of SRT listener is single connection. You need to play with obs-gstreamer to get multiple connections or use e.g. srt-live-transmit as a proxy.

@ethouris
Copy link
Collaborator

Actually not; srt-live-transmit in listener mode also accepts only a single connection. After a successful accept it closes the listener socket, then recreates it when the connection breaks.

@matiaspl
Copy link

my bad, I was under the impression that one of the console tools other than gstreamer did support that...

@eurekao
Copy link
Author

eurekao commented Jan 31, 2024

@matiaspl thx, i see libsrt.c in ffmpeg

    if (s->mode == SRT_MODE_LISTENER) {
        // multi-client
        ret = libsrt_listen(write_eid, fd, cur_ai->ai_addr, cur_ai->ai_addrlen, h, s->listen_timeout);
        srt_epoll_release(write_eid);
        if (ret < 0)
            goto fail1;
        srt_close(fd);
        fd = ret;
    } 

srt will close after accept one client, is there any ready to use solution for ffmpeg?

@maxsharabayko
Copy link
Collaborator

The srt-xtransmit app has a PR adding multiple client connections to the receive and generate subcommand. Those is used for testing. You probably need to add this feature to the route subcommand as well.
maxsharabayko/srt-xtransmit#37

@ethouris
Copy link
Collaborator

@eurekao I really think you should rather try to talk with OBS guys whether they would like to have something like that.

You can use srt-xtransmit to try out if this works, but note that this is a tool that we are using for testing, not something you can use in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Questions or things that require clarification
Projects
None yet
Development

No branches or pull requests

4 participants