Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timelaps video is not complete when Webcam not response for a while #344

Closed
midopple opened this issue Jan 11, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@midopple
Copy link

commented Jan 11, 2014

Sometimes my Webcam lost the connection, after reconnect the USB the Webcam works normal.

The Issue is that the picturecounter (self._imageNumber) count up without geting a picture from the Webcam. After reseting the Webcam, octoprint get pictures but the file numbering für AVCONV is broken like
tmp_00000.jpg, tmp_00001.jpg, tmp_00002.jpg, tmp_00003.jpg, tmp_00008.jpg,tmp_00009.jpg

I add a check in timelapse.py

def _captureWorker(self, filename):
eventManager().fire(Events.CAPTURE_START, {"file": filename});
try:
urllib.urlretrieve(self._snapshotUrl, filename)
except:
self._imageNumber -= 1
self._logger.debug("Image %s captured from %s" % (filename, self._snapshotUrl))
eventManager().fire(Events.CAPTURE_DONE, {"file": filename});

My Branch: devel, Commit: cec2bdb

foosel added a commit that referenced this issue Apr 1, 2014

Decrease image counter if an image could not be captured from webcam
Should keep rendering of timelapse from breaking if only a couple of images couldn't be captured due to whatever reason. Suggested by @midopple in #344
@foosel

This comment has been minimized.

Copy link
Owner

commented Apr 1, 2014

Implemented in devel, good idea, thanks!

@foosel foosel closed this Apr 1, 2014

foosel added a commit that referenced this issue Dec 27, 2014

Decrease image counter if an image could not be captured from webcam
Should keep rendering of timelapse from breaking if only a couple of images couldn't be captured due to whatever reason. Suggested by @midopple in #344
(cherry picked from commit bf9d5ef)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.