Cannot Query Video Position

Hello,

I am experiencing an error regarding my camera feed that is supposed to run along side my code. Here is the error I am getting:

[ INFO:0] global /tmp/build_opencv/opencv/modules/videoio/src/videoio_registry.cpp (223) VideoBackendRegistry VIDEOIO: Enabled backends(8, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); FIREWIRE(940); UEYE(930)
[ INFO:0] global /tmp/build_opencv/opencv/modules/videoio/src/cap_gstreamer.cpp (850) open OpenCV | GStreamer: nvarguscamerasrc ! video/x-raw(memory:NVMM), format=(string)NV12, framerate=(fraction)15/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! queue max-size-buffers=1, leaky=downstream ! appsink max-buffers=0.1 drop=True sync=False
0:00:00.257505410 7581 0x727ec90 ERROR GST_PIPELINE grammar.y:455:gst_parse_element_set: could not set property “max-size-buffers” in element “queue0” to “1,”
0:00:00.259014918 7581 0x727ec90 ERROR GST_PIPELINE grammar.y:455:gst_parse_element_set: could not set property “max-buffers” in element “appsink0” to “0.1”
[ INFO:0] global /tmp/build_opencv/opencv/modules/videoio/src/cap_gstreamer.cpp (883) open OpenCV | GStreamer: mode - MANUAL
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected…
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3264 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 2
Output Stream W = 1920 H = 1080
seconds to Run = 0
Frame Rate = 29.999999
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
[ WARN:0] global /tmp/build_opencv/opencv/modules/videoio/src/cap_gstreamer.cpp (1100) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
[ INFO:0] global /tmp/build_opencv/opencv/modules/highgui/src/registry.impl.hpp (114) UIBackendRegistry UI: Enabled backends(2, sorted by priority): GTK(1000); GTK3(990) + BUILTIN(GTK3)
[ INFO:0] global /tmp/build_opencv/opencv/modules/highgui/src/backend.cpp (90) createUIBackend UI: using backend: GTK (priority=1000)
[ INFO:0] global /tmp/build_opencv/opencv/modules/highgui/src/window_gtk.cpp (2356) createWindow OpenCV/UI: Creating GTK window: CSI Camera (1)
[ INFO:0] global /tmp/build_opencv/opencv/modules/highgui/src/window_gtk.cpp (573) CvWindow OpenCV/UI: creating GTK window: CSI Camera
[ INFO:0] global /tmp/build_opencv/opencv/modules/core/src/parallel/registry_parallel.impl.hpp (96) ParallelBackendRegistry core(parallel): Enabled backends(3, sorted by priority): ONETBB(1000); TBB(990); OPENMP(980)
[ INFO:0] global /tmp/build_opencv/opencv/modules/highgui/src/window_gtk.cpp (1273) destroy OpenCV/UI: destroying GTK window: CSI Camera
[ INFO:0] global /tmp/build_opencv/opencv/modules/highgui/src/window_gtk.cpp (2356) createWindow OpenCV/UI: Creating GTK window: CSI Camera (1)
[ INFO:0] global /tmp/build_opencv/opencv/modules/highgui/src/window_gtk.cpp (573) CvWindow OpenCV/UI: creating GTK window: CSI Camera
^CGST_ARGUS: Cleaning up
CONSUMER: Done Success
GST_ARGUS: Done Success
[ INFO:0] global /tmp/build_opencv/opencv/modules/highgui/src/window_gtk.cpp (1273) destroy OpenCV/UI: destroying GTK window: CSI Camera
Traceback (most recent call last):
File “/home/nader/project/camera.py”, line 42, in
main()
File “/home/nader/project/camera.py”, line 27, in main
ret, frame = cap.read()
^^^^^^^^^^
KeyboardInterrupt

Any suggestions???

hello npesa01,

since it’s also fetch the sensor stream via gst pipeline. it’s suggested to test with basic preview streams.
for example,
$ gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),framerate=30/1,format=NV12' ! nvvidconv ! xvimagesink

besides,
please double check you’re using correct property settings.
it’s device tree property, position to define camera position.

My team tested it with a basic script using a streamer pipeline and it worked perfectly, but when I run it with an application, it gives problems like the one I mentioned above. The problem is the buffer issue where it cannot query video position. Do you any solutions regarding that?

hello npesa01,

please double check the DT property definition.
and… please dig into your app implementation since basic camera functionality works normally.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.