Fixing some filter paralleism

This commit is contained in:
2026-05-12 08:04:45 +02:00
parent 994a2e0bb6
commit 409d7790c0
6 changed files with 92 additions and 18 deletions
+15 -4
View File
@@ -197,6 +197,7 @@ def _resolve_video_path(
video_source: VideoSource,
shared_assets_dir: Path = None,
project_path: Path = None,
process_cache_dir: Path = None,
) -> Path:
"""Resolve the actual video file path (output_file if exists, else source_file).
@@ -205,6 +206,7 @@ def _resolve_video_path(
If video_source.is_shared is True, looks in shared_assets_dir instead of videos_dir.
Uses gnommocache fallback if configured and project_path is provided.
When process_cache_dir is set, also checks {cache}/videos/ for the file.
"""
from .cache import resolve_with_cache
@@ -233,6 +235,12 @@ def _resolve_video_path(
elif webm_path.exists():
return webm_path
# Check process_cache_dir before falling back to source_file in project
if process_cache_dir and not video_source.is_shared:
cache_path = process_cache_dir / "videos" / video_source.source_file
if cache_path.exists():
return cache_path
# Fall back to source_file with cache fallback
source_path = base_dir / video_source.source_file
if project_path:
@@ -310,6 +318,9 @@ def build_ffmpeg_command(plan: RenderPlan, output_path: Path) -> list[str]:
shared_assets_dir = (
plan.shared_assets_dir.resolve() if plan.shared_assets_dir else None
)
process_cache_dir = (
plan.process_cache_dir.resolve() if plan.process_cache_dir else None
)
# Track input indices
input_idx = 0
@@ -319,7 +330,7 @@ def build_ffmpeg_command(plan: RenderPlan, output_path: Path) -> list[str]:
always_visible_inputs: list[int] = []
for video_id, video_source, cutout in plan.narration_videos:
video_path = _resolve_video_path(
videos_dir, video_source, shared_assets_dir, project_path
videos_dir, video_source, shared_assets_dir, project_path, process_cache_dir
)
# Combine video skip setting with partial render offset
total_seek = video_source.skip + plan.input_seek_time
@@ -393,7 +404,7 @@ def build_ffmpeg_command(plan: RenderPlan, output_path: Path) -> list[str]:
for i, event in enumerate(plan.video_events):
video_path = _resolve_video_path(
videos_dir, event.video_source, shared_assets_dir, project_path
videos_dir, event.video_source, shared_assets_dir, project_path, process_cache_dir
)
skip = event.video_source.skip or 0.0
if skip > 0:
@@ -423,7 +434,7 @@ def build_ffmpeg_command(plan: RenderPlan, output_path: Path) -> list[str]:
for i, event in enumerate(plan.outro_events):
video_path = _resolve_video_path(
videos_dir, event.video_source, shared_assets_dir, project_path
videos_dir, event.video_source, shared_assets_dir, project_path, process_cache_dir
)
skip = event.video_source.skip or 0.0
if skip > 0:
@@ -1103,7 +1114,7 @@ def build_filter_complex(
use_channels = first_video_source.use_audio_channels
if use_channels == "auto":
narration_path = _resolve_video_path(
videos_dir, first_video_source, shared_assets_dir, project_path
videos_dir, first_video_source, shared_assets_dir, project_path, process_cache_dir
)
use_channels = _resolve_auto_channel(narration_path)
channel_filter = _build_audio_channel_filter(use_channels)