✨ Add privacy-safe face blur diagnostics

This commit is contained in:
eust-w 2026-09-01 05:35:18 +08:00
parent f9e719ff87
commit bc9db2b8d2
7 changed files with 257 additions and 7 deletions

View File

@ -338,6 +338,8 @@ def _process_video_stream(
require_pts: bool,
ffmpeg_preset: str,
crf: int,
diagnostic_dir: pathlib.Path,
diagnostic_frame_limit: int,
helpers: HelperMap,
) -> dict[str, Any]:
import cv2
@ -373,6 +375,11 @@ def _process_video_stream(
frames_with_detection = 0
frames_with_carry = 0
tracks: list[dict[str, Any]] = []
diagnostic_frames: list[dict[str, Any]] = []
estimated_frame_count = max(0, int(cap.get(cv2.CAP_PROP_FRAME_COUNT) or 0))
diagnostic_min_gap = max(1, estimated_frame_count // max(1, diagnostic_frame_limit))
last_diagnostic_index = -diagnostic_min_gap
diagnostic_dir.mkdir(parents=True, exist_ok=True)
try:
while True:
@ -391,6 +398,39 @@ def _process_video_stream(
boxes_blurred_count += len(faces)
blurred_frame = _apply_blur(frame, faces, blur_type, kernel_size)
out.write(blurred_frame)
frame_index = frames_processed
if (
faces
and len(diagnostic_frames) < diagnostic_frame_limit
and frame_index - last_diagnostic_index >= diagnostic_min_gap
):
preview = blurred_frame.copy()
for x, y, w, h in faces:
cv2.rectangle(preview, (x, y), (x + w, y + h), (0, 220, 120), 2)
cv2.putText(
preview,
f"frame={frame_index} faces={len(faces)}",
(12, 28),
cv2.FONT_HERSHEY_SIMPLEX,
0.7,
(0, 220, 120),
2,
cv2.LINE_AA,
)
diagnostic_path = diagnostic_dir / f"diagnostic-frame-{frame_index:06d}.jpg"
if not cv2.imwrite(str(diagnostic_path), preview):
raise RuntimeError(f"无法写入人脸脱敏诊断帧: {diagnostic_path}")
diagnostic_frames.append(
{
"filename": diagnostic_path.name,
"path": str(diagnostic_path),
"frameIndex": frame_index,
"relativeTimeSeconds": round(frame_index / max(fps, 0.001), 6),
"boxCount": len(faces),
"sha256": _sha256(diagnostic_path),
}
)
last_diagnostic_index = frame_index
frames_processed += 1
finally:
cap.release()
@ -484,6 +524,7 @@ def _process_video_stream(
"height": height,
"frameRate": round(fps, 3),
"videoBytes": dest_video_path.stat().st_size if dest_video_path.exists() else 0,
"diagnosticFrames": diagnostic_frames,
**av_metrics,
}
@ -518,6 +559,7 @@ def _run_legacy(
model_sha256 = str(params.get("MODEL_SHA256", YUNET_MODEL_SHA256)).strip().lower()
nms_threshold = helpers["parse_unit_interval_param"](params, "NMS_THRESHOLD", 0.3)
top_k = helpers["parse_positive_int_param"](params, "TOP_K", 5000)
diagnostic_frame_limit = min(24, helpers["parse_positive_int_param"](params, "DIAGNOSTIC_FRAME_LIMIT", 12))
detector, active_method, detector_provenance = _load_face_detector(
detection_method, confidence, model_path, model_sha256, nms_threshold, top_k
@ -527,6 +569,7 @@ def _run_legacy(
payload = helpers["first_payload_with_keys"](inputs, "items")
output_blurred_dir = output_dir / "blurred"
output_blurred_dir.mkdir(parents=True, exist_ok=True)
output_diagnostics_dir = output_dir / "face-blur-diagnostics"
archive_sources = (
payload.get("archiveSources", {})
if isinstance(payload, dict) and isinstance(payload.get("archiveSources"), dict)
@ -591,6 +634,8 @@ def _run_legacy(
require_pts=require_pts,
ffmpeg_preset=ffmpeg_preset,
crf=crf,
diagnostic_dir=output_diagnostics_dir / pathlib.Path(dest_filename).stem,
diagnostic_frame_limit=diagnostic_frame_limit,
helpers=helpers,
)
if require_detections and metrics["facesDetectedCount"] <= 0:
@ -646,6 +691,9 @@ def _run_legacy(
artifacts.extend(
helpers["collect_output_artifacts"](run_id, node_id, output_blurred_dir, node_data=node_data, output=binding)
)
artifacts.extend(
helpers["collect_output_artifacts"](run_id, node_id, output_diagnostics_dir, node_data=node_data)
)
return artifacts
# Direct single-video processing fallback
@ -682,6 +730,8 @@ def _run_legacy(
require_pts=require_pts,
ffmpeg_preset=ffmpeg_preset,
crf=crf,
diagnostic_dir=output_diagnostics_dir / pathlib.Path(dest_filename).stem,
diagnostic_frame_limit=diagnostic_frame_limit,
helpers=helpers,
)
if require_detections and metrics["facesDetectedCount"] <= 0:
@ -722,6 +772,9 @@ def _run_legacy(
artifacts.extend(
helpers["collect_output_artifacts"](run_id, node_id, output_blurred_dir, node_data=node_data, output=binding)
)
artifacts.extend(
helpers["collect_output_artifacts"](run_id, node_id, output_diagnostics_dir, node_data=node_data)
)
return artifacts
@ -802,13 +855,29 @@ def _run_multiport(
except Exception:
manifest = {}
video_binding = _output(node_data, helpers, "blurredVideos")
diagnostic_binding = _output(node_data, helpers, "diagnosticFrames")
output: list[dict[str, Any]] = []
processed_by_name = {
str(item.get("sanitizedFilename") or item.get("filename") or ""): item
for item in manifest.get("items", []) if isinstance(item, dict)
} if isinstance(manifest, dict) else {}
for artifact in legacy_artifacts:
suffix = pathlib.PurePosixPath(str(artifact.get("name", ""))).suffix.lower()
if not _is_video_artifact(artifact) and suffix not in {".jpg", ".jpeg", ".png", ".webp"}:
continue
if not _is_video_artifact(artifact):
if diagnostic_binding is not None:
artifact["portId"] = str(diagnostic_binding.get("id", ""))
artifact["portName"] = str(diagnostic_binding.get("name", ""))
else:
artifact["portId"] = ""
artifact["portName"] = ""
artifact["data"] = {
"schemaVersion": "droboticflow.video-face-anonymization-diagnostic/v1",
"privacySafe": True,
"description": "仅包含已脱敏画面与检测框,不保留原始人脸像素",
}
output.append(artifact)
continue
if video_binding is not None:
artifact["portId"] = str(video_binding.get("id", ""))
@ -839,6 +908,16 @@ def _run_multiport(
"totalBoxesBlurred": sum(int((item.get("faceBlurMetrics") or {}).get("boxesBlurredCount", 0) or 0) for item in manifest.get("items", []) if isinstance(item, dict)),
"framesWithDetection": sum(int((item.get("faceBlurMetrics") or {}).get("framesWithDetection", 0) or 0) for item in manifest.get("items", []) if isinstance(item, dict)),
"framesWithCarry": sum(int((item.get("faceBlurMetrics") or {}).get("framesWithCarry", 0) or 0) for item in manifest.get("items", []) if isinstance(item, dict)),
"diagnosticFrames": [
{
"collectionId": str(item.get("collectionId", "")),
"video": str(item.get("sanitizedFilename") or item.get("filename") or ""),
**frame,
}
for item in manifest.get("items", []) if isinstance(item, dict)
for frame in ((item.get("faceBlurMetrics") or {}).get("diagnosticFrames") or [])
if isinstance(frame, dict)
],
}
output.append(helpers["write_json_artifact"](run_id, node_id, output_dir, "face-blur-summary.json", summary, output=_output(node_data, helpers, "detectionSummary")))
return output

View File

@ -12030,6 +12030,12 @@
"key": "REQUIRE_DETECTIONS",
"type": "boolean",
"value": "false"
},
{
"description": "最多输出多少张已脱敏且带检测框的质检诊断帧",
"key": "DIAGNOSTIC_FRAME_LIMIT",
"type": "integer",
"value": "12"
}
],
"id": "operator-builtin-video-face-blur",
@ -12089,6 +12095,16 @@
"role": "summary",
"transmission": "bus",
"type": "json"
},
{
"container": "collection",
"description": "已脱敏并叠加检测框的质检诊断帧;不保留原始人脸像素",
"id": "diagnosticFrames",
"name": "diagnosticFrames",
"payloadMode": "ref",
"role": "evidence",
"transmission": "oss",
"type": "image"
}
],
"publicationStatus": "published",

View File

@ -339,10 +339,42 @@ func (server *server) ensureFanyuDeliveryTemplateV58(ctx context.Context, organi
node := &nodes[index]
switch node.ID {
case "fanyu-v56-left-blur", "fanyu-v56-right-blur":
// Audio and audio PTS are explicitly outside the v5.8 contract. The
// inherited face-blur snapshot required an audio stream even though no
// audio edge exists, so keep both stereo branches video-only.
node.Data.Hyperparams = fanyuUpsertHyperparam(node.Data.Hyperparams, "PRESERVE_AUDIO", "false")
operator, operatorErr := server.store.GetOperator(ctx, "operator-builtin-video-face-blur")
if operatorErr != nil {
return operatorErr
}
if operator == nil {
return fmt.Errorf("fanyu v5.8 template requires face anonymization operator")
}
refreshed := fanyuMultiportNodeWithHyperparams(
node.ID,
node.Data.Label,
*operator,
node.Position.X,
node.Position.Y,
map[string]string{
"DETECTION_METHOD": "yunet",
"MODEL_PATH": "/app/operator-repos/builtin/video_face_blur/assets/face_detection_yunet_2023mar.onnx",
"MODEL_SHA256": "8f2383e4dd3cfbb4553ea8718107fc0423210dc964f9f4280604804ed2552fa4",
"CONFIDENCE_THRESHOLD": "0.5",
"NMS_THRESHOLD": "0.3",
"TOP_K": "5000",
"BLUR_TYPE": "mosaic",
"BLUR_EXPANSION_RATIO": "1.35",
"TRACK_HOLD_FRAMES": "4",
"TRACK_IOU_THRESHOLD": "0.2",
"PRESERVE_AUDIO": "false",
"PRESERVE_PTS": "true",
"REQUIRE_PTS": "true",
"REQUIRE_DETECTIONS": "true",
"DIAGNOSTIC_FRAME_LIMIT": "12",
"PIN_OPERATOR_IMAGE": "true",
},
)
refreshed.Data.Description = "逐帧执行 fail-closed 人脸脱敏,并输出已脱敏检测框诊断帧与结构化报告供质检定位;不保留原始人脸像素。"
fanyuRetainInputPorts(&refreshed, "videos", "timestamps")
fanyuRetainOutputPorts(&refreshed, "blurredVideos", "detectionSummary", "diagnosticFrames")
*node = refreshed
case "fanyu-v56-rough-cut":
operator, operatorErr := server.store.GetOperator(ctx, "operator-builtin-qwen-behavior-rough-cut")
if operatorErr != nil {

View File

@ -637,6 +637,22 @@ func TestEnsureFanyuDeliveryTemplateV56BuildsStereoCropAndPoseTopology(t *testin
if v58LeftBlur == nil || v58RightBlur == nil || fanyuTestHyperparam(v58LeftBlur, "PRESERVE_AUDIO") != "false" || fanyuTestHyperparam(v58RightBlur, "PRESERVE_AUDIO") != "false" {
t.Fatalf("v5.8 face blur must not require or preserve audio: left=%#v right=%#v", v58LeftBlur, v58RightBlur)
}
for _, blurNode := range []*domain.WorkflowNode{v58LeftBlur, v58RightBlur} {
if fanyuTestHyperparam(blurNode, "DIAGNOSTIC_FRAME_LIMIT") != "12" || fanyuTestHyperparam(blurNode, "PIN_OPERATOR_IMAGE") != "true" {
t.Fatalf("v5.8 face blur must emit pinned privacy-safe diagnostics: %#v", blurNode.Data.Hyperparams)
}
requiredOutputs := map[string]bool{"blurredVideos": false, "detectionSummary": false, "diagnosticFrames": false}
for _, output := range blurNode.Data.Outputs {
if _, required := requiredOutputs[output.ID]; required {
requiredOutputs[output.ID] = true
}
}
for outputID, found := range requiredOutputs {
if !found {
t.Fatalf("v5.8 face blur missing %s output: %#v", outputID, blurNode.Data.Outputs)
}
}
}
requiredV58Edges := map[string]bool{"handposeAcceptance": false, "qwenWindows": false, "acceptedDirectory": false, "acceptanceSummary": false, "calibrations": false, "headposePackage": false, "handposePackage": false}
for _, edge := range v58.Edges {
if edge.Source == "fanyu-v56-handpose" && edge.SourceHandle == "out-1" && edge.Target == "fanyu-v56-human" && edge.TargetHandle == "handposeEvidence" {

View File

@ -338,6 +338,8 @@ def _process_video_stream(
require_pts: bool,
ffmpeg_preset: str,
crf: int,
diagnostic_dir: pathlib.Path,
diagnostic_frame_limit: int,
helpers: HelperMap,
) -> dict[str, Any]:
import cv2
@ -373,6 +375,11 @@ def _process_video_stream(
frames_with_detection = 0
frames_with_carry = 0
tracks: list[dict[str, Any]] = []
diagnostic_frames: list[dict[str, Any]] = []
estimated_frame_count = max(0, int(cap.get(cv2.CAP_PROP_FRAME_COUNT) or 0))
diagnostic_min_gap = max(1, estimated_frame_count // max(1, diagnostic_frame_limit))
last_diagnostic_index = -diagnostic_min_gap
diagnostic_dir.mkdir(parents=True, exist_ok=True)
try:
while True:
@ -391,6 +398,39 @@ def _process_video_stream(
boxes_blurred_count += len(faces)
blurred_frame = _apply_blur(frame, faces, blur_type, kernel_size)
out.write(blurred_frame)
frame_index = frames_processed
if (
faces
and len(diagnostic_frames) < diagnostic_frame_limit
and frame_index - last_diagnostic_index >= diagnostic_min_gap
):
preview = blurred_frame.copy()
for x, y, w, h in faces:
cv2.rectangle(preview, (x, y), (x + w, y + h), (0, 220, 120), 2)
cv2.putText(
preview,
f"frame={frame_index} faces={len(faces)}",
(12, 28),
cv2.FONT_HERSHEY_SIMPLEX,
0.7,
(0, 220, 120),
2,
cv2.LINE_AA,
)
diagnostic_path = diagnostic_dir / f"diagnostic-frame-{frame_index:06d}.jpg"
if not cv2.imwrite(str(diagnostic_path), preview):
raise RuntimeError(f"无法写入人脸脱敏诊断帧: {diagnostic_path}")
diagnostic_frames.append(
{
"filename": diagnostic_path.name,
"path": str(diagnostic_path),
"frameIndex": frame_index,
"relativeTimeSeconds": round(frame_index / max(fps, 0.001), 6),
"boxCount": len(faces),
"sha256": _sha256(diagnostic_path),
}
)
last_diagnostic_index = frame_index
frames_processed += 1
finally:
cap.release()
@ -484,6 +524,7 @@ def _process_video_stream(
"height": height,
"frameRate": round(fps, 3),
"videoBytes": dest_video_path.stat().st_size if dest_video_path.exists() else 0,
"diagnosticFrames": diagnostic_frames,
**av_metrics,
}
@ -518,6 +559,7 @@ def _run_legacy(
model_sha256 = str(params.get("MODEL_SHA256", YUNET_MODEL_SHA256)).strip().lower()
nms_threshold = helpers["parse_unit_interval_param"](params, "NMS_THRESHOLD", 0.3)
top_k = helpers["parse_positive_int_param"](params, "TOP_K", 5000)
diagnostic_frame_limit = min(24, helpers["parse_positive_int_param"](params, "DIAGNOSTIC_FRAME_LIMIT", 12))
detector, active_method, detector_provenance = _load_face_detector(
detection_method, confidence, model_path, model_sha256, nms_threshold, top_k
@ -527,6 +569,7 @@ def _run_legacy(
payload = helpers["first_payload_with_keys"](inputs, "items")
output_blurred_dir = output_dir / "blurred"
output_blurred_dir.mkdir(parents=True, exist_ok=True)
output_diagnostics_dir = output_dir / "face-blur-diagnostics"
archive_sources = (
payload.get("archiveSources", {})
if isinstance(payload, dict) and isinstance(payload.get("archiveSources"), dict)
@ -591,6 +634,8 @@ def _run_legacy(
require_pts=require_pts,
ffmpeg_preset=ffmpeg_preset,
crf=crf,
diagnostic_dir=output_diagnostics_dir / pathlib.Path(dest_filename).stem,
diagnostic_frame_limit=diagnostic_frame_limit,
helpers=helpers,
)
if require_detections and metrics["facesDetectedCount"] <= 0:
@ -646,6 +691,9 @@ def _run_legacy(
artifacts.extend(
helpers["collect_output_artifacts"](run_id, node_id, output_blurred_dir, node_data=node_data, output=binding)
)
artifacts.extend(
helpers["collect_output_artifacts"](run_id, node_id, output_diagnostics_dir, node_data=node_data)
)
return artifacts
# Direct single-video processing fallback
@ -682,6 +730,8 @@ def _run_legacy(
require_pts=require_pts,
ffmpeg_preset=ffmpeg_preset,
crf=crf,
diagnostic_dir=output_diagnostics_dir / pathlib.Path(dest_filename).stem,
diagnostic_frame_limit=diagnostic_frame_limit,
helpers=helpers,
)
if require_detections and metrics["facesDetectedCount"] <= 0:
@ -722,6 +772,9 @@ def _run_legacy(
artifacts.extend(
helpers["collect_output_artifacts"](run_id, node_id, output_blurred_dir, node_data=node_data, output=binding)
)
artifacts.extend(
helpers["collect_output_artifacts"](run_id, node_id, output_diagnostics_dir, node_data=node_data)
)
return artifacts
@ -802,13 +855,29 @@ def _run_multiport(
except Exception:
manifest = {}
video_binding = _output(node_data, helpers, "blurredVideos")
diagnostic_binding = _output(node_data, helpers, "diagnosticFrames")
output: list[dict[str, Any]] = []
processed_by_name = {
str(item.get("sanitizedFilename") or item.get("filename") or ""): item
for item in manifest.get("items", []) if isinstance(item, dict)
} if isinstance(manifest, dict) else {}
for artifact in legacy_artifacts:
suffix = pathlib.PurePosixPath(str(artifact.get("name", ""))).suffix.lower()
if not _is_video_artifact(artifact) and suffix not in {".jpg", ".jpeg", ".png", ".webp"}:
continue
if not _is_video_artifact(artifact):
if diagnostic_binding is not None:
artifact["portId"] = str(diagnostic_binding.get("id", ""))
artifact["portName"] = str(diagnostic_binding.get("name", ""))
else:
artifact["portId"] = ""
artifact["portName"] = ""
artifact["data"] = {
"schemaVersion": "droboticflow.video-face-anonymization-diagnostic/v1",
"privacySafe": True,
"description": "仅包含已脱敏画面与检测框,不保留原始人脸像素",
}
output.append(artifact)
continue
if video_binding is not None:
artifact["portId"] = str(video_binding.get("id", ""))
@ -839,6 +908,16 @@ def _run_multiport(
"totalBoxesBlurred": sum(int((item.get("faceBlurMetrics") or {}).get("boxesBlurredCount", 0) or 0) for item in manifest.get("items", []) if isinstance(item, dict)),
"framesWithDetection": sum(int((item.get("faceBlurMetrics") or {}).get("framesWithDetection", 0) or 0) for item in manifest.get("items", []) if isinstance(item, dict)),
"framesWithCarry": sum(int((item.get("faceBlurMetrics") or {}).get("framesWithCarry", 0) or 0) for item in manifest.get("items", []) if isinstance(item, dict)),
"diagnosticFrames": [
{
"collectionId": str(item.get("collectionId", "")),
"video": str(item.get("sanitizedFilename") or item.get("filename") or ""),
**frame,
}
for item in manifest.get("items", []) if isinstance(item, dict)
for frame in ((item.get("faceBlurMetrics") or {}).get("diagnosticFrames") or [])
if isinstance(frame, dict)
],
}
output.append(helpers["write_json_artifact"](run_id, node_id, output_dir, "face-blur-summary.json", summary, output=_output(node_data, helpers, "detectionSummary")))
return output

View File

@ -212,7 +212,11 @@ def test_orbbec_normalizer_multiport_binds_camera_and_pts_outputs(tmp_path):
def test_face_blur_multiport_rebinds_videos_and_summary(tmp_path):
outputs = [{"id": "blurredVideos", "name": "blurredVideos"}, {"id": "detectionSummary", "name": "detectionSummary"}]
outputs = [
{"id": "blurredVideos", "name": "blurredVideos"},
{"id": "detectionSummary", "name": "detectionSummary"},
{"id": "diagnosticFrames", "name": "diagnosticFrames"},
]
def output_binding(_node_data, index=0, name=""):
return next((item for item in outputs if item["id"] == name or item["name"] == name), outputs[index])
@ -228,10 +232,24 @@ def test_face_blur_multiport_rebinds_videos_and_summary(tmp_path):
video_path = Path(output_dir) / "blurred" / "blurred_left.mp4"
video_path.parent.mkdir(parents=True, exist_ok=True)
video_path.write_bytes(b"video")
(Path(output_dir) / "blurred-manifest.json").write_text(json.dumps({"itemCount": 1, "totalFramesProcessed": 4, "totalFacesDetected": 2, "method": {"detectionMethod": "haar", "preservePts": True}}), encoding="utf-8")
diagnostic_path = Path(output_dir) / "face-blur-diagnostics" / "left" / "diagnostic-frame-000001.jpg"
diagnostic_path.parent.mkdir(parents=True, exist_ok=True)
diagnostic_path.write_bytes(b"diagnostic")
(Path(output_dir) / "blurred-manifest.json").write_text(json.dumps({
"itemCount": 1,
"totalFramesProcessed": 4,
"totalFacesDetected": 2,
"method": {"detectionMethod": "haar", "preservePts": True},
"items": [{
"collectionId": "left",
"sanitizedFilename": "blurred_left.mp4",
"faceBlurMetrics": {"diagnosticFrames": [{"path": str(diagnostic_path), "frameIndex": 1}]},
}],
}), encoding="utf-8")
return [
{"name": "blurred-manifest.json", "path": str(Path(output_dir) / "blurred-manifest.json"), "type": "json", "portId": "out-1"},
{"name": "blurred_left.mp4", "path": str(video_path), "type": "video", "portId": "out-1"},
{"name": diagnostic_path.name, "path": str(diagnostic_path), "type": "image", "portId": "out-1"},
]
blur_operator._run_legacy = fake_legacy
@ -246,8 +264,10 @@ def test_face_blur_multiport_rebinds_videos_and_summary(tmp_path):
)
finally:
blur_operator._run_legacy = original
assert [item["portId"] for item in artifacts] == ["blurredVideos", "detectionSummary"]
assert [item["portId"] for item in artifacts] == ["blurredVideos", "diagnosticFrames", "detectionSummary"]
assert artifacts[1]["data"]["privacySafe"] is True
assert artifacts[-1]["data"]["totalFacesDetected"] == 2
assert artifacts[-1]["data"]["diagnosticFrames"][0]["frameIndex"] == 1
def test_qwen_multiport_rebinds_clips_prelabels_boundaries_and_summary(tmp_path):

View File

@ -117,6 +117,8 @@ class VideoFaceBlurRealTest(unittest.TestCase):
True,
"veryfast",
18,
root / "diagnostics",
3,
{
"ffmpeg_available": lambda: True,
"inspect_video_file": lambda path: {
@ -131,6 +133,11 @@ class VideoFaceBlurRealTest(unittest.TestCase):
self.assertEqual(metrics["ptsRowsVerified"], 5)
self.assertEqual(metrics["framesWithDetection"], 5)
self.assertEqual(metrics["boxesBlurredCount"], 5)
self.assertGreaterEqual(len(metrics["diagnosticFrames"]), 1)
self.assertLessEqual(len(metrics["diagnosticFrames"]), 3)
for diagnostic in metrics["diagnosticFrames"]:
self.assertTrue(pathlib.Path(diagnostic["path"]).is_file())
self.assertEqual(len(diagnostic["sha256"]), 64)
@unittest.skipUnless(shutil.which("ffmpeg") and shutil.which("ffprobe"), "FFmpeg tools are required")
def test_independent_audio_is_trimmed_to_video_with_bounded_drift(self):
@ -163,6 +170,7 @@ class VideoFaceBlurRealTest(unittest.TestCase):
metrics = operator._process_video_stream(
source, destination, audio, pts, object(), "yunet", 0.5, "mosaic", 51,
1.0, 2, 0.2, True, True, True, "veryfast", 18,
root / "diagnostics", 4,
{
"ffmpeg_available": lambda: True,
"inspect_video_file": lambda path: {