It is unclear if OpenCV makes use of TK1’s hardware video decoder — instead it may be using CPU decoder (ffmpeg). What transport protocol does your IP camera use? If it’s using RTP/RTSP or has V4L2 driver, you may be able to independently verify with gstreamer. Here are some examples:
Thanks, Yes it is seems to be using CPU decoder (ffmpeg). My camera supports RTSP and has h.264 and mjpeg video compression.
I want to do it in opencv. What is the right way to pursue that?
Since you have Totem working with your camera, and Totem uses gstreamer backend, you could use gstreamer in the meantime. You might find this post relevant: [url]https://devtalk.nvidia.com/default/topic/789337/?comment=4372373[/url]. We are continuing to dig into this case to hopefully avoid your headache in the future.
I’m facing the same problem when opening IP camera (RTSP) in OpenCV4Tegra.
One solution I found is to put ffmpeg=OFF when configuring OpenCV and use gstreamer instead. But I had a delay of around 3 seconds in the video output.
Now I’m using OpenCV4Tegra, it uses ffmpeg it seems. The decode error is present. Any help?
We are facing the same problem at our client site, please see the python code below to read the frames from DVR.
import numpy as np
import cv2
cap = cv2.VideoCapture("rtsp://admin:admin123@xx.xx.xx.xx/h264/ch1/main/av_stream")
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# Display the resulting frame
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
Please see the configurations below
Camera Type - Analog (2)
Resolution - 640p
FPS - 6
Bit rate - 128 kb/s
GPU Details - NVDIA Quadro P400 2GB
CPU Details - i5 7th Generation, 8GB RM
Operating System - Windows 10 Pro
But console shows following messages:
[h264 @ 0xxxxx] cabac decode of qscale diff failed at
[h264 @ 0xxxxx] error while decoding MB 0 29, bytestream (-1)
[h264 @ 0xxxxx] left block unavailable for requested intra mode at
When we process one camera frequency is less and for 2 cameras it’s more. Also, this error starts popping after few hours when application is started and frequency increases which causes inaccurate results. There are no fixed time intervals.
Please help us with some suggestions.
Best regards,
Pranita