iot4c
Published © GPL3+

Router Becomes Video Recorder for IP Cameras

...streams H264/265 RTSP. In addition to routing functions.

IntermediateFull instructions provided2 hours800
Router Becomes Video Recorder for IP Cameras

Things used in this project

Hardware components

Ethernet Cable, Patch Lead
Ethernet Cable, Patch Lead
×1
Plastic Enclosure, Precision Miniature Case
Plastic Enclosure, Precision Miniature Case
×1
Commercial MLC 2.5 SSD
Delkin Commercial MLC 2.5 SSD
×1

Story

Read more

Code

Crontab

BatchFile
The crontab of OpenWrt was configured for save video from IP camera in files and for control of the video archive size
@reboot sleep 10; DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C

@reboot sleep 20; chroot debian dpkg --configure -a

@reboot sleep 40; mount -o bind /proc /root/debian/proc; mount -o bind /dev /root/debian/dev; mount -o bind /sys /root/debian/sys

*/2 * * * * chroot /root/debian ffmpeg -rtsp_transport tcp -i rtsp://192.168.1.10:554/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp?real_stream -t 118 -vcodec copy -acodec copy /home/chroot/cam01/`date +\%Y\%m\%d\%H\%M\%S`.avi > /dev/null 2>&1

*/6 * * * * while [ $(du -sm /root/debian/home/chroot/cam01| cut -f1) -gt 4000 ]; do rm -f /root/debian/home/chroot/cam01/"$(ls -1c /root/debian/home/chroot/cam01/ | tail -n1)";done > /dev/null 2>&1

Credits

iot4c

iot4c

9 projects • 2 followers

Comments