From 549ee8320a04d7f9c7b3d0838ba9b547d5c868d2 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 22 Jan 2025 14:47:31 +0800 Subject: [PATCH] =?UTF-8?q?ffprobe=20=E6=8A=A5=E9=94=99=E5=90=8E=E4=B8=8D?= =?UTF-8?q?=E9=87=87=E7=94=A8=E5=85=B6=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/api.py | 2 +- util/ffmpeg.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/util/api.py b/util/api.py index 46c698e..59206dd 100644 --- a/util/api.py +++ b/util/api.py @@ -73,7 +73,7 @@ def get_template_info(template_id): 'scenic_name': remote_template_info.get('scenicName', '景区'), 'name': remote_template_info.get('name', '模版'), 'video_size': '1920x1080', - 'frame_rate': 30, + 'frame_rate': 25, 'overall_duration': 30, 'video_parts': [ diff --git a/util/ffmpeg.py b/util/ffmpeg.py index 48edfd7..0f878d0 100644 --- a/util/ffmpeg.py +++ b/util/ffmpeg.py @@ -82,6 +82,8 @@ def probe_video_info(video_file): stderr=subprocess.STDOUT, **subprocess_args(True) ) + if result.returncode != 0: + return 0, 0, 0 all_result = result.stdout.decode('utf-8').strip() wh, duration = all_result.split('\n') width, height = wh.strip().split('x')