I want to find a subsitution for cv2.VideoCapture for reading RTSP h264 steam. Seems libvlc is more stable than opencv when decoding h264.
I use such codes:
Instance = vlc.Instance()
player = Instance.media_player_new('--no-xlib')
Media = Instance.media_new('rtsp://admin:abcd1234@192.168.0.207:554')
Media.get_mrl()
player.set_media(Media)
player.play()
time.sleep(1)
player.video_take_snapshot(num=0, psz_filepath='a.png', i_width=1920, i_height=1080)
these can save a frame to file. But it's too slow. I just want to read the frame ndarray in memory ,and do not show the player window. Just like
cap = cv2.VideoCapture(uri)
cap.read()
How can I do.Thank you