These are chat archives for P2PSP/MediaSources-server

11th
Apr 2017
JP
@jpgarciaortiz
Apr 11 2017 15:07
One more thing though, how do you plan to send HTTP POST request?
I had thought to use POST requests with chunked encoding
Do you mean by linking it is automatically passing source address and port to splitter process? Or do you mean MediaServer will consume the Video Stream itself first, eg buffering up to some length and then give it to the splitter process, which IMO is unnecessary level of indirection :confused:. Or is it entirely other thing that I'm missing out?
yeah, it's an additional level of indirection, but it's the easiest way that the media server can control the stream. There is another more complex, and efficient way: to be able to pass the socket to the splitter. This can be done in Unix machines, but I'm not sure if this might be achieved with node.js...
JP
@jpgarciaortiz
Apr 11 2017 15:13
Well there are ways to detect if a video broke down/source is unresponsive and not sending data, via 1. polling - which means simply checking video source for streaming data, if it is sending anything at all! Eg. the video source might be transmitting udp/tcp/ or through some different protocol and we can keep checking in a time interval, very small amount of data and then discarding packets since we don't need them. After a certain timeout, if the source still isn't sending anything, we can assume it's broken down! 2. Watching for splitter process to write something on stdin/stderr pipes, we can offload this task to splitter processes we've launched for that particular video source, and when they write something preferably on stderr, our MediaServer could easily catch it and detect that the video has broke down.. This seems more apt to me since stderr is also attached to terminal so in case no MediaServer is present, it still displays the error code, but both are viable ways to detect it.
well... I like idea 2! it's a good idea actually!
Abhinav Gauniyal
@agauniyal
Apr 11 2017 15:25

I had thought to use POST requests with chunked encoding

what I meant was, which program would be the potential client to use this API? Is there already such a client ready/or work in progress?

but it's the easiest way that the media server can control the stream.

Could you tell me what would we do by controlling the stream? I mean what would be the difference if we directly set source address on the splitter process without taking any packets inside Mediaserver?

There is another more complex, and efficient way: to be able to pass the socket to the splitter.

By passing the socket, you mean passing the socket's integer value right? Because socket in UNIX sense is just an integer returned by underlying socket() call. If yes, I'll see if there's a way to get that value within from nodejs, though it seems there won't be any.

I was basing my assumptions on -

Well, I'm not the creator of this idea, but, what I would implement is: (1) a source contact the media-server, (2) the media server creates a splitter in a "friendly URL", (3) the media-server send this URL to the source, (4) the source sends the stream to the splitter.

Abhinav Gauniyal
@agauniyal
Apr 11 2017 15:31
I'm not getting the idea behind getting source packets inside Mediaserver (not saying it's not possible, it is) but how would it help?
JP
@jpgarciaortiz
Apr 11 2017 15:41
what I meant was, which program would be the potential client to use this API? Is there already such a client ready/or work in progress?
if I remember well, there was an iOS video source quite advanced that already sent POST requests to send the video stream
By passing the socket, you mean passing the socket's integer value right? Because socket in UNIX sense is just an integer returned by underlying socket() call. If yes, I'll see if there's a way to get that value within from nodejs, though it seems there won't be any.
not, that's not the idea; a process can send a copy of a socket (not just the integer value) to another process
but nevermind, as I said, I like your idea, so we can keep the media server as an intermediate, but checking that the video source is alive
Abhinav Gauniyal
@agauniyal
Apr 11 2017 16:17

not, that's not the idea; a process can send a copy of a socket (not just the integer value) to another process

Oh, you meant SCM_RIGHTS way! I'll see if node provides it but again this is even more unlikely.