Reading streams from socket

Jul 24, 2014 at 2:03 AM
Hey. So I'm trying to basically do what the guy in this discussion is trying to do https://net7mma.codeplex.com/discussions/548533 .

I would like to be able to consume a streamed rtmp stream.

I figured I'd just spin up a socket, and then once the connection is made pass it off to your library to parse the data and handle it that way, and I think that it's possible, but I probably don't understand it well enough to fully pull it off.

Currently I get a few packets back but then it blows up saying it was writing protected memory. I'm trying to connect from OBS(like the other guy https://obsproject.com/).

I've included a gist of how far I've gotten. If you could take a look and give me some pointers maybe, that'd be great.
Coordinator
Jul 24, 2014 at 7:44 AM
Edited Jul 25, 2014 at 1:19 PM
Rtmp is not really supported yet...

I will see about supporting a basic RtmpClient for the purposes of sourcing only.

There are already several other libraries which can read the Rtmp stream though, it would then be trival to setup a new Source stream and then convert the Rtmp to Rtp, this may even work as is depending on the Rtmp format used,e.g. if the extended header (12 bytes) is used.

If you need anything else let me know!
Jul 26, 2014 at 8:46 PM
Sorry, maybe it was a typo. I'm trying to do the exact same thing as the guy from the link I posted(the same software to stream etc). Maybe that isn't rtmp, I'm not sure, there are too many acronyms and I don't know what they all mean.
Coordinator
Jul 26, 2014 at 8:49 PM
Well you should probably know the difference, they are two different protocols trying to achieve similar things.

RTMP is not directly compatible with RTP, as stated if the header size is sufficient it sometimes works, otherwise needs to be translated.

The software you linked to clearly says RTMP, I will see about adding a support for RTMP sources as I stated but you also have the option of reading from a file according to the page for the software.


Let me know if you need anything else!
Jul 26, 2014 at 8:53 PM
Thanks for the info. I guess I'm not sure what you mean by "reading from a file". I'm trying to implement using software like OBS to stream content being recorded to a server where I'd just store it to disk basically. The part I don't have is the server for reading the stream from the OBS software.
Coordinator
Jul 26, 2014 at 8:56 PM
You need to find a way to integrate the Stream from the OBS to the RtspServer.

You can either implement a RtmpSourceStream to translate to Rtp or you can use the Save to file feature of the OBS and then read the file and packetize the samples per the codec and rtp profile required .

There is not support for file reading in this library yet however there is an example in one of the threads here not to mention various other libraries which can read MP4 Boxes.

Hopefully that clarified things!
Coordinator
Jul 27, 2014 at 2:19 PM
This library should help interfacing with Rtmp / asf data.

https://github.com/astralfoxy/rtmp-sharp/tree/master/rtmp-sharp/
Coordinator
Sep 17, 2014 at 1:58 PM
I am marking this as the answer for now, keep an eye out after File Base Support is finished for Rtmp support! There should eventually be a RtmpSourceStream which can consume a RtmpStream and then it will create a SDP and translate each RtmpPacket to a suitable RtpPacket for the profile.

If you need anything else let me know!
Marked as answer by juliusfriedman on 9/17/2014 at 6:58 AM