MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / concat_videos

Function concat_videos

functions/function_calling/video.py:60–83  ·  view source on GitHub ↗
(video_paths: list[Path])

Source from the content-addressed store, hash-verified

58 return target_path
59
60def concat_videos(video_paths: list[Path]) -> Path:
61 if not video_paths:
62 raise ValueError("No video files to concatenate")
63
64 video_paths = [Path(p).resolve() for p in video_paths]
65 output_path = video_paths[0].parent / "combined_video.mp4"
66
67 with tempfile.NamedTemporaryFile(mode="w", suffix=".txt", delete=False) as f:
68 for p in video_paths:
69 f.write(f"file '{p.as_posix()}'\n")
70 list_file = f.name
71
72 cmd = [
73 "ffmpeg",
74 "-y",
75 "-f", "concat",
76 "-safe", "0",
77 "-i", list_file,
78 "-c", "copy",
79 str(output_path)
80 ]
81
82 subprocess.run(cmd, check=True)
83 return output_path
84

Callers

nothing calls this directly

Calls 2

resolveMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected