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: