debug: add logging for pause-insert video rendering
Logs pause point placements, segment creation, and final segment calculation to help diagnose the 30s black footage issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
54638d1065
commit
dd7ac2e15c
1 changed files with 23 additions and 0 deletions
|
|
@ -280,6 +280,16 @@ class VideoRendererService:
|
|||
key=lambda p: p["pause_point"]
|
||||
)
|
||||
|
||||
# Debug logging for pause points
|
||||
logger.info(f"Pause-insert: {len(sorted_placements)} placements with pause points")
|
||||
for i, p in enumerate(sorted_placements):
|
||||
logger.info(
|
||||
f" Placement {i}: cue_index={p.get('ad_cue_index')}, "
|
||||
f"pause_point={p.get('pause_point'):.2f}s, "
|
||||
f"ad_duration={p.get('ad_duration'):.2f}s, "
|
||||
f"consolidated={p.get('consolidated_with_previous', False)}"
|
||||
)
|
||||
|
||||
if not sorted_placements:
|
||||
logger.warning("No pause points found, copying source video")
|
||||
await self._copy_video(source_video_path, output_path)
|
||||
|
|
@ -344,6 +354,11 @@ class VideoRendererService:
|
|||
|
||||
# 4. Add final segment from last pause point to end (re-encoded for uniformity)
|
||||
source_duration = await self._get_video_duration(source_video_path)
|
||||
logger.info(
|
||||
f"Final segment check: current_time={current_time:.2f}s, "
|
||||
f"source_duration={source_duration:.2f}s, "
|
||||
f"remaining={source_duration - current_time:.2f}s"
|
||||
)
|
||||
if current_time < source_duration:
|
||||
final_segment_path = temp_dir_path / "segment_final.mp4"
|
||||
await self._extract_segment_reencoded(
|
||||
|
|
@ -354,6 +369,14 @@ class VideoRendererService:
|
|||
video_props
|
||||
)
|
||||
segment_files.append(str(final_segment_path))
|
||||
logger.info(f"Added final segment: {current_time:.2f}s to {source_duration:.2f}s")
|
||||
else:
|
||||
logger.info("No final segment needed (current_time >= source_duration)")
|
||||
|
||||
# Debug: Log all segments before concatenation
|
||||
logger.info(f"Total segments to concatenate: {len(segment_files)}")
|
||||
for idx, seg in enumerate(segment_files):
|
||||
logger.info(f" Segment {idx}: {seg}")
|
||||
|
||||
# 5. Concatenate all segments
|
||||
if segment_files:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue