Optimize the code related to decoding and screenshot (#4106)

Co-authored-by: xia-chu <771730766@qq.com>
This commit is contained in:
PioLing
2025-01-19 20:18:32 +08:00
committed by GitHub
parent 83a622fa25
commit a8507d9ecc
7 changed files with 168 additions and 32 deletions

View File

@@ -2047,7 +2047,7 @@ void installWebApi() {
// 启动FFmpeg进程开始截图生成临时文件截图成功后替换为正式文件 [AUTO-TRANSLATED:7d589e3f]
// Start the FFmpeg process, start taking screenshots, generate temporary files, replace them with formal files after successful screenshots
auto new_snap_tmp = new_snap + ".tmp";
FFmpegSnap::makeSnap(allArgs["url"], new_snap_tmp, allArgs["timeout_sec"], [invoker, allArgs, new_snap, new_snap_tmp](bool success, const string &err_msg) {
FFmpegSnap::makeSnap(allArgs["async"], allArgs["url"], new_snap_tmp, allArgs["timeout_sec"], [invoker, allArgs, new_snap, new_snap_tmp](bool success, const string &err_msg) {
if (!success) {
// 生成截图失败,可能残留空文件 [AUTO-TRANSLATED:c96a4468]
// Screenshot generation failed, there may be residual empty files