BogdanovKirill / RtspClientSharp

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

SimpleRtspPlayer has no sound, what is the reason? #35

Open Doyle-net opened 5 years ago

Doyle-net commented 5 years ago

I pull the source demo code, and there is no sound when playing RTSP stream after compiling. But playing RTSP streams with VLC is correct

BogdanovKirill commented 5 years ago

Hi, sound player is not implemented

Doyle-net commented 5 years ago

Hi, sound player is not implemented

Hi,BogdanovKirill But I did not receive the audio stream when debugging the source code. ` private void OnFrameReceived(object sender, RawFrame rawFrame) { if (!(rawFrame is RawAudioFrame rawAudioFrame)) return;

        FFmpegAudioDecoder decoder = GetDecoderForFrame(rawAudioFrame);
        if (!decoder.TryDecode(rawAudioFrame))
            return;

        IDecodedAudioFrame decodedFrame = decoder.GetDecodedFrame(new AudioConversionParameters() {OutBitsPerSample = 16});
        FrameReceived?.Invoke(this, decodedFrame);
    }`
BogdanovKirill commented 5 years ago

@Doyle-net Please debug sources by yourself or give me access to your RTSP server

Doyle-net commented 5 years ago

Hi,BogdanovKirill I tested this address source (rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov) and it has audio. But I did not receive the audio stream by setting up the RTSP stream with VLC, but it is normal for me to play with VLC. image

In "ConnectAsync" "parser.Parse(describeResponse.ResponseBody)" was not received, parsed into audio image

ResponseBody: v=0 o=- 16196963941712269368 16196963941712269368 IN IP4 DESKTOP-CUMSTFP s=Unnamed i=N/A c=IN IP4 0.0.0.0 t=0 0 a=tool:vlc 3.0.7.1 a=recvonly a=type:broadcast a=charset:UTF-8 a=control:rtsp://127.0.0.1:8554/vlc m=audio 0 RTP/AVP 96 b=RR:0 a=rtpmap:96 mpeg4-generic/44100/2 a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1210; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1; a=control:rtsp://127.0.0.1:8554/vlc/trackID=0 m=video 0 RTP/AVP 96 b=AS:1947 b=RR:0 a=rtpmap:96 H264/90000 a=fmtp:96 packetization-mode=1;profile-level-id=64001f;sprop-parameter-sets=Z2QAH6wkiAUAW7ARAAADAAEAAAMAMI8YMqA=,aO4yyLA=; a=control:rtsp://127.0.0.1:8554/vlc/trackID=1

I found the reason, the audio is lost when parsing in "SdpParser" Lead to problems m=audio 0 RTP/AVP 96 m=video 0 RTP/AVP 96 “96” repeat image How can I solve it?

BogdanovKirill commented 5 years ago

@Doyle-net Thank you for report. Need to fix it.

Dimigergo commented 5 years ago

Hello! I have the same issue. Is there any information when it can be fixed?

Thanks!

BogdanovKirill commented 5 years ago

May be later, I don't have free time for now

t3therdev commented 3 years ago

Hi, were you able to fix the audio issue as of yet?