From 8d6cfad6c07ad4bd054f3b3da368c2aa0660ebd6 Mon Sep 17 00:00:00 2001 From: ericwyuan Date: Sat, 22 Aug 2026 12:41:06 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20=E8=BF=90=E5=8A=A8?= =?UTF-8?q?=E7=89=87=E6=AE=B5=E5=88=86=E5=89=B2=20ffmpeg=20=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E7=BC=BA=E5=8F=AF=E6=89=A7=E8=A1=8C=E6=96=87=E4=BB=B6?= =?UTF-8?q?=20-=20args=20=E9=A6=96=E5=85=83=E7=B4=A0=E8=A1=A5=20ffmpeg=20?= =?UTF-8?q?=E8=B7=AF=E5=BE=84(=E6=AD=A4=E5=89=8D=E8=A2=AB=E5=BD=93?= =?UTF-8?q?=E6=88=90=E5=8F=AF=E6=89=A7=E8=A1=8C=E6=96=87=E4=BB=B6=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=85=A8=E9=83=A8=E5=88=86=E5=89=B2=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fam-edge/src/fam_edge/video_processor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fam-edge/src/fam_edge/video_processor.py b/fam-edge/src/fam_edge/video_processor.py index 0c8e9b0..a227598 100644 --- a/fam-edge/src/fam_edge/video_processor.py +++ b/fam-edge/src/fam_edge/video_processor.py @@ -246,9 +246,9 @@ class VideoProcessor: vmeta = None vrow = self.db.get_video_by_filename(filename) - is_motion_clip = bool(vrow and vrow.get('motion_event_id')) - camera_name = (vrow or {}).get('camera_name') or '' - event_start = (vrow or {}).get('event_start_time') or '' + is_motion_clip = bool(vrow and vrow['motion_event_id']) + camera_name = vrow['camera_name'] if vrow else '' + event_start = vrow['event_start_time'] if vrow else '' if not event_start and self.parse_start: event_start = _parse_event_start_from_filename(filename) if event_start: @@ -380,7 +380,7 @@ class VideoProcessor: 音频按配置保留(pcm_alaw -> aac 转码)或丢弃(-an)。""" import shutil ffmpeg = shutil.which('ffmpeg') or 'ffmpeg' - args = ['-y', '-hide_banner', '-loglevel', 'error', + args = [ffmpeg, '-y', '-hide_banner', '-loglevel', 'error', '-ss', f'{offset:.3f}', '-i', src_path, '-t', f'{dur:.3f}', '-c:v', 'copy'] if self.motion_keep_audio: