andrey-kondratov / juancamera-proxy

A proxy server for streaming video from a Guangzhou Juan IP camera without its custom handshaking.
13 stars 4 forks source link

Help for audio #3

Closed wes1993 closed 3 weeks ago

wes1993 commented 3 years ago

Hello, thanks a lot for your server, there is a way to also capture the audio?

some useful info:

£©: (ø'´E&,@çÀ¨4À¨}íPº_<ë³ÝP¡GET /netsdk/audio/encode/channel/101 HTTP/1.1
Accept: application/json, text/javascript, */*
Authorization: Basic YWRtaW46
Content-Type: application/x-www-form-urlencoded
Connection: keep-alive
Host: 192.168.0.136
User-Agent: channel properties

(ø'´£©: Eq5M@@-À¨À¨4P}íë³Þº`:PÕÖ{"id":101,"enabled":true,"audioInputChannelID":1,"codecType":"G.711alaw"}
(ø'´£©: Eq5M@@-À¨À¨4P}íë³Þº`:PÕÖ{"id":101,"enabled":true,"audioInputChannelID":1,"codecType":"G.711alaw"}
(ø'´£©: Eºö5@@ÁûÀ¨À¨4P}ìîAUWIPãESession: 42
Cseq: 1
m=video 97 H265/90000/2304/1296
m=audio 8 G711/8000/2
Transport: RTP/AVP/TCP;unicast;hisiinterleaved=0-1;ssrc=0000002a

Again thanks Stefano

andrey-kondratov commented 3 years ago

It actually returns audio but you have to demux it from the stream. See my .NET Core implementation of this

https://github.com/andead/juancamera-proxy-netcore/blob/master/JuanIpCamera.ConsoleApp/Program.cs#L21-L22

Which is based on the same Gist https://gist.github.com/maxious/c8915a436b532ab09e61bf937295a5d2#file-stream-socket-py

Since my proxy app works with a single socket, and I am not an expert in audio/video streaming, I just left it as is. I would assume some multiplexing into a standard format would be required so that the proxy would act as a media stream server compatible with HTML5 etc. I also believe I tried to do it using ffplay configuration + what is now implemented in the app, but in the end I don't remember if that worked. 🤷🏻‍♂️

wes1993 commented 3 years ago

Thanks a lot for your reply!! I have found some other information on this, also substream mainstream etc, I have also found a way to change the audio from G711 to AAC, do you have telegram? I really want to create some wonderful proxy for this Chinese cam ;)

wes1993 commented 3 years ago

P.S. do you think that using AAC also need decode?

andrey-kondratov commented 3 weeks ago

I've stopped using this camera and will archive the project.