OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

HLS Video Streaming

  • Thread starter Thread starter titan digitalsoft
  • Start date Start date
T

titan digitalsoft

Guest
how to display CCTV video streaming continuously on a URL that uses HLS.

Code:
import cv2

url = 'http://103.142.224.82:8787/live/kamera_64c.m3u8'

def get_hls_frames(url):
    cap = cv2.VideoCapture(url)
    cap.set(cv2.CAP_PROP_FPS, 30)

    while True:
        ret, frame = cap.read()
        if not ret:
            print("Failed to receive frame.")
            break

        cv2.imshow('HLS Stream', frame)
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break

    cap.release()
    cv2.destroyAllWindows()

get_hls_frames(url)

this code show 6 second and stop. help me please, thanks
<p>how to display CCTV video streaming continuously on a URL that uses HLS.</p>
<pre><code>import cv2

url = 'http://103.142.224.82:8787/live/kamera_64c.m3u8'

def get_hls_frames(url):
cap = cv2.VideoCapture(url)
cap.set(cv2.CAP_PROP_FPS, 30)

while True:
ret, frame = cap.read()
if not ret:
print("Failed to receive frame.")
break

cv2.imshow('HLS Stream', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break

cap.release()
cv2.destroyAllWindows()

get_hls_frames(url)
</code></pre>
<p>this code show 6 second and stop. help me please, thanks</p>
 

Latest posts

Online statistics

Members online
0
Guests online
3
Total visitors
3
Top