3
  • OS: Ubuntu 16.04
  • Python: 3.5.3
  • vlc-lib: 1.1.2
  • camera protocol: RTSP

I need get the frames without the open windows with the python-vlc library the only way I found to streaming RTSP)

Here is my code

import vlc
import time
import os

player=vlc.MediaPlayer('rtsp://<cam_ip>/live.sdp?<specifications>')
player.play()

count = 1
while True:
    time.sleep(0.005)
    snap_name = 'snaps/' + str(count) + '_snap.png'
    player.video_take_snapshot(0, snap_name, 0, 0)
    count += 1
    print(count)

Is there a way to grab the frames without play the video?

Putting all the frames on a folder to process them do not look like a good ideia

Thanks in advance

Obs. Im not using cv2.VideoCapture() because this option cant support rtsp protocol to stream. All the frames using this options returns None

0 Answers0