ffprobe 报错后不采用其内容

This commit is contained in:
2025-01-22 14:47:31 +08:00
parent 29bb80f3b9
commit 549ee8320a
2 changed files with 3 additions and 1 deletions

View File

@ -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')