create: V380Pro 电脑端架构:本机 Python 转封装 + 浏览器 MSE 播放
MemRelay-Operation: memory-save:v380-architecture-decision-2026-11-13-0216 MemRelay-Resource: 84ada2bf-2a3a-41cd-aad2-ee5b38ec483f
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
---
|
||||
title: V380Pro 电脑端架构:本机 Python 转封装 + 浏览器 MSE 播放
|
||||
type: decision
|
||||
permalink: main/projects/9b6e62e6-fd85-4580-a304-bbb9761075c7/v380-pro-电脑端架构本机-python-转封装-浏览器-mse-播放
|
||||
stable_id: 84ada2bf-2a3a-41cd-aad2-ee5b38ec483f
|
||||
scope: project
|
||||
memory_type: decision
|
||||
project_id: 9b6e62e6-fd85-4580-a304-bbb9761075c7
|
||||
usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998
|
||||
status: active
|
||||
revision: 1
|
||||
request_id: v380-architecture-decision-2026-11-13-0216
|
||||
created_at: '2026-11-12T18:14:48.872305+00:00'
|
||||
updated_at: '2026-11-12T18:14:48.872305+00:00'
|
||||
tags:
|
||||
- v380
|
||||
- architecture
|
||||
---
|
||||
|
||||
决定:只做云历史录像(用户主要看历史,实时功能已移除)。Python 后端(server.py,ThreadingHTTPServer 127.0.0.1:8765)+ Vue 3/TS 前端(frontend/dist 由同一端口提供),start.ps1 先编译前端再启动。
|
||||
|
||||
原因与关键实现:
|
||||
- 登录优先通过 adb root 读手机 App 的凭据共用(密码登录会踢掉手机),凭据保存在 data/session.json(不提交)。
|
||||
- hsc/clip_mux.py 用 PyAV 把 H.264 原样复制、ADPCM 转 AAC 16kHz,写成分片 MP4;movflags empty_moov+default_base_moof+frag_discont+skip_trailer、avoid_negative_ts=disabled、use_editlist=0,否则轨道起点会被归零。
|
||||
- hsc/clip_store.py:一段从头下载时多个读者共用,收完写 data/cache/{device}-{record}.mp4 缓存(上限 4GB);拖到未加载处用服务端跳转直接从那里流。
|
||||
- 前端 frontend/src/clipPlayer.ts 用 MSE 边收边播,X-Media-Type 头带 codecs;播完自动接下一段并预取下一段。
|
||||
- 下载/合并:hsc/exporter.py 先确保缓存,再用 ffmpeg -c copy 无损整理;合并用 concat demuxer,多段不合并时打 ZIP。ffmpeg 查找顺序 V380_FFMPEG → PATH → E:\code\RapDrama\tools\ffmpeg\ffmpeg.exe。
|
||||
- .venv 没有 pip,装包用 uv pip --python .venv\Scripts\python.exe。
|
||||
Reference in New Issue
Block a user