Ask Your Question

Bruno Leme's profile - activity

2019-08-02 00:53:38 -0600 received badge  Notable Question (source)
2018-07-06 10:04:50 -0600 received badge  Popular Question (source)
2016-11-15 11:11:39 -0600 commented answer RTSP communication problem

updated...

well, I was checking the ffmpeg and trying to run in dos the:

ffplay http://192.168.11.146:81/videostream....

at least in the dos it recognize the & as an internal command. (would it be the source of the problem?)

[http @ 01ccbb60] HTTP error 401 Unauthorized 0KB sq=    0B f=0/0
http://192.168.11.146:81/videostream.cgi?rate=0: Server returned 401 Unauthorized (authorization failed)

'pwd' is not recognized as an internal or external command,
operable program or batch file.
2016-11-15 10:24:41 -0600 commented answer RTSP communication problem

Thank you for your reply. I changed my code for make it easier to understand and also did some tests. could you give me more tips?

2016-11-15 10:16:51 -0600 received badge  Editor (source)
2016-11-15 07:37:35 -0600 commented question RTSP communication problem

sorry :-s...

well, after a long time (probably 3 minutes) it returns the error bellow (nothing was loaded)

OpenCV Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow, file ..\..\..\..\opencv\modules\highgui\src\window.cpp, line 261
Traceback (most recent call last):
  File "C:/Users/brleme/PycharmProjects/opencv/karlos.py", line 18, in <module>
    cv2.imshow('frame',frame)
cv2.error: ..\..\..\..\opencv\modules\highgui\src\window.cpp:261: error: (-215) size.width>0 && size.height>0 in function cv::imshow
2016-11-15 07:32:18 -0600 asked a question RTSP communication problem

Hi,

It is my first question in this forum, after looking for a long time any solution. I'm using python 2.7 with OPENCV '2.4.13' (I already tried with 3.1) and I can't open streams. I already solved the ffmpeg problem (dll) and tried to run the local camera and after a local video with success.

could anyone help me? follow below code: PS: Windows 10, x86 rtsp link working (tried in the vlc player) ffmpeg working (tried to run a video in the code locally)

  import cv2, platform
#import numpy as np

cam = "http://192.168.11.146:81/videostream.cgi?rate=0&user=admin&pwd=888888"
#cam = 0 # Use  local webcam.

cap = cv2.VideoCapture(cam)
if not cap.isOpened():
    print("not opened")

while(True):
    # Capture frame-by-frame
    ret, current_frame = cap.read()
    if type(current_frame) == type(None):
        print("!!! Couldn't read frame!")
        break

    # Display the resulting frame
    cv2.imshow('frame',current_frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# release the capture
cap.release()
cv2.destroyAllWindows()

When I try to run I get back

      C:\Python27\python.exe C:/Users/brleme/PycharmProjects/opencv/main.py
not opened
!!! Couldn't read frame!
warning: Error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:545)

Process finished with exit code 0

image of the camera working in the browser image description

kind regards, Bruno