0

I tried streaming a video from ip-camera to HDMI. I wrote a code with opencv on python 3, but the times between frames is ~0.075

import cv2 as cv
from time import time
vcap = cv.VideoCapture("rtsp://192.168.0.88:554/user=admin&password=&channel=1&stream=0.sdp?")
current_time = time()
delta_time = 0

while(1):
    delta_time = time() - current_time
    print(delta_time)
    current_time = time()
    ret, frame = vcap.read()
    cv.imshow('VIDEO', frame)
    cv.waitKey(1)

nmap my ip-camera's

Starting Nmap 6.47 ( http://nmap.org ) at 2017-07-05 14:11 UTC
Nmap scan report for 192.168.0.88
Host is up (0.00063s latency).
Not shown: 996 closed ports
PORT     STATE SERVICE    VERSION
23/tcp   open  telnet     Busybox telnetd
80/tcp   open  tcpwrapped
554/tcp  open  rtsp?
8899/tcp open  soap       gSOAP soap 2.7

when I try streaming with OMXPlayer

omxplayer rtsp://192.168.0.88:554/user=admin&password=&channel=1&stream=0.sdp?

I get

[1] 1473
[2] 1474
[3] 1475

[1]+  Stopped                 sudo omxplayer rtsp://192.168.0.88:554/user=admin
[2]   Done                    password=
[3]   Done                    channel=1

how can I stream a video faster on raspberry pi 3?

api55
  • 11,070
  • 4
  • 41
  • 57
mamol
  • 91
  • 2
  • 11
  • Can you try setting the capture rate to something a bit higher than default? vcap.set(cv.cv.CV_CAP_PROP_FPS, 60) ? Note that the CV_CAP_PROP_FPS is CAP_PROP_FPS in opencv 3.2.0. Source: https://stackoverflow.com/questions/7039575/how-to-set-camera-fps-in-opencv-cv-cap-prop-fps-is-a-fake – BoboDarph Jul 07 '17 at 10:04
  • for the omxplayer part, use " " for the rtsp. & is recognized as something else and runs 3 instructions (that is why you have 3 processess) – api55 Jul 07 '17 at 10:40
  • Also, it could be that the stream command needs an fps argument? in some cameras the default is 15 fps or 10 fps (similar to your times), but some of them can go up to 25-30, and some even up to 50-60. Sometimes this is set in the configuration. This is also limited to the resolution, and bandwidth of your connection to the raspberry pi. – api55 Jul 07 '17 at 10:45
  • Thank you, it realy help me! `omxplayer --live --fps 25 "rtsp://192.168.0.88:554/user=admin&password=&channel=1&stream=0.sdp?"` – mamol Jul 11 '17 at 07:01

0 Answers0