Viewing direct from URL

Tips, tricks and frequently asked questions
dctaylor
Posts: 1
Joined: 26 May 2017, 19:27

Viewing direct from URL

Post by dctaylor »

Hi

I'm looking to set-up a live stream via a raspberry PI to a monitor but ideally would like to view the stream via a URL. Is there any way to do this? This was asked previously in the forum, but the links provided look to have changed since the post, rendering the advice futile.

Regards
gieljnssns
Posts: 41
Joined: 23 Nov 2016, 17:56

Re: Viewing direct from URL

Post by gieljnssns »

+1
1l2p
Posts: 204
Joined: 30 Nov 2012, 19:34

Re: Viewing direct from URL

Post by 1l2p »

Hello,

First you will have to go to NETATMO connect DEV portal and identify yourself : https://dev.netatmo.com/resources/techn ... ethomedata

Call this method "Gethomedata" directly in the zone called "Try this method by yourself with our TRY IT module". Your "access_token" should already be fulfilled, "home_id" and "size" are optional. Clic "Try it", then expand "Body", "homes", "object", "cameras", "object" (select the one you want if you have multiple devices).

Copy the "vpn_url" which should be like :

Code: Select all

https://v6.netatmo.net/restricted/10.255.201.22/xxxxxxxxxxxx/yyyyyyyyyyyy,,
(do not forget the ',,' at the end if you have some)

Then go to this page to learn how to compose live snapshots et stream urls : https://dev.netatmo.com/resources/techn ... meras/live

Live Snapshot will be like :

Code: Select all

https://v6.netatmo.net/restricted/10.255.201.22/xxxxxxxxxxxx/yyyyyyyyyyyy,,/live/snapshot_720.jpg
Live Stream will be like :

Code: Select all

https://v6.netatmo.net/restricted/10.255.201.22/xxxxxxxxxxxx/yyyyyyyyyyyy,,/live/index.m3u8
If you want to get permanent direct access to your cams in your local network, compose this URL :

Code: Select all

https://v6.netatmo.net/restricted/10.255.201.22/xxxxxxxxxxxx/yyyyyyyyyyyy,,/live/files/high/index_local.m3u8
And perform a curl or wget in a terminal to see the content of the m3u8 :

Code: Select all

"curl https://v6.netatmo.net/restricted/10.255.201.22/xxxxxxxxxxxx/yyyyyyyyyyyy,,/live/files/high/index_local.m3u8"
You should get something like that :

Code: Select all

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:117647
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:2
#EXTINF:2.000000,
http://your_cam_local_ip/zzzzzzzzzzzzz/live/files/high/live0000117648.ts
#EXTINF:2.000000,
http://your_cam_local_ip/zzzzzzzzzzzzz/live/files/high/live0000117649.ts
#EXTINF:2.000000,
http://your_cam_local_ip/zzzzzzzzzzzzz/live/files/high/live0000117650.ts
Copy the base url and compose the final static urls :
Live Snapshot :

Code: Select all

http://your_cam_local_ip/zzzzzzzzzzzzz/live/snapshot_720.jpg
Live Stream :

Code: Select all

http://your_cam_local_ip/zzzzzzzzzzzzz/live/files/high/index.m3u8
You can open the m3u8 url in VLC app, or if you need another format you can use ffmpeg to transcode it or send it to any RTSP server :

Code: Select all

ffmpeg -reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 120 -re -i http://your_cam_local_ip/zzzzzzzzzzzzz/live/files/high/index.m3u8 -vcodec copy -an -f rtsp -muxdelay 0.1 rtsp://rtsp_server_local_ip:5545/name_of_your_choice.sdp
This command line sample does not transcode the video (no need of CPU). It only removes the audio (-an) and keep the original video codec, size and bitrate (-vcodec copy) before sending it to the RTSP server. I use it to have my NETATMO cams displayed and 24/7 recorded in a Synology NAS with Surveillance Station.

I'm using this very simple RTSP server : https://github.com/revmischa/rtsp-server , but any other should be ok.

Then the url used for Surveillance Station is : rtsp://rtsp_server_local_ip/name_of_your_choice.sdp

Enjoy!
DAJ
Posts: 282
Joined: 28 Dec 2016, 21:47

Re: Viewing direct from URL

Post by DAJ »

This is great information. Can I also run the rtsp server on a Synology NAS or do I need to invest in another piece of hardware just for the RTSP Server (such as Raspberry PI). Are you using the Synology Network Video Recorder NVR216 or another model?
1l2p
Posts: 204
Joined: 30 Nov 2012, 19:34

