pi-camera-rtsp-server
v1.0.0
Published
Raspberry Pi camera RTSP server tested on Pi Zero W using OV5647 module.
Downloads
3
Readme
pi-camera-rtsp-server
Raspberry Pi camera RTSP server tested on Pi Zero W using OV5647 module.
Requirements
Hardware :
- Raspberry Pi
- Raspberry Pi compatible camera
- Pi/camera compatible ribbon cable
System : up-to-date Raspbian
Setting : camera interface enabled from raspi-config
Software :
bash
nodejs
raspivid
cvlc
fromvlc
openRTSP
fromlivemedia-utils
No NodeJS dependancies.
API
Camera
camera.config
Settings Object
port
: RTSP server broadcasting port Default8554
rotation
: image rotation Default0
, available90
180
270
(i.e. -90)
camera.isActive()
Checks if camera feed is active by the following conditions :
raspivid
(unique) process active- RTSP server port open
camera.enable()
Enable camera. Returns Promise
camera.disable()
Disable camera.
All active records will be stopped first.
Returns Promise
Record
new Record(file, overwrite, duration)
file
(string) : file path + name. Absolute path required ; use$HOME
instead of~
when applicable.overwrite
(boolean) : delete duplicate if existsduration
(integer, optional) : automatically stop record after n seconds NOTE: record still can be manually stopped before defined duration.
Record.start()
Start record.
Camera will be enabled if not already active.
Returns Promise
Record.stop()
Stop record.
Record.file
Record file path + name
Record.duration
Record duration
Record.pid
Record process PID (integer)
Record.startTime
Record start time (Date
)
Record.stopTime
Record stop time (Date
)
Record.elapsedTime
Record elapsed time in (integer, seconds)
Record.recording
Record active state (boolean)
static Record.stopAll()
Stop all active records.
static Record.records
All records (array of Record
instances)
Unit testing
- Make sure you have
ffprobe
binary fromffmpeg
package - Install development dependancies :
yarn install
- Fill
test/config.json
with your video recording test folder - Disable camera (if enabled)
- Run
yarn test
Planned features
- pause/resume recording (using video file concatenation with ffmpeg demuxer method)
License
This project is licensed under GNU GPL v3.