Files
ISISeg/工程分析/实现方案-2026-05-18-19-41-29.md

25 lines
836 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 实现方案
开始时间2026-05-18-19-41-29
## 修改内容
1. `scripts/generate_sample.py`
- 先用 OpenCV 生成临时 `mp4v` 视频。
- 如果系统存在 `ffmpeg`,自动转码为 `libx264``yuv420p``faststart` 的浏览器友好 MP4。
- 如果没有 `ffmpeg`,退回保留 OpenCV 输出,保证脚本仍可运行。
2. `frontend/app.js`
- 视频预览设置 `preload = "metadata"`
- 设置 `src` 后调用 `load()`
- `loadedmetadata` 后尝试跳到 `0.1s`,帮助浏览器绘制首个可见帧。
- 原始视频弹窗也复用相同逻辑。
3. 重新生成样例
- 执行 `bash scripts/generate_sample.sh`
- 使用 `ffprobe` 确认编码为 H.264。
## 说明
这次问题不是用户操作错误,而是样例视频编码格式与浏览器播放兼容性不够稳。