File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
apps/media-server/src/lib Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ export interface AudioExtractionOptions {
44 format ?: "mp3" ;
55 codec ?: "libmp3lame" ;
66 bitrate ?: string ;
7+ timeoutMs ?: number ;
78}
89
910const DEFAULT_OPTIONS : Required < AudioExtractionOptions > = {
@@ -240,6 +241,7 @@ export function extractAudioStream(
240241 activeProcesses ++ ;
241242
242243 const opts = { ...DEFAULT_OPTIONS , ...options } ;
244+ const timeout = options . timeoutMs ?? EXTRACT_TIMEOUT_MS ;
243245
244246 const ffmpegArgs = [
245247 "ffmpeg" ,
@@ -283,7 +285,7 @@ export function extractAudioStream(
283285 timeoutId = setTimeout ( ( ) => {
284286 console . error ( "[ffmpeg] Stream extraction timed out" ) ;
285287 cleanup ( ) ;
286- } , EXTRACT_TIMEOUT_MS ) ;
288+ } , timeout ) ;
287289
288290 drainStream ( proc . stderr as ReadableStream < Uint8Array > ) ;
289291
You can’t perform that action at this time.
0 commit comments