willytop8/Live-Environment-Streams
GitHub: willytop8/Live-Environment-Streams
一个面向AI代理优化的全球户外直播摄像头GeoJSON数据集,包含五千余路带丰富质量元数据的视频流,适用于计算机视觉、环境监测和OSINT等场景。
Stars: 0 | Forks: 0
# 实时环境直播流
一个经过精心策划且针对代理优化的全球户外实时网络摄像头直播流仓库。
最初创建用于支持 [twitch.tv/alwaysrainsomewhere](https://www.twitch.tv/alwaysrainsomewhere)。
**5,172 个直播流 · 80 个国家 · 19 个来源 · 3,027 个可直接使用**
## 数据质量
并非所有的直播流都是一样的。该模式包含了一些字段,可以准确地告诉您所获取的内容:
| 字段 | 含义 |
|-------|-------------------|
| `url_type` | URL 是直接的 HLS manifest、YouTube 链接,还是需要通过浏览器提取的 HTML 页面 |
| `coordinates_quality` | 坐标是指向实际摄像头(`exact`)、附近的某个城市(`city`),还是作为备用 fallback 的国家首都(`country_centroid`) |
| `status` | 直播流是否已被验证为可用(`active`)、尚未测试(`unverified`),或已确认失效(`deprecated`) |
| `source_url_requires` | 是否需要特殊处理:针对 HTML 页面的 `browser`、针对过期认证 token 的 `token_refresh`,或者直接访问的 `null` |
**针对 agent pipeline 的推荐查询** —— 仅获取您可以立即使用的直播流:
```
usable = [
f for f in streams
if f["properties"]["url_type"] in ("hls", "youtube")
and f["properties"]["coordinates_quality"] != "country_centroid"
and f["properties"]["source_url_requires"] is None
]
# 返回约 2,401 个包含直接 URLs 和准确坐标的 streams
```
## 使用方法
```
import json
import random
with open("streams.geojson", "r") as f:
data = json.load(f)
streams = data["features"]
selected = random.choice(streams)
props = selected["properties"]
coords = selected["geometry"]["coordinates"]
print(f"Loading {props['name']} at {coords}")
print(f"URL: {props['url']} (type: {props['url_type']})")
print(f"Environment: {props['environment']}")
print(f"Source: {props['source_family']} | Coords: {props['coordinates_quality']}")
```
按环境或质量进行过滤:
```
# 包含直接 HLS 和真实坐标的沿海 streams
coastal_hls = [
f for f in streams
if f["properties"]["environment"] == "coastal"
and f["properties"]["url_type"] == "hls"
and f["properties"]["coordinates_quality"] == "exact"
]
# 特定国家的所有 streams
us_streams = [f for f in streams if f["properties"]["country_code"] == "US"]
```
## GeoJSON 模式
`streams.geojson` 中的每个 `Feature`:
```
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-77.4875, 38.7749]
},
"properties": {
"name": "I-95 at Route 123",
"display_name": "Woodbridge",
"url": "https://example.com/stream.m3u8",
"country_code": "US",
"environment": "traffic",
"source_family": "vdot",
"quality_tier": "standard",
"scene_type": "traffic",
"url_type": "hls",
"coordinates_quality": "exact",
"status": "unverified",
"last_verified": null,
"source_url_requires": null
}
}
```
### 属性参考
| 属性 | 类型 | 描述 |
|----------|------|-------------|
| `name` | string | 描述性的摄像头名称 |
| `display_name` | string | 易读的位置标签(城市/地标) |
| `url` | string | 直播流 URL(HLS manifest、YouTube 链接或 HTML 页面) |
| `country_code` | string | ISO 3166-1 alpha-2 国家代码 |
| `environment` | string | 场景类别(见下表) |
| `source_family` | string | 数据源标识符(参见 `sources.json`) |
| `quality_tier` | string | `standard`、`unknown` 或 `low` |
| `scene_type` | string | 细粒度场景标签(交通、海滩、码头等) |
| `url_type` | string | `hls`、`youtube`、`html_page` 或 `http_image` |
| `coordinates_quality` | string | `exact`、`city` 或 `country_centroid` |
| `status` | string | `active`、`unverified` 或 `deprecated` |
| `last_verified` | string/null | 上次成功探测的 ISO 8601 时间戳 |
| `source_url_requires` | string/null | `browser`、`token_refresh` 或 `null` |
### 环境值
| 环境 | 数量 | 描述 |
|-------------|------:|-------------|
| `traffic` | 2,369 | 公路/高速公路摄像头 |
| `urban` | 1,920 | 城市和城镇景观 |
| `coastal` | 319 | 海滩和海岸 |
| `mountain` | 168 | 山区和高山 |
| `marina` | 128 | 码头和港口 |
| `waterway` | 103 | 河流和运河 |
| `lake` | 86 | 湖泊景观 |
| `nature` | 43 | 自然与野生动物 |
| `other` | 36 | 网络摄像头、港口、交通、地标 |
### URL 类型
| 类型 | 数量 | 使用方法 |
|------|------:|------------|
| `hls` | 3,003 | 直接传递给 ffmpeg 或 yt-dlp |
| `html_page` | 2,106 | 需要使用浏览器/JS 来提取流 URL |
| `http_image` | 39 | 提供 JPEG 快照的 HTTP 端点 |
| `youtube` | 24 | 使用 yt-dlp 提取 HLS manifest |
### 坐标质量
| 质量 | 数量 | 准确度 |
|---------|------:|----------|
| `exact` | 3,812 | 摄像头级别的地理编码 |
| `city` | 303 | 城市/交汇处级别(约 10km) |
| `country_centroid` | 1,057 | Fallback 至首都 —— 请勿用于地理查询 |
## 来源分布
| 来源 | 直播流数 | 类型 | 国家 |
|--------|--------:|------|-----------|
| skylinewebcams | 2,771 | 风景/旅游 | 65+ |
| vdot | 1,168 | 弗吉尼亚州交通摄像头 | US |
| mdsha | 404 | 马里兰州 SHA 交通摄像头 | US |
| autobahn_nrw | 281 | 德国高速公路 (NRW) | DE |
| deldot | 261 | 特拉华州交通摄像头 | US |
| nysdot | 91 | 纽约州交通部 | US |
| opencctv | 30 | 开放 CCTV 源 | 多国 |
| ladot | 30 | 洛杉矶交通部 | US |
| youtube | 24 | YouTube Live | 多国 |
| vegvesen | 22 | 挪威道路 | NO |
| ktict | 20 | 韩国交通 | KR |
| iticfoundation | 20 | 泰国摄像头 | TH |
| taiwan_freeway | 18 | 台湾高速公路 | TW |
| paspro | 12 | 印度尼西亚交通 | ID |
| vdotcameras | 8 | 弗吉尼亚州次要道路 | US |
| earthcam | 6 | EarthCam 网络 | 多国 |
| panama_canal | 4 | 巴拿马运河景观 | PA |
| quebec511 | 1 | 魁北克交通 | CA |
| brownrice | 1 | 日本 | JP |
每个数据源的完整元数据请参见 `sources.json`。
## 国家覆盖范围(前 20 名)
| 国家 | 直播流数 | 国家 | 直播流数 |
|---------|--------:|---------|--------:|
| US | 2,255 | GB | 43 |
| IT | 1,055 | FR | 38 |
| DE | 334 | HR | 36 |
| ES | 267 | MX | 36 |
| GR | 237 | CZ | 31 |
| NO | 91 | PE | 24 |
| BR | 78 | TW | 24 |
| CA | 63 | CH | 23 |
| MT | 60 | PH | 23 |
| TH | 53 | RO | 23 |
共计 80 个国家。
## 目录结构
```
streams.geojson # Master file (all 5,172 streams)
sources.json # Per-source metadata (license, notes, refresh method)
data/ # Per-country GeoJSON subsets (e.g. data/US.json)
scripts/
validate.py # Probe stream URLs, update status/last_verified
geocode_swc.py # Fix fallback coordinates for SWC streams
regenerate_country_files.py # Rebuild data/ from streams.geojson
stats.py # Print dataset statistics
.github/workflows/
validate.yml # Weekly automated validation
```
## 已知局限性
1. **Skyline Webcams 的 HTML 页面(2,106 个直播流):** 这些是 HTML 页面的 URL,而不是直接的流 URL。agent 需要使用浏览器或 scraper 来提取实际的 HLS manifest。已标记为 `url_type: "html_page"` 和 `source_url_requires: "browser"`。
2. **SWC Token 过期(665 个直播流):** 665 个拥有直接 `.m3u8` URL 的 SWC 直播流使用了会过期的认证 token。已标记为 `source_url_requires: "token_refresh"`。
3. **备用 Fallback 坐标(1,057 个直播流):** 这些直播流的坐标指向国家首都(罗马、纽约、马德里等),而不是实际的摄像头位置。已标记为 `coordinates_quality: "country_centroid"`。可运行 `scripts/geocode_swc.py` 进行修复。
4. **尚无实时验证:** 所有直播流启动时均为 `status: "unverified"`。GitHub Actions 工作流将逐步对它们进行验证。
## 贡献
如需添加新数据源:
1. 按照上述模式将直播流添加到 `streams.geojson` 中 —— 所有新增字段均为必填项。
2. 将数据源的元数据添加到 `sources.json` 中。
3. 运行 `python scripts/regenerate_country_files.py` 以更新 `data/` 目录。
4. 运行 `python scripts/stats.py` 以验证计数。
5. 使用新的总数更新本 README。
#dataset #computer-vision #live-weather #machine-learning #webcams
#hls-streams #geojson #environment-monitoring
#traffic-cameras #ai-agents #geospatial
标签:Agent优化, AI模型, ESC4, GeoJSON, HLS, OSINT, Python, RTSP, YouTube, 全球监控, 公共数据, 地理坐标, 地理空间数据, 天气监测, 实时视频流, 户外监控, 摄像头定位, 数据清洗, 无后门, 环境监测, 网络摄像头, 视频处理, 视频流提取, 计算机视觉, 逆向工具