MCPcopy
hub / github.com/CapSoftware/Cap / convertRemoteVideoToMp4FileInternal

Function convertRemoteVideoToMp4FileInternal

apps/web/lib/video-convert.ts:205–240  ·  view source on GitHub ↗
(
	videoUrl: string,
	outputPath: string,
)

Source from the content-addressed store, hash-verified

203}
204
205async function convertRemoteVideoToMp4FileInternal(
206 videoUrl: string,
207 outputPath: string,
208): Promise<void> {
209 try {
210 await runFfmpeg([
211 "-y",
212 "-i",
213 videoUrl,
214 "-c",
215 "copy",
216 "-movflags",
217 "+faststart",
218 outputPath,
219 ]);
220 } catch {
221 await runFfmpeg([
222 "-y",
223 "-i",
224 videoUrl,
225 "-c:v",
226 "libx264",
227 "-preset",
228 "veryfast",
229 "-pix_fmt",
230 "yuv420p",
231 "-c:a",
232 "aac",
233 "-b:a",
234 "128k",
235 "-movflags",
236 "+faststart",
237 outputPath,
238 ]);
239 }
240}
241
242export async function convertRemoteVideoToMp4(
243 videoUrl: string,

Callers 1

convertRemoteVideoToMp4Function · 0.85

Calls 1

runFfmpegFunction · 0.85

Tested by

no test coverage detected