本地视频延迟优化+视频的获取链路播放

This commit is contained in:
2026-10-13 12:40:16 +08:00
parent 9671798f29
commit e4f7cc7a90
25 changed files with 6438 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
/// 常见摄像头 RTSP 播放地址模板库(对标 IP Cam Viewer 的 brand templates)。
///
/// 大量"没有正规名字"的杂牌摄像头其实都基于同一批芯片方案
/// (雄迈/XMEye、海康、大华、全志、君正、Reolink、Amcrest、Uniview 等),
/// ONVIF 元信息经常为空,但 RTSP 路径是固定套路。
/// 只要拿到 IP,按这份顺序挨个试,大概率命中。
///
/// 说明:
/// - 空密码使用 `admin:@` 形式(libmpv/ffmpeg 均支持),比 `admin@` 更规范;
/// - 端口默认 554(RTSP 标准);个别厂商用 555/10554/8554 也可扩。
class RtspUrlGuesser {
/// 返回按"最可能命中 → 最不可能"排序的候选 URL。
///
/// [user] / [password] 为空时会自动跳过带鉴权的前缀。
static List<String> candidates({
required String ip,
required String user,
required String password,
int rtspPort = 554,
}) {
final auth = user.isEmpty
? ''
: '$user:$password@'; // 空密码 → 'admin:@',兼容大多摄像头
final base = 'rtsp://$auth$ip:$rtspPort';
return <String>[
// === 雄迈/XMEye/全志/君正 通用(市面绝大多数"没名字"的杂牌摄像头都是这批芯片) ===
'$base/onvif1',
'$base/11',
'$base/12', // 子码流
'$base/md0', // 单路 md0
'$base/md1',
'$base/0_0', // XM 双路编码
'$base/unicast',
// === 海康 Hikvision(部分老机型即使 ONVIF 不实现也能这样直连) ===
'$base/Streaming/Channels/101',
'$base/Streaming/Channels/1',
'$base/h264/ch1/main/av_stream',
'$base/MPEG4/ch1/main/av_stream',
// === 大华 Dahua ===
'$base/cam/realmonitor?channel=1&subtype=0',
// === 宇视 Uniview ===
'$base/media/video1',
'$base/unicast/c1/s1/live',
// === Reolink / Amcrest / Tendasee / 通用 ===
'$base/stream1',
'$base/video1',
'$base/live/ch00_0',
'$base/live',
'$base/1',
// === 极简兜底:根路径 ===
base,
];
}
}