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

Missing teardown logic that doesn't cause the video to stop #52

Open
sveres opened this issue Jun 24, 2021 · 8 comments
Open

Missing teardown logic that doesn't cause the video to stop #52

sveres opened this issue Jun 24, 2021 · 8 comments

Comments

@sveres
Copy link

sveres commented Jun 24, 2021

Hey,
I think there is no way to stop the video recognition without pausing the video feed.

If I VideoRecognizer.cancelRecognition(), it pauses the video feed.
If I call VideoRecognizer.deleteRecognizer() without calling cancel firs, it will result in an unexpected error: "Uncaught (in promise): Recognizer runner is deleted. It cannot be used anymore!"
I think that's because there is still a setTimeout alive that tries to call processImage().

If I am wrong and there is a way, could you point me to the right documentation/code piece, please?

@vjekoart
Copy link
Contributor

Hi @sveres,

You're right. We don't have a teardown logic that doesn't cause the video to stop. I suppose this is something that will benefit your use case?

Also, there is no VideoRecognizer.deleteRecognizer() method. To make things more clear, could you clarify which method do you reference there?

Sincerely,
Vjekoslav

@sveres
Copy link
Author

sveres commented Jun 29, 2021

hi @vjekoart

Yes, in our use case, the barcode recognition is optional and our barcode reading implementation cannot stop the video, otherwise it interferes with an other, parallel capturing method.
Is there by any chance a workaround to use the VideoRecognizer without causing the video to pause at the end of the scanning?

You are right, there is no method like that, sorry about the confusion. What I meant is the delete() method. Which, In my understanding should be called after the cancellation, please correct me if I am wrong.

delete(): Promise< void >;

@vjekoart
Copy link
Contributor

Hi @sveres,

Thank you for the explanation. We'll look into this behaviour and extend the functionality from our side if we don't find an alternative solution.

Sincerely,
Vjekoslav

@sveres
Copy link
Author

sveres commented Jun 29, 2021

Thank you as well, if there is anything else I can clarify, please just let me know.

@sveres
Copy link
Author

sveres commented Jul 23, 2021

Hi @vjekoart
Do you have any update on this feature?

@vjekoart
Copy link
Contributor

Hi @sveres,

We're currently not working on this feature. However, the task is defined and placed in the backlog, but we cannot tell the exact date when it's going to be implemented due to limited resources.

Sincerely,
Vjekoslav

@DoDoENT
Copy link
Member

DoDoENT commented Sep 27, 2021

Hi @sveres,

if you are using VideoRecognizer directly from your code, you can call pauseRecognition - this will pause the recognition loop (i.e. new frames won't be processed, even if there are still live processImage tasks queued from setTimeout), but the video feed will keep working (the camera will still be enabled). You can then resume the recognition by calling resumeRecognition.

If you also want to stop the video feed (i.e. "freeze" the video feed, without tearing down the camera), you can call pauseVideoFeed. However, after pausing the video feed, you will need to resume the recognition by calling either recognize or startRecognition (recognize is just simple wrapper around startRecognition that set the default onScanningDone callback that pauses the video feed before resolving the promise).

@sveres
Copy link
Author

sveres commented Sep 27, 2021

Thanks @DoDoENT, this is great news, we will check pauseRecognition out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants