0

Sorry for my english (i'm rus)

I save MJPEG stream from IP-camera with wget

wget -O 2010-01-12_01.mjpeg http://172.16.1.220:8070/video.mjpg

I need limit saving by hour (every hour is a another file - 2010-01-12_[XX])

What is the bast way to do it ? 1) starting and killing by cron ? 2) for .. do in script, how ? ...

thanks for answers

4

5 回答 5

2

您可以使用超时实用程序:

timeout 3600 wget -O `date +%Y-%m-%d_%T`.mjpeg http://172.16.1.220:8070/video.mjpg
于 2016-06-21T10:47:02.737 回答
1

我会使用这样的东西:

( wget ... & sleep 3600; kill %1 )
于 2010-01-12T09:51:09.340 回答
0

像bash kludge一样甜

wget whatever &
sleep 60 && kill $$ 2>/dev/null
于 2010-01-12T09:52:51.827 回答
0

只是 wget 的另一种方法

while [ "true" ]; do 
ffmpeg -t 3600 -i http://172.16.1.220:8070/video.mjpg -vcodec mjpeg /path/to/storage/$(date +%Y-%m-%d_%H).mjpg
done
于 2013-02-13T21:52:07.683 回答
-1

尝试curl使用-mor--max-time选项

于 2014-09-12T18:10:13.417 回答