klintan / ros2_video_streamer

Python video streamer or camera simulator in ROS2
MIT License
27 stars 17 forks source link

End of video error #5

Closed defrag-bambino closed 2 years ago

defrag-bambino commented 2 years ago

Hi,

I was using your node to publish a very short video and noticed that once the video ends, the node crashes while throwing an error. This is due to the opencv video capture not being able to read the next frame (as the video is over) and thus the image variable being 'None'. I fixed this in my fork here. I opened a PR here. While at it, I also implemented the '--loop' feature, which allows one to not close the node after the end of the video, but loop it.

Thanks

klintan commented 2 years ago

Thanks for fixing this, merged the PR so closing this.