Last active
November 12, 2020 03:26
-
-
Save bafu/bb43a9d97762c78a8d41c8c71a556677 to your computer and use it in GitHub Desktop.
Record MJPEG/H.264 stream as segments by ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Dynacolor Dynahawk W2V1-H IP Camera | |
Ip="192.168.0.2" | |
HttpStreamSource="http://$Ip:8008" # mjpeg, ~3 MB / 1 sec | |
RtspStreamSource="rtsp://$Ip/h264" # h.264, ~0.3 MB / 1 sec | |
# Save streaming until pressed 'q'. | |
# Save a segment every 60 secs. | |
#ffmpeg -i $HttpStreamSource -c copy -map 0 -f segment -segment_time 60 -segment_format mp4 "capture-%03d.mp4" | |
ffmpeg -i $RtspStreamSource -c copy -map 0 -f segment -segment_time 60 "capture-%03d.avi" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment