feat(events): 每个事件生成对应时间点画面截图 - oracle_db.mark_video_processed 返回 event_ids;video_processor 按事件时间戳-视频起始时间偏移跳帧截图存 ev_{id}.jpg;新增 /api/oracle/event/{id}/thumb 接口;fam-ui 事件列表每条显示对应截图
This commit is contained in:
@@ -130,6 +130,21 @@ def video_thumb(video_id):
|
||||
return send_file(path, mimetype='image/jpeg')
|
||||
|
||||
|
||||
@api_bp.route('/api/oracle/event/<int:event_id>/thumb', methods=['GET'])
|
||||
def event_thumb(event_id):
|
||||
"""返回事件对应时间点的画面截图(token 校验)。
|
||||
|
||||
由 video_processor 处理成功后按事件时间戳定位视频帧生成:
|
||||
/opt/fam-edge/thumbs/ev_{event_id}.jpg
|
||||
"""
|
||||
if not _check_token():
|
||||
return jsonify({"error": "unauthorized"}), 401
|
||||
path = f"/opt/fam-edge/thumbs/ev_{event_id}.jpg"
|
||||
if not os.path.isfile(path):
|
||||
return jsonify({"error": "thumb_not_found"}), 404
|
||||
return send_file(path, mimetype='image/jpeg')
|
||||
|
||||
|
||||
@api_bp.route('/health', methods=['GET'])
|
||||
def health():
|
||||
"""健康检查"""
|
||||
|
||||
Reference in New Issue
Block a user