1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ReoLink ネットワークカメラをOpenCVで表示する

Last updated at Posted at 2025-06-18

reolink ネットワークカメラ PLC-510A

Amazonで、低価格で手に入る機種で、メーカーのアプリも使いやすく気に入ってます。

31HmQgneagL.AC_US100.jpg

openCVで画像表示

AIに「Reolink RTSP stream URL」と入力すると次の回答が出た

Reolink RTSP ストリーム URL は通常、次の形式になります
rtsp://[username]:[password]@[ip_address]:[port]/[stream_path]

具体的には、メインストリームの場合、ストリームパスは通常
h264Preview_01_main or h265Preview_01_main (for 4K cameras with H.265),

サブストリームの場合は通常
h264Preview_01_sub.

デフォルトのポートは 554 です

[内訳は次のとおりです]
rtsp:// : Specifies the Real-Time Streaming Protocol.
[username] : The username for your Reolink camera (often "admin").
[password] : The password for your Reolink camera.
[ip_address] : The IP address of your Reolink camera on your network.
[port] : The port number, usually 554.
[stream_path] : Indicates the stream type (main or sub) and potentially the encoding (e.g., h264 or h265).

[URLの例]
Main stream (H.264) : rtsp://admin:password@192.168.1.100:554/h264Preview_01_main

Sub stream (H.264) : rtsp://admin:password@192.168.1.100:554/h264Preview_01_sub

Main stream (H.265 - for 4K cameras) : rtsp://admin:password@192.168.1.100:554/h265Preview_01_main
RLC-510Aはこれを使います

[重要な注意事項]
[username]、[password]、[ip_address] を、お使いのカメラの認証情報と IP アドレスに置き換えてください。

カメラの IP アドレスは、Reolink アプリやその他のネットワーク ツールを使用して確認できます。
Reolinkアプリで確認しました

H.265 エンコードの 4K カメラをお使いの場合は、メインストリームのパスとして h265Preview_01_main を使用する必要がある場合があります。
RLC-510Aはこれを使います

VLC Media Player などのメディア プレーヤーでこれらの URL を使用してライブフィードを視聴できます。

RTSP/ONVIF がデフォルトで有効になっていない場合は、カメラの設定で有効にする必要がある可能性があります。
Reolinkアプリで、RTSP を有効にしました

pythonコード

#-===============================================================
# Reolink camera RLC-510A viwer
#
#      T.F.
#
# Ver1 2025/06/18   rtsp(Real-Time Streaming Protocol)->openCV
#
#-===============================================================
#-----------------------------------------
# import
#-----------------------------------------
import cv2

#-------------------------------------------------------------------
# rtspのURL指定でキャプチャする
# rtsp://admin:password@192.168.1.100:554/h265Preview_01_main 
#-------------------------------------------------------------------
url = 'rtsp://admin:Reolink3292@192.168.0.7:554/h265Preview_01_main'
cap = cv2.VideoCapture(url)

#-----------------------------------------
# loop
#-----------------------------------------
while(True):
    #-----------------------------------
    #
    #-----------------------------------
    ret, frame = cap.read()

    #h,w = frame.shape[:2] # 1620,2560
    #print(h,w)

    #-----------------------------------
    #
    #-----------------------------------
    frame = cv2.resize(frame, (1280, 810)) # (w,h)
    cv2.imshow('frame',frame)

    #-----------------------------------
    #
    #-----------------------------------
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

#-------------------------------------------------------------------------------
# end
#-------------------------------------------------------------------------------
cap.release()
cv2.destroyAllWindows()


表示結果

実際はビデオ表示できます

RLC-510A.png

以上です

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?