basler / gst-plugin-pylon

The official GStreamer plug-in for Basler cameras
BSD 3-Clause "New" or "Revised" License
40 stars 10 forks source link

i want use pylonsrc in python #78

Closed jooyeop closed 10 months ago

jooyeop commented 10 months ago

cap = cv2.VideoCapture("pylonsrc device-serial-number='24146719'" "cam::PixelFormat=YUV422_YUYV_Packed " "cam::GainRaw=150 ! " "video/x-raw,width=1280,height=1024,format=YUY2 ! " "videoconvert ! " "video/x-raw,format=BGR ! " "appsink", cv2.CAP_GSTREAMER)

cap = cv2.VideoCapture("pylonsrc device-index=0" "cam::PixelFormat=YUV422_YUYV_Packed " "cam::GainRaw=150 ! " "video/x-raw,width=1280,height=1024,format=YUY2 ! " "videoconvert ! " "video/x-raw,format=BGR ! " "appsink", cv2.CAP_GSTREAMER)

cap = cv2.VideoCapture("pylonsrc device-user-name='test'" "cam::PixelFormat=YUV422_YUYV_Packed " "cam::GainRaw=150 ! " "video/x-raw,width=1280,height=1024,format=YUY2 ! " "videoconvert ! " "video/x-raw,format=BGR ! " "appsink", cv2.CAP_GSTREAMER)

I tried all three of the above, but the following error occurred.

0:00:04.341208029 8378 0x4009ef00 ERROR pylonsrc gstpylonsrc.cpp:1026:gst_pylon_src_child_proxy_get_child_by_name: Please specify a camera before attempting to set Pylon device properties 0:00:04.604207741 8378 0x4009ef00 WARN pylonsrc gstpylonsrc.cpp:820:gst_pylon_src_start: error: Failed to start camera. 0:00:04.604457558 8378 0x4009ef00 WARN pylonsrc gstpylonsrc.cpp:820:gst_pylon_src_start: error: No devices found matching the specified criteria 0:00:04.604634258 8378 0x4009ef00 WARN basesrc gstbasesrc.c:3468:gst_base_src_start: error: Failed to start 0:00:04.604769934 8378 0x4009ef00 WARN basesrc gstbasesrc.c:3824:gst_base_src_activate_push: Failed to start in push mode 0:00:04.604890219 8378 0x4009ef00 WARN GST_PADS gstpad.c:1142:gst_pad_set_active: Failed to activate pad [ WARN:0@7.811] global cap_gstreamer.cpp:2784 handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module pylonsrc0 reported: Failed to start camera. [ WARN:0@7.865] global cap_gstreamer.cpp:1679 open OpenCV | GStreamer warning: unable to start pipeline [ WARN:0@7.865] global cap_gstreamer.cpp:1164 isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created [ WARN:0@7.865] global cap.cpp:204 open VIDEOIO(GSTREAMER): backend is generally available but can't be used to capture by name

Help Me

jooyeop commented 10 months ago

complete