OBS から視聴者のブラウザまで、このデモは Akamai のクラウドインフラ・VPU エンコーダー・エッジ配信・サーバーレス関数を組み合わせた本格的なライブ配信スタックです。すべてオープンソースと標準プロトコルで構成されています。
# AI前処理 → split → VPU hwupload → 解像度変換 [0:v]ni_quadra_ai_pre=nb=HVS_plus_1080p_L2_NR2.nb[ai]; [ai]split=5[vr0][vr1][vr2][vr3][vr4]; [vr0]ni_quadra_hwupload[hw0]; [hw0]ni_quadra_scale=1920:1080[v1080p]; [vr1]ni_quadra_hwupload[hw1]; [hw1]ni_quadra_scale=1280:720[v720p];
-xcoder-params RcEnable=1\ :hvsQPEnable=1 # 人間視覚QP :EnableRdoQuant=1 # RDO量子化 :lookAheadDepth=16 # 16f先読み :cuLevelRCEnable=0 # lookAhead時は無効
ffmpeg -re -i \ "srt://0.0.0.0:9000?mode=listener&latency=2000" \ -filter_complex "[0:v]ni_quadra_ai_pre..." \ ...
srt://<instance-ip>:9000 ?mode=caller&latency=2000
for _vname in 1080p 720p 480p 360p 240p; do upload_variant_loop "${_vname}" & UPLOADER_PIDS+=($!) done # セグメントファイルの更新検知: stat mtime + size stamp="$(stat -c '%s:%Y' "${file}")" [[ "${stamps[${rel}]:-}" != "${stamp}" ]] || return 0
curl --fail --silent \ --upload-file "1080p/20260510T_seg_00042.ts" \ "https://p-ep{ID}.mslentrypoint.net/ {STREAM_ID}/{EVENT}/1080p/seg.ts"
const hls = new Hls({ lowLatencyMode: false }); hls.loadSource(streamUrl); hls.attachMedia(video); // 手動品質選択: -1 = 自動ABR hls.currentLevel = -1;
fn handle_heartbeat(req: &Request) -> Result<Response> { let mut sessions = load_sessions(&store)?; // TTL 90s 超過セッションを削除 sessions.retain(|_, last| { now.saturating_sub(*last) < 90_000 }); sessions.insert(session_id, now); json_ok(&Resp { count: sessions.len() }) }
[component.comments-api] source = "target/wasm32-wasip1/release/comments_api.wasm" key_value_stores = ["default"]
obs_srt_direct_url = "srt://<IP>:9000?mode=listener" ssh_command = "ssh root@<IP>" instance_type = "g1-accelerated-netint-vpu-t1u1-s"
akamai purge invalidate \ --edgerc ~/.edgerc \ "https://akamai-techmeetup.isss802.top/index.html" \ "https://akamai-techmeetup.isss802.top/stream-config.json"
5 段階のビットレートラダー。HLS.js が視聴者の帯域を EWMA で推定し、リアルタイムに最適な品質を選択します。
| バリアント | 解像度 | 映像ビットレート | 音声 | GOP | 必要帯域(目安) | 相対ビットレート |
|---|---|---|---|---|---|---|
| 1080p | 1920 × 1080 | 12,000 kbps | 192 kbps | 120 | ≈ 15 Mbps | |
| 720p | 1280 × 720 | 6,000 kbps | 192 kbps | 120 | ≈ 8 Mbps | |
| 480p | 854 × 480 | 2,000 kbps | 128 kbps | 120 | ≈ 2.5 Mbps | |
| 360p | 640 × 360 | 800 kbps | 128 kbps | 120 | ≈ 1.1 Mbps | |
| 240p | 426 × 240 | 350 kbps | 96 kbps | 120 | ≈ 0.55 Mbps |