From d3b37b76bd8d48a607667f57264858e7e1b3bbb6 Mon Sep 17 00:00:00 2001 From: custompal <1040801756@qq.com> Date: Fri, 15 Jul 2022 19:53:10 +0800 Subject: [PATCH] =?UTF-8?q?getMp4RecordFile=E6=8E=A5=E5=8F=A3=E5=8F=AF?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=87=AA=E5=AE=9A=E4=B9=89=E7=9A=84=E5=BD=95?= =?UTF-8?q?=E5=83=8F=E4=BF=9D=E5=AD=98=E6=A0=B9=E7=9B=AE=E5=BD=95=E6=9D=A5?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- postman/ZLMediaKit.postman_collection.json | 7 ++++++- server/WebApi.cpp | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/postman/ZLMediaKit.postman_collection.json b/postman/ZLMediaKit.postman_collection.json index 12f8fe4f..6a0ea56d 100644 --- a/postman/ZLMediaKit.postman_collection.json +++ b/postman/ZLMediaKit.postman_collection.json @@ -900,7 +900,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{ZLMediaKit_URL}}/index/api/getMp4RecordFile?secret={{ZLMediaKit_secret}}&vhost={{defaultVhost}}&app=proxy&stream=2&period=2020-05-26", + "raw": "{{ZLMediaKit_URL}}/index/api/getMp4RecordFile?secret={{ZLMediaKit_secret}}&vhost={{defaultVhost}}&app=proxy&stream=2&customized_path=/www&period=2020-05-26", "host": [ "{{ZLMediaKit_URL}}" ], @@ -930,6 +930,11 @@ "value": "2", "description": "流id,例如 test" }, + { + "key": "customized_path", + "value": "/www", + "description": "录像文件保存自定义根目录,为空则采用配置文件设置" + }, { "key": "period", "value": "2020-05-26", diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 35c8a3c6..0af223dd 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved. * * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit). @@ -1334,7 +1334,7 @@ void installWebApi() { api_regist("/index/api/getMp4RecordFile", [](API_ARGS_MAP){ CHECK_SECRET(); CHECK_ARGS("vhost", "app", "stream"); - auto record_path = Recorder::getRecordPath(Recorder::type_mp4, allArgs["vhost"], allArgs["app"],allArgs["stream"]); + auto record_path = Recorder::getRecordPath(Recorder::type_mp4, allArgs["vhost"], allArgs["app"], allArgs["stream"], allArgs["customized_path"]); auto period = allArgs["period"]; //判断是获取mp4文件列表还是获取文件夹列表