BogdanovKirill / RtspClientSharp

Pure C# RTSP client for .NET Standard without external dependencies and with true async nature. I welcome contributions.
MIT License
713 stars 286 forks source link

Socket.IOControl handles Windows-specific control codes and is not supported on this platform #117

Open amir734jj opened 2 years ago

amir734jj commented 2 years ago

Describe the bug Having trouble running it on .net core 3.1 in linux

To Reproduce Steps to reproduce the behavior:

CancellationToken token = new CancellationToken();
var serverUri = new Uri("rtsp://192.168.0.107:53211/live.sdp");
var connectionParameters = new ConnectionParameters(serverUri)
{
    RtpTransport = RtpTransportProtocol.UDP
};
using var rtspClient = new RtspClient(connectionParameters);
rtspClient.FrameReceived += (sender, frame) =>
{
    //process (e.g. decode/save to file) encoded frame here or 
    //make deep copy to use it later because frame buffer (see FrameSegment property) will be reused by client
    switch (frame)
    {
        case RawH264IFrame h264IFrame:
        case RawH264PFrame h264PFrame:
        case RawJpegFrame jpegFrame:
        case RawAACFrame aacFrame:
        case RawG711AFrame g711AFrame:
        case RawG711UFrame g711UFrame:
        case RawPCMFrame pcmFrame:
        case RawG726Frame g726Frame:
            break;
    }
};

await rtspClient.ConnectAsync(token);
await rtspClient.ReceiveAsync(token);

Expected behavior Should work on Linux, as it is advertised as cross-platform without any external dependency

Screenshots image

Desktop: Linux