2

Capture and display video from either IP CAM, USB webcam, or the Tegra X2/X1 onb...

 1 year ago
source link: https://gist.github.com/jkjung-avt/86b60a7723b97da19f7bfa3cb7d2690e
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

niteshgaba commented on Apr 12, 2021

edited

Hi @jkjung-avt

I am open-cv to only capture the frames from the terminal, everything works fine till I try to release the camera object, the system throws "GST_ARGUS: Cleaning up Segmentation fault (core dumped)". Could you please help me through? If you could have a look https://gist.github.com/niteshgaba/2148e78ae5276907fc49c4eddb44446e

thank you @jkjung-avt for posting this useful tip. I have followed your rtsp setup for ip camera and it does work.
In fact the cap is open and I can take frames from the cap object. However, I got the following warnings and somewhat intermittent performance issues with the capture:

(python3:10309): GStreamer-CRITICAL **: 10:25:13.291: gst_caps_is_empty: assertion 'GST_IS_CAPS (caps)' failed

(python3:10309): GStreamer-CRITICAL **: 10:25:13.291: gst_caps_truncate: assertion 'GST_IS_CAPS (caps)' failed

(python3:10309): GStreamer-CRITICAL **: 10:25:13.291: gst_caps_fixate: assertion 'GST_IS_CAPS (caps)' failed

(python3:10309): GStreamer-CRITICAL **: 10:25:13.291: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

(python3:10309): GStreamer-CRITICAL **: 10:25:13.291: gst_structure_get_string: assertion 'structure != NULL' failed

(python3:10309): GStreamer-CRITICAL **: 10:25:13.291: gst_mini_object_unref: assertion 'mini_object != NULL' failed
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 
Allocating new output: 1280x720 (x 12), ThumbnailMode = 0
OPENMAX: HandleNewStreamFormat: 3605: Send OMX_EventPortSettingsChanged: nFrameWidth = 1280, nFrameHeight = 720 
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (896) open OpenCV | GStreamer warning: unable to query duration of stream
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (933) open OpenCV | GStreamer warning: Cannot query video position: status=1, value=0, duration=-1

Is there anything I can do to get rid of those critical warning?

gst string is exactly the same as you suggested:

gst_str = ('rtspsrc location={} latency={} ! '
                        'rtph264depay ! h264parse ! omxh264dec ! '
                        'nvvidconv ! '
                        'video/x-raw, width=(int){}, height=(int){}, '
                        'format=(string)BGRx ! videoconvert ! '
                        'appsink').format(uri, latency, width, height)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK