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

thread error if set "reopen_on_read_failure" to be true #78

Open
CanboYe opened this issue Oct 27, 2020 · 2 comments
Open

thread error if set "reopen_on_read_failure" to be true #78

CanboYe opened this issue Oct 27, 2020 · 2 comments

Comments

@CanboYe
Copy link

CanboYe commented Oct 27, 2020

Because I got Error "Could not capture frame" sometimes, I set "reopen_on_read_failure" to be true.

However, this will result in the thread error as follows and shut down the camera node.

[ERROR] [1603808756.444539510]: Could not capture frame
[ WARN] [1603808756.444615546]: trying to reopen the device
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::thread_resource_error> >'
  what():  boost thread: trying joining itself: Resource deadlock avoided

Btw, I will always get frame dropping and I cannot find the reasons. Is that common? Three kinds of dropping messages are as follows.

[rtsp @ 0x7fbfc802db60] RTP timestamps don't match.
[rtsp @ 0x7fbfc802db60] Received packet without a start chunk; dropping frame.
[rtsp @ 0x7fbfc802db60] Missing packets; dropping frame.

Thanks a lot!

@awesomebytes
Copy link
Member

RTP streams do lose data in my experience. I am not happy that video_stream_opencv doesn't deal with that problem gracefully enough, but I don't have a test environment to reproduce the problem.

Did you find a fix?

@rolker
Copy link

rolker commented May 21, 2021

I'm encountering the same problem and have setup a way to reproduce the failure in a debugging session. Here's what's happening:

In video_stream.cpp's do_capture() method, we get to line 129 where unsubscribe() is called.
At line 318 in the unsubscribe() method, capture_thread.join() is called which causes the exception.

It's my first time looking at this code base, so I don't a solution yet, but it seems like we either need to not restart the thread when resubscribing or exit the thread before doing the unsubscribe/resubscribe.

I'll report back if I come up with a solution, but if I don't, I hope the above is useful to someone.

rolker added a commit to rolker/video_stream_opencv that referenced this issue May 21, 2021
dulanad pushed a commit to h2o-robotics/video_stream_opencv that referenced this issue Jul 13, 2021
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