Re: Viewing direct from URL

Post by 1l2p »

Hello,

To "transcode", all you need is ffmpeg installed. So it can be done on many systems and a Synology should be OK. The used RTSP server is PERL based so it's also widely supported. On a Synology, you can use a Docker instance of any Linux distribution. Then you won't have to modify or complete the original packages of the Synology system. You'll be free to do and break anything you want. ;-)

I had a useless Raspberry Pi, so I took it to perform theses jobs. I added a "poor" crontab process monitoring to keep the ffmpeg task relaunched in case of disconnection or problem.

In crontab :

Code: Select all

# ffmpeg check for Netatmo Presence
*/1 * * * *	/home/monitoring/check-ffmpeg-presence-01.sh
Very basic script "check-ffmpeg-presence-01.sh" - It only checks if the ffmpeg process is running with your Presence local IP (here 172.16.2.234). The last state is written in a static file (up or down) :

Code: Select all

#!/bin/sh
if [ "$(ps aux | grep "[1]72.16.2.234")" ]
then
        if [ -n "$(cat /home/monitoring/ffmpeg-presence-01.state | grep "down")" ]
        then
        # curl "my sms server url" >/dev/null 2>&1
        echo "ffmpeg-presence-01 up again - SMS alert !"
        fi
echo "up" > /home/monitoring/ffmpeg-presence-01.state
else
        if [ -n "$(cat /home/monitoring/ffmpeg-presence-01.state | grep "up")" ]
        then
        # curl "my sms server url" >/dev/null 2>&1
        echo "ffmpeg-presence-01 down - Restarting... - SMS alert !"
        fi
echo "down" > /home/monitoring/ffmpeg-presence-01.state
ffmpeg -reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 120 -re -i http://172.16.2.234/your-static-local-live-token/live/files/high/index.m3u8 -vcodec copy -an -f rtsp -muxdelay 0.1 rtsp://rtsp_server_local_ip:5545/presence-01.sdp & >/dev/null 2>&1
fi
I'm using Surveillance Station 7.1-4155 on a Synology DS1815+ NAS, running DSM 5.2-5967 Update 2 (not yet upgraded to 6.1, I should think about it ;-) ).
ChrisF999
Posts: 16
Joined: 11 May 2017, 23:00

Re: Viewing direct from URL

Post by ChrisF999 »

Hi,

There something about the new improved video quality in Firmware 101 that's causing this problems, video quality of the output rtsp stream seems to degrade and pixelate over time. Any ideas on what to tweak on the ffmpeg command line to compensate?

Was working great on previous firmwares, even used the footage capture a clip of a strange standing next to my wife's car at 3am that the Netatmo motion detection had missed !!

Thanks
Chris
giuseppedlg
Posts: 1
Joined: 16 Jul 2017, 09:30

Re: Viewing direct from URL

Post by giuseppedlg »

buongiorno. qualcuno mi puo dire se la nettamo welcome si puo controllare anche da pc con win7? grazie..... e come????
jofre_netatmo
Posts: 828
Joined: 18 Jun 2014, 15:09

Re: Viewing direct from URL

Post by jofre_netatmo »

Ciao giuseppedlg,
La preghiamo di scrivere in inglese su questo forum, così possono partecipare tutti :)
Le videocamere Netatmo possono essere controllate da PC, bisogna rendersi su https://my.netatmo.com.
Grazie,

----

Hi giuseppedlg,
Please use English when writing in this forum so everyone can participate :)
Netatmo cameras can be controlled from a PC, you just need to go to https://my.netatmo.com.
Thanks,
Jofre - Netatmo Team
Stefan83
Posts: 20
Joined: 12 Aug 2018, 07:30

Re: Viewing direct from URL

Post by Stefan83 »

Live Stream :
CODE: SELECT ALL

http://your_cam_local_ip/zzzzzzzzzzzzz/live/files/high/index.m3u8
You can open the m3u8 url in VLC app,
I'm starting the Live Stream in VLC:
  • "Stream" --> "Open Network Stream"
  • paste the URL with correct IP
  • Hit Play
The Live-Stream starts and shows three short video-clips (approx. 1-2 sec).
After that the streaming stops and can't be resumed.

Is there a miss configuration in VLC?

Thanks,
Stefan
Stefan83
Posts: 20
Joined: 12 Aug 2018, 07:30

Re: Viewing direct from URL

Post by Stefan83 »

no ideas? :?
Post Reply

Return to “General questions”