Reusing a udp socket/port for multiple differant pipelines, Advice needed

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Reusing a udp socket/port for multiple differant pipelines, Advice needed

debruyn
Good day guys,

So what i am attempting is the following. On the host side(An ARM board) i send a video stream through a udpsink to a specific port. on the clientside (PC/server), once a data is being received from the host it starts a recording of the stream. Then on request the user on the clientside can also choose to view the stream via live transcoding and the posting it to an icecast media server. This works a hundred percent if only a stream OR recording is happening.

But the problem arises when i want to do the viewing and recording simultaneously but in seperate pipelines and threads.
When i start the second streaming/recording pipe after a recording/streaming pipe is already live for that port the second pipe 'hijacks' the first pipes stream feed. It is as if the udp socket is handed over from the one to another. But i want both to listen on that socket.

I have a theory that once a socket(or even the port) is live(playing state) it can't be reused in another pipe. And advice on how to overcome this? Any help would be appreciated

Regards
De Bruyn
Reply | Threaded
Open this post in threaded view
|

Re: Reusing a udp socket/port for multiple differant pipelines, Advice needed

Sebastian Dröge-3
On Fri, 2016-09-30 at 02:43 -0700, debruyn wrote:
>
> I have a theory that once a socket(or even the port) is live(playing state)
> it can't be reused in another pipe. And advice on how to overcome this? Any
> help would be appreciated

That's correct. While you can (with UDP) listen on the same port twice,
it's not a good design and is AFAIK not guaranteed to give you all
packets on both sockets.

You will either have to do it in a single process with a single socket
and do everything there, or have one process that collects everything
from UDP and makes it available to the other processes via some other
IPC means.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (949 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Reusing a udp socket/port for multiple differant pipelines, Advice needed

debruyn
Thanks sebastian, i thought i might need to do something like that and currently considering dynamically linking and unlinking the two pipes from something like a queue element. thanks for the advice man

regards
De Bruyn