【问题标题】:List RTSP streams of network camera列出网络摄像机的 RTSP 流
【发布时间】:2012-12-03 17:12:50
【问题描述】:

我刚刚购买了 Micronet SP5319 高清 IP 摄像机,文档中没有关于流路径的信息。我只找到了类似 rtsp://ip/mpeg4 但最后它不起作用。我已经尝试了许多不同的路径与许多不同的客户端,如 VLC 和 QuickTime。没有成功。

我对流进行了有线共享,它看起来像:

OPTIONS rtsp://192.168.1.90:554/h264 RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)

RTSP/1.0 200 OK
CSeq: 2
Date: Tue, Dec 04 2012 01:12:36 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER

DESCRIBE rtsp://192.168.1.90:554/h264 RTSP/1.0
CSeq: 3
User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
Accept: application/sdp

RTSP/1.0 404 Stream Not Found
CSeq: 3
Date: Tue, Dec 04 2012 01:12:36 GMT

查看最后一个响应:找不到流。最后,如何获得可用流的列表?我应该使用哪个软件?我也尝试过使用 ONVIF,但没有成功。

最好的问候,

【问题讨论】:

  • 向微网查询设备上限(参考、API、SDK 等),没有 RTSP 命令来枚举设备上的资源。

标签: video rtsp ip-camera


【解决方案1】:

有同样的问题,在阅读了大量的博客后,我发现了一些有趣的资源:

1) Here 有大量特定品牌的 rstp 已知 URL 列表。不幸的是,我的不在那儿(品牌是 kolke,如果您想知道的话……)

2)This table 显示其他相机型号的不同 URL。我尝试了其中的几个,但没有成功。用 VLC 来做这件事很费时间,因为我必须一个一个地写,所以我写了一个小的 python 脚本,用 opencv 测试它们每个并在 jupyter notebook 上运行:

import cv2

# need to know those before hand. I got IP with Nmap
usr = 'myuser'
pwd = 'mypassword'
ip = '192.168.1.1'

# I took the url patterns and also included some variations, just to be sure...
urls = [f'rtsp://{usr}:{pwd}@{ip}:554/cam/realmonitor?channel=1&subtype=0',
        f'rtsp://{ip}:554/live=2.2&username={usr}&password={pwd}',
        f'rtsp://{usr}:{pwd}@{ip}:554/1',
        f'rtsp://{usr}:{pwd}@{ip}:554/stream1',
        f'rtsp://{usr}:{pwd}@{ip}:554/Stream1',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=1&stream=0.sdp?',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=1&stream=0.sdp',
        f'rtsp://{ip}:554/videostream.asf?user={usr}&pwd={pwd}',
        f'rtsp://{ip}:554/ucast/11',
        f'rtsp://{ip}:554/11',
        f'rtsp://{ip}:554/12',
        f'rtsp://{ip}:554/live0.264',
        f'rtsp://{ip}:554/mpeg4cif',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=1&stream=0.sdp?',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=1&stream=0.sdp',
        f'rtsp://{ip}:554/live1.264',
        f'rtsp://{ip}:554/cam1/h264',
        f'rtsp://{ip}:554/mpeg4cif',
        f'rtsp://{ip}:554/ucast/11',
        f'rtsp://{ip}:554/ROH/channel/11',
        f'rtsp://{ip}:554/user={usr}_password={pwd}_channel=1_stream=0.sdp',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=1&stream=0.sdp?',
        f'rtsp://{ip}:554/user={usr}_password={pwd}_channel=1_stream=0.sdp',
        f'rtsp://{ip}:554/user={usr}_password={pwd}_channel=1_stream=0.sdp?',
        f'rtsp://{ip}:554/cam1/mpeg4?user={usr}&pwd={pwd}',
        f'rtsp://{ip}:554/h264_stream',
        f'rtsp://{ip}:554/live/ch0',
        f'rtsp://{ip}:554/live/ch1',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=1&stream=0.sdp?',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=1&stream=1.sdp?',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=0&stream=1.sdp?',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=0&stream=0.sdp?',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=1&stream=0.sdp',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=1&stream=1.sdp',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=0&stream=1.sdp',
        f'rtsp://{ip}:554/user={usr}&password={pwd}&channel=0&stream=0.sdp',
        f'rtsp://{usr}:{pwd}@{ip}:554/ucast/11',
        f'rtsp://{usr}:{pwd}@{ip}:554/11',
        f'rtsp://{usr}:{pwd}@{ip}:554/12',
        f'rtsp://{usr}:{pwd}@{ip}:554/live0.264',
        f'rtsp://{usr}:{pwd}@{ip}:554/mpeg4cif',
        f'rtsp://{usr}:{pwd}@{ip}:554/live1.264',
        f'rtsp://{usr}:{pwd}@{ip}:554/cam1/h264',
        f'rtsp://{usr}:{pwd}@{ip}:554/mpeg4cif',
        f'rtsp://{usr}:{pwd}@{ip}:554/ucast/11',
        f'rtsp://{usr}:{pwd}@{ip}:554/ROH/channel/11',
        f'rtsp://{usr}:{pwd}@{ip}:554/h264_stream',
        f'rtsp://{usr}:{pwd}@{ip}:554/live/ch0',
        f'rtsp://{usr}:{pwd}@{ip}:554/live/ch1',
       ]

def test_url(url):
    # try to open the stream
    cap = cv2.VideoCapture(url)
    ret = cap.isOpened()  # if it was succesfully opened, that's the URL you need
    cap.release()
    return ret

# then you just need to check those URLs
for url in urls:
    if test_url(url):
        print(url)

然后我得到了我一直在寻找的东西:

rtsp://192.168.1.1:554/user=myuser&password=mypassword&channel=1&stream=0.sdp?

希望对你有帮助!

【讨论】:

    【解决方案2】:

    这台相机有可能通过 SDK 工作。但您可以尝试执行以下操作:

    • 打开 Wireshark 并设置相机 IP 过滤器;
    • 打开相机的网络界面并获取视频;
    • 查看 Wireshark 会话 - 可能,有 RTSP 会话。

    http://yummy.micronet.tw/marcom/enews/071312/071312.htm - 这里我可以看到相机支持ONVIF,所以它必须支持RTSP 这里http://yummy.micronet.tw/marcom/enews/point/SP5319-catalog.pdf - 我也可以看到支持的协议 - 包括 RTSP。

    因此,如果网络界面对您没有帮助,您可以通过 ONVIF 测试工具测试您的相机,您可以在此处找到 RTSP 地址。

    请检查网络界面中的 RTSP 端口 - 真的是 554 吗?

    【讨论】:

    • 终于找到了正确的路径!这是 /master.sdp 感谢您的建议 Dmitriy。问候,
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-03-22
    • 1970-01-01
    • 2022-06-13
    • 2023-01-17
    • 2021-12-31
    • 2014-05-30
    • 1970-01-01
    相关资源
    最近更新 更多