ngraziano / SharpRTSP

A RTSP handling library
Other
557 stars 182 forks source link

webapi2 PushContentStream #45

Closed thanhvyit closed 6 years ago

thanhvyit commented 6 years ago

I am finding a solution to live stream video from RTP/RSTP. How can we combine this with PushContentStream? So in Received_SPS_PPS, Received_NALs, ... instead of store binary to files, just convert to streamable binary and write it to http response?

RogerHardiman commented 6 years ago

You've already found that you would change the RTSPClientExample code and handle the events Received_SPS_PPS and Received_NAL. So in those you could write the bytes to the PushContentStream.

Whatever is receiving the 'stream' needs to be able to identify the SPS, the PPS and the NAL. There are two standards for this, one is to put 0x00 0x00 0x00 0x01 before each NAL and then search for those at the receiver/player end. The other is to send a 4 byte 'length' value followed by the data. For example 0x00 0x00 0x00 0xFF followed by 255 bytes of data. 0x00 0x00 0x00 0x05 followed by 5 bytes of data.

Do you know what format your web application is looking for?

RogerHardiman commented 6 years ago

I've not had any reply to my question for 2 months so closing this question down. Please raise a new Issue if you have some more information. Thanks, Roger