mkotyk / qt428

Wrapper for DVR Live video streaming
Apache License 2.0
4 stars 1 forks source link

Add --timeout and --max-bytes #9

Open jidanni opened 7 years ago

jidanni commented 7 years ago

Add both a 'number of bytes to get before exit' and a 'seconds elapsed before exit' safety options, so the user wouldn't need to do

timeout -k 9 7 ./qt428 -c $CAMERA 59.126.105.57|
dd count=200 of=/tmp/cctv0
sed /^0000/d /tmp/cctv0 > /tmp/cctv1 # https://github.com/mkotyk/qt428/issues/6
ffmpeg -r 25 -f h264 -i /tmp/cctv1 -vframes 1 -y /tmp/camtmp.jpg

to prevent a runaway program from eating bytes from the Internet for the rest of the day, no matter when feeding to mplayer or ffmpeg or even just a file.