tchellomello / python-amcrest

A Python 2.7/3.x module for Amcrest and Dahua Cameras using the SDK HTTP API.
GNU General Public License v2.0
216 stars 76 forks source link

How to use a timer to control the real stream? #157

Open jpmann opened 4 years ago

jpmann commented 4 years ago

As mentioned in the docs, the script to store the continuous stream is camera.realtime_stream(path_file="/home/user/Desktop/myvideo") CTRL-C to stop the continuous video flow or use a timer I have a couple of questions -

  1. How to use the timer for stopping the stream?
  2. Where to put the print statement so that I can log whenever it is updating /home/user/Desktop/myvideo

if path_file: _try: I am putting a print statement here to see whenever it gets copied but it prints only once despite the file getting updated continuously with open(path_file, 'wb') as out_file: shutil.copyfileobj(ret.raw, out_file) except HTTPError as error: LOGGER.debug("%s Realtime stream capture to file failed due " "to error: %s", self, repr(error)) raise CommError(error)