34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
|
|
import cv2
|
|
|
|
#cap = cv2.VideoCapture("rtspsrc location=rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov ! application/x-rtp, media=video ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvidconv ! video/x-raw, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink", cv2.CAP_GSTREAMER)
|
|
|
|
|
|
|
|
#cmd = 'filesrc location=/home/thebears/local/source/reduced.mp4 ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! nvv4l2decoder ! nvvidconv ! appsink'
|
|
|
|
cmd = 'filesrc location=/home/thebears/local/source/full.mp4 ! qtdemux name=demux demux.video_0 ! queue ! h265parse ! nvv4l2decoder ! nvvidconv ! appsink sync=false'
|
|
#cmd = 'filesrc location=/home/thebears/local/source/full.mp4 ! qtdemux name=demux demux.video_0 ! h265parse ! avdec_h265 ! videoconvert ! appsink'
|
|
|
|
|
|
#cmd = 'videotestsrc ! autovideosink'
|
|
|
|
cap = cv2.VideoCapture(cmd, cv2.CAP_GSTREAMER)
|
|
|
|
|
|
import time
|
|
st = time.time()
|
|
fr = 0
|
|
while True:
|
|
good, frf = cap.read()
|
|
fr+=1
|
|
print(good, fr)
|
|
if not good:
|
|
break
|
|
|
|
|
|
et = time.time()
|
|
|
|
print(et-st, fr/(st-et))
|
|
|