samtap / fang-hacks

Collection of modifications for the XiaoFang WiFi Camera
1.67k stars 340 forks source link

Add authentication to RTSP server #6

Open mh2370 opened 7 years ago

mh2370 commented 7 years ago

Can you add rstp authentication?

Thx

DavidRayner commented 7 years ago

You don't need to worry about the media/* directories on the camera, the camera will handle them itself.

Inside my 20-rtsp-server file I have:

_snx_rtsp_server -Q 10 -u media/stream1 -P 554 -A my_user:mypass -a >$LOG 2>&1 &

For use with VLC I open the following stream:

_rtsp://my_user:my_pass@myip:554/media/stream1

Are you able to access the camera from the same local network?

comeollas commented 7 years ago

Yes, i log in with same local network (i use one laptop conected at same wifi without firewalls or rules, and port 554 works because without modify the snxserver all work without pass) but in the moment i set the snx_rtsp_server line i can't connect to rtsp with vlc.

I go to see another time the 20-rstp.... file for see if i used caps or not in -P.

comeollas commented 7 years ago

Finally works, i erased -W1980 -H1080 (i don't remeber the exact but the image quality in this line i erased and works now!).

Tnx with your exact line of 20-rts... works fine.

gabryk91 commented 7 years ago

@DavidRayner thanks for the info, it works fine, but I have a problem with TinyCam. Before the mod I could connect and see the stream even on the WAN, now I can't. Do you know how to configure tinycam or similar program on an android device? I already tried vlc for android but it get stuck. Thank you

ardefy commented 7 years ago

Hi, I it very good !!! thanks for this info !! :)

I also have problems with tinycam, it works well but the flow stops after a while, works in WAN and LAN with dyndns and ports redirected in NAT in my box. I think I would have to lower the quality of the rtsp stream. Is this possible with your server?

Regards :)

gabryk91 commented 7 years ago

Ardefy can you share some screenshots of your tinycam configuration?

Il 14 set 2017 4:51 PM, "ardefy" notifications@github.com ha scritto:

Hi, I it very good !!! thanks for this info !! :)

I also have problems with tinycam, it works well but the flow stops after a while, works in WAN and LAN with dyndns and ports redirected in NAT in my box. I think I would have to lower the quality of the rtsp stream. Is this possible with your server?

Regards :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/samtap/fang-hacks/issues/6#issuecomment-329507037, or mute the thread https://github.com/notifications/unsubscribe-auth/AJcCVWIjwNcUe3agT6b_H5NUPUL360z7ks5siT1xgaJpZM4Lk-J3 .

ardefy commented 7 years ago

screenshot_20170914-165412

:)

ardefy commented 7 years ago

But the stream stop regularly :-(

DavidRayner commented 7 years ago

do you have a stable and strong upload speed from the network the camera is on?

ardefy commented 7 years ago

In local lan it s ok. Not in wan :(

gabryk91 commented 7 years ago

Ok, I tried and I have the same issue

Il 14 set 2017 5:17 PM, "ardefy" notifications@github.com ha scritto:

In local lan it s ok. Not in wan :(

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/samtap/fang-hacks/issues/6#issuecomment-329515064, or mute the thread https://github.com/notifications/unsubscribe-auth/AJcCVSqNVL7Q1AmR8caKf87HJs7HhNWeks5siUNpgaJpZM4Lk-J3 .

halfluck commented 7 years ago

Hey Guys,

I do not believe this is a FangHacks issue, I have this happen all the time with TinyCam and other streaming sources, It seems to only display when there is activity?

Cheers Rob.

willthrom commented 7 years ago

Hi,

After some digging a notice the authentication is supported by this issue hasn´t been closed.. any reason? or am I missing something? I thought the -U user:password database was for that purpose... or is it still not integrated for this Hack?

Another thing I notice is that when the v4l2rtspserver support this authentification method, live555 doesn't support encryption of the streaming. I will give try to include it using the cisco/libsrtp

By the way, do anyone know what Xiaomi client sends? Format? it might be easier to take that streaming and the controls to another server....

samtap commented 7 years ago

I'm not sure if encrypted rtsp streams / srtp are supported well by clients. Authentication is supported in my new rtsp server (not released yet).

By the way, for simple encryption you could use stunnel, which works quite well. The downside is you also need it on the client, but maybe apps like tinycam could support it and make it less of a hassle.

willthrom commented 7 years ago

@samtap is v4l2rtspserver project your as well? I got confused with the fork. or you mean the compilation of v4l2rtspserver for this hack? I am trying to do the same for the Mijia 1080p. https://github.com/Filipowicz251/mijia-1080P-hacks/issues/5

samtap commented 7 years ago

No it's not my project but I'm using both https://github.com/mpromonet/v4l2rtspserver and https://github.com/haoweilo/RTSP_stream_server for my new rtsp server.

willthrom commented 7 years ago

Can I ask what are you missing of those project to create a new one? just curious I might be interested to participate (if possible). Actually I saw yesterday RSTP_stream_server is from v4lsrspserver....

samtap commented 7 years ago

The drivers of XiaoFang don't allow sharing the hardware, so I want to add features like recording, snapshots, on a reasonably good code-base that already has rtsp features like auth. Tried to use pure v4l2rtspserver, abstracting all hardware access through v4l2wrapper, but gave up on that. So now I'm back to a more pragmatic approach (more hacking). I've created a new gitter chat to discuss fang-hacks and possible also other projects if they're open to collaborate. Feel free to join: https://gitter.im/fang-hacks/ (replaces the old discord chat)

willthrom commented 7 years ago

@samtap Thanks, I will join and see what I can do....