Emotion Recognition in live stream using OpenCV

Hi there,

We have to classify emotions of different faces from live video streaming coming from an 8K HD Camera. This camera is connected through network using rtmp. We have designed an AI engine comprising three modules – face detection, face recognition, emotion detection placing those in a docker container.

Challenge we are facing is -
While trying to access the rtmp live feed in our AI engine we are getting this exception. We tried with/without docker but exception remains the same.

OpenCV(4.4.0) C:\users \appveyor\AppData\Local\Temp\1\pip-req-build-61y1wdcz\opencv\modules\videoio\src\cap_images.cpp:235: error: (-5:Bad argument) CAP_IMAGES:Can’t find starting number (in the name of file): rtmp://url in function ‘cv::icvExtractPattern’

Any immediate reply on rectifying this error will be duly appreciated.


did you google the error?

I googled, but didn’t find relevant reply. Majority of threads are unanswered to this error.

try to get some more debug information by:

  • setting the OPENCV_VIDEOIO_DEBUG env var to 1 and rerun your script.
    this should result in some logging, which backends were present / tried
  • print(cv2.getBuildInformation()) and look at the Video IO section

most likely there was nothing available that supports rtmp (like ffmpeg or gstreamer backend) so it fell back to the image capture