有同样的问题,在阅读了大量的博客之后,我发现了一些有趣的资源:
1)这里有大量特定品牌的 rstp 已知 URL 列表。不幸的是,我的不在那儿(品牌是 kolke,如果您想知道的话……)
2)此表显示其他相机型号的不同 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?
希望能帮助到你!