Giter Club home page Giter Club logo

reolinkcameraapi.github.io's Introduction

Reolink Python Api Client

Reolink Approval GitHub GitHub tag (latest SemVer) PyPI Discord


A Reolink Camera client written in Python. This repository's purpose (with Reolink's full support) is to deliver a complete API for the Reolink Cameras, although they have a basic API document - it does not satisfy the need for extensive camera communication.

Check out our documentation for more information on how to use the software at https://reolink.oleaintueri.com

Other Supported Languages:

Join us on Discord

https://discord.gg/8z3fdAmZJP

Sponsorship

Oleaintueri is sponsoring the development and maintenance of these projects within their organisation.


Get started

Implement a "Camera" object by passing it an IP address, Username and Password. By instantiating the object, it will try retrieve a login token from the Reolink Camera. This token is necessary to interact with the Camera using other commands.

See the examples directory.

Using the library as a Python Module

Install the package via PyPi

pip install reolinkapi

Install from GitHub

pip install git+https://github.com/ReolinkCameraAPI/reolinkapipy.git

If you want to include the video streaming functionality you need to include the streaming "extra" dependencies

pip install 'reolinkapi[streaming]'

Contributors


Styling and Standards

This project intends to stick with PEP8

How can I become a contributor?

Step 1

Get the Restful API calls by looking through the HTTP Requests made in the camera's web UI. I use Google Chrome developer mode (ctr + shift + i) -> Network.

Step 2

  • Fork the repository
  • pip install -r requirements.txt
  • Make your changes

Step 3

Make a pull request.

API Requests Implementation Plan:

Stream:

  • Blocking RTSP stream
  • Non-Blocking RTSP stream

GET:

  • Login
  • Logout
  • Display -> OSD
  • Recording -> Encode (Clear and Fluent Stream)
  • Recording -> Advance (Scheduling)
  • Network -> General
  • Network -> Advanced
  • Network -> DDNS
  • Network -> NTP
  • Network -> E-mail
  • Network -> FTP
  • Network -> Push
  • Network -> WIFI
  • Alarm -> Motion
  • System -> General
  • System -> DST
  • System -> Information
  • System -> Maintenance
  • System -> Performance
  • System -> Reboot
  • User -> Online User
  • User -> Add User
  • User -> Manage User
  • Device -> HDD/SD Card
  • PTZ -> Presets, Calibration Status
  • Zoom
  • Focus
  • Image (Brightness, Contrast, Saturation, Hue, Sharp, Mirror, Rotate)
  • Advanced Image (Anti-flicker, Exposure, White Balance, DayNight, Backlight, LED light, 3D-NR)
  • Image Data -> "Snap" Frame from Video Stream

SET:

  • Display -> OSD
  • Recording -> Encode (Clear and Fluent Stream)
  • Recording -> Advance (Scheduling)
  • Network -> General
  • Network -> Advanced
  • Network -> DDNS
  • Network -> NTP
  • Network -> E-mail
  • Network -> FTP
  • Network -> Push
  • Network -> WIFI
  • Alarm -> Motion
  • System -> General
  • System -> DST
  • System -> Reboot
  • User -> Online User
  • User -> Add User
  • User -> Manage User
  • Device -> HDD/SD Card (Format)
  • PTZ (including calibrate)
  • Zoom
  • Focus
  • Image (Brightness, Contrast, Saturation, Hue, Sharp, Mirror, Rotate)
  • Advanced Image (Anti-flicker, Exposure, White Balance, DayNight, Backlight, LED light, 3D-NR)

Supported Cameras

Any Reolink camera that has a web UI should work. The other's requiring special Reolink clients do not work and is not supported here.

  • RLC-411WS
  • RLC-423
  • RLC-420-5MP
  • RLC-410-5MP
  • RLC-510A
  • RLC-520
  • C1-Pro
  • D400
  • E1 Zoom

reolinkcameraapi.github.io's People

Contributors

benehiko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

deanxsaber

reolinkcameraapi.github.io's Issues

Analyzing packet traffic

I analyzed the packet traffic of my camera RLC-510A and I saw that it sends packets to the following external IPs:

  • 35.180.209.250 (Amazon AWS)
  • 3.86.245.53 (Amazon AWS)
  • 239.255.255.250

The last IP is for UPnP (Universal Plug and Play)/SSDP (Simple Service Discovery Protocol) by various vendors to advertise the capabilities of (or discover) devices on a VLAN. MAC OS, Microsoft Windows, IOS and other operating systems and applications use this protocol (source).

I am wondering why the camera sends packets to Amazon AWS ๐Ÿค”

Useful bash scripts about RTSP and download records from camera

I was playing with some ways to download video from the camera via RTSP and I've finally found what I want, therefore, I made some useful bash scripts ready to use.

I don't know if it is better to create a repository only with bash scripts or show it here on the Github page.

Here are my scripts:

download.sh, this will use ffmpeg to download via RTSP the video and audio from your camera saving it in the MP4 format, the name will start with the date of the day (ex. 2022-08-26--22-00-00-capture-0000.mp4) and a file will be recorded and saved every $TIME seconds.
The name of the files starts with a date to make it easier the management of the files, like removing easily all the records of a specific month, day or year.

USERNAME="admin"
PASSWORD="mypassword"
TIME=60 # seconds
IP="192.168.1.197"
PORT=554

ffmpeg -i rtsp://$USERNAME:$PASSWORD@$IP:$PORT/h264Preview_01_main \
       -c copy \
       -map 0 \
       -reset_timestamps 1 \
       -f segment \
       -segment_time $TIME \
       -strftime 1 \
       -segment_format mp4 \
       "%Y-%m-%d--%H-%M-%S--capture-%04d.mp4"

clean_records.sh, this delete all the records inside a tmp directory of the previous month.

LAST_MONTH=$(date --date='-1 month' +'%Y-%m')
rm "tmp/$LAST_MONTH-"*

Let's create a repo or a page on the github page website then? @Benehiko

Why ffmpeg?

I tried openRTSP โŒ but half of the video in the MP4 format is without audio and I don't know why.

example: openRTSP -D 1 -c -B 10000000 -b 10000000 -q -Q -F cam_eight -d 28800 -P 10 -t rtsp://"admin":"mypassword"@192.168.0.176:554

source of command and explanation: https://superuser.com/questions/766437/capture-rtsp-stream-from-ip-camera-and-store

I tried VLC โŒ but I got some issues saving the files with the audio and managing it.

example command: cvlc rtsp://admin:[email protected]:554//h264Preview_01_main --sout=file/ts:mystream.mpg

FFmpeg was the best, so I chose it. โœ…

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.