Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Keep in mind, when communicating with IP cameras, things can happen that might cause the camera or the wire to hiccup. For the most part, ffmpeg handles these situations. However, if the camera is having problems, it's power drops momentarily (for example), that will cause ffmpeg to hang. There is the specific situation of a stream disappearing that will cause ffmpeg to hang. BTW, I'm a developer that has given up getting an ffmpeg patch that fixes this added to the official open source version. The ffmpeg developers say the fix is situation specific, or some similar reason. The gist is, in the low level routine that reads a stream packet off the wire there is no check for the socket itself to have dropped. If the connection drops, ffmpeg will hang, and in some situations and with some less than stellar ip cameras, they re-start an ongoing stream without notice. That triggers this situation just the same as the camera losing power for a moment. I have a modified ffmpeg version with the fix for this here: https://github.com/bsenftner/FFmpeg The fix is actually just 4 lines of code: https://gist.github.com/bsenftner/ba3d493fa36b0b201ffd995e8c2c60a2 My version of ffmpeg is not the most recent, close but not. I found some instabilities in the most recent and have been waiting for that instability to be fixed.
Thanks for this information. Its just a wrapper for ffmpeg. https://github.com/kkroening/ffmpeg-python