Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Fix Turbopack whole-project tracing from ffmpeg spawn calls

Richie McIlroye6a85fba9344
diff --git a/apps/web/lib/audio-extract.ts b/apps/web/lib/audio-extract.ts
index 1f68c2e5f..c3034e713 100644
--- a/apps/web/lib/audio-extract.ts
+++ b/apps/web/lib/audio-extract.ts
@@ -74,7 +74,9 @@ export async function extractAudioFromUrl(
];
return new Promise((resolve, reject) => {
- const proc = spawn(ffmpeg, ffmpegArgs, { stdio: ["pipe", "pipe", "pipe"] });
+ const proc = spawn(/*turbopackIgnore: true*/ ffmpeg, ffmpegArgs, {
+ stdio: ["pipe", "pipe", "pipe"],
+ });
let stderr = "";
@@ -124,7 +126,9 @@ export async function extractAudioToBuffer(videoUrl: string): Promise<Buffer> {
];
return new Promise((resolve, reject) => {
- const proc = spawn(ffmpeg, ffmpegArgs, { stdio: ["pipe", "pipe", "pipe"] });
+ const proc = spawn(/*turbopackIgnore: true*/ ffmpeg, ffmpegArgs, {
+ stdio: ["pipe", "pipe", "pipe"],
+ });
const chunks: Buffer[] = [];
let stderr = "";
@@ -168,7 +172,9 @@ export async function convertWavToMp3(wavBuffer: Buffer): Promise<Buffer> {
];
return new Promise((resolve, reject) => {
- const proc = spawn(ffmpeg, ffmpegArgs, { stdio: ["pipe", "pipe", "pipe"] });
+ const proc = spawn(/*turbopackIgnore: true*/ ffmpeg, ffmpegArgs, {
+ stdio: ["pipe", "pipe", "pipe"],
+ });
const chunks: Buffer[] = [];
let stderr = "";
@@ -216,7 +222,7 @@ export async function checkHasAudioTrack(videoUrl: string): Promise<boolean> {
const ffmpegArgs = ["-i", videoUrl, "-hide_banner"];
return new Promise((resolve, reject) => {
- const proc = spawn(ffmpeg, ffmpegArgs, {
+ const proc = spawn(/*turbopackIgnore: true*/ ffmpeg, ffmpegArgs, {
stdio: ["pipe", "pipe", "pipe"],
});
diff --git a/apps/web/lib/og/poster-frame.ts b/apps/web/lib/og/poster-frame.ts
index 6396a33ba..b65d89f7e 100644
--- a/apps/web/lib/og/poster-frame.ts
+++ b/apps/web/lib/og/poster-frame.ts
@@ -28,7 +28,7 @@ const grabFrame = (
) =>
new Promise<Buffer>((resolve, reject) => {
const proc = spawn(
- ffmpeg,
+ /*turbopackIgnore: true*/ ffmpeg,
[
"-hide_banner",
"-loglevel",
diff --git a/apps/web/lib/video-convert.ts b/apps/web/lib/video-convert.ts
index 6a842cfc3..484cd1235 100644
--- a/apps/web/lib/video-convert.ts
+++ b/apps/web/lib/video-convert.ts
@@ -15,7 +15,9 @@ function runFfmpeg(args: string[]): Promise<void> {
const ffmpeg = getFfmpegPath();
return new Promise((resolve, reject) => {
- const proc = spawn(ffmpeg, args, { stdio: ["ignore", "ignore", "pipe"] });
+ const proc = spawn(/*turbopackIgnore: true*/ ffmpeg, args, {
+ stdio: ["ignore", "ignore", "pipe"],
+ });
let stderr = "";
@@ -270,7 +272,7 @@ export async function convertRemoteVideoToMp4Buffer(
const result = await convertRemoteVideoToMp4(videoUrl);
try {
- return await fs.readFile(result.filePath);
+ return await fs.readFile(/*turbopackIgnore: true*/ result.filePath);
} finally {
await result.cleanup();
}