https://github.com/maexled/hikvision-event-stream-video-recorder
Capturing Video in Response to Hikvision Camera Alert Stream Events
https://github.com/maexled/hikvision-event-stream-video-recorder
bash ffmpeg hikvision-camera nvr video-recording
Last synced: 8 months ago
JSON representation
Capturing Video in Response to Hikvision Camera Alert Stream Events
- Host: GitHub
- URL: https://github.com/maexled/hikvision-event-stream-video-recorder
- Owner: maexled
- License: mit
- Created: 2023-08-24T20:22:13.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-08-24T20:40:26.000Z (about 2 years ago)
- Last Synced: 2024-12-29T01:58:15.225Z (10 months ago)
- Topics: bash, ffmpeg, hikvision-camera, nvr, video-recording
- Language: Shell
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hikvision Event Stream Video Recorder
This script observes Hikvision camera events and captures video accordingly.
## Requirements
- `bash`
- `curl`
- `ffmpeg`
- `xmlstarlet`Make sure these dependencies are installed in your environment before running the script.
## Usage
Follow the instructions below to run the script:
1. Clone this repository to your local machine:
```bash
git clone https://github.com/maexled/hikvision-event-stream-video-recorder.git
```2. Navigate to the directory containing the script:
```bash
cd hikvision-event-stream-video-recorder
```3. Set the required environment variables: ADDRESS, USERNAME, and PASSWORD.
```bash
bash event_stream_recorder.sh
```## Environment Variables
Before running the script, you need to set the following environment variables:
- `ADDRESS`: The IP address of your camera.
- `USERNAME`: The username for accessing the camera.
- `PASSWORD`: The password for accessing the camera.
- `STREAM_PORT`: The port for the rtsp stream (optional, by default 554)
- `STREAMING_CHANNEL`: The streaming channel (optional, by default 1)
- `RECORDING_FOLDER`: The root folder where the recordings are saved into (optional, by default /app/recordings)
- `TZ`: The timezone (optional, but prefered to adapt to your timezone)Alternatively, you can set them directly in the terminal before running the script.
## Running the Script in a Docker Container
```bash
docker container run \
-e ADDRESS=your_camera_ip \
-e USERNAME=your_camera_username \
-e PASSWORD=your_camera_password \
-e TZ=Europe/Berlin \
-v $(pwd)/recordings:/app/recordings \
--name event-stream-recorder \
ghcr.io/maexled/hikvision-event-stream-video-recorder
```## License
This project is licensed under the MIT license.