diff --git a/src/common/ffmpeg-worker.ts b/src/common/ffmpeg-worker.ts index 5803c125..7ee7b2d8 100644 --- a/src/common/ffmpeg-worker.ts +++ b/src/common/ffmpeg-worker.ts @@ -67,7 +67,7 @@ import imageSize from 'image-size'; } } - public static async convert(filePath: string, pcmPath: string, logger: LogWrapper): Promise { + public static async convert(filePath: string, pcmPath: string): Promise { const ffmpegInstance = await FFmpeg.create({ core: '@ffmpeg.wasm/core-mt' }); const inputFileName = `${randomUUID()}.input`; const outputFileName = `${randomUUID()}.pcm`; @@ -87,12 +87,12 @@ import imageSize from 'image-size'; try { ffmpegInstance.fs.unlink(outputFileName); } catch (unlinkError) { - logger.log('Error unlinking output file:', unlinkError); + console.error('Error unlinking output file:', unlinkError); } try { ffmpegInstance.fs.unlink(inputFileName); } catch (unlinkError) { - logger.log('Error unlinking input file:', unlinkError); + console.error('Error unlinking output file:', unlinkError); } } } @@ -142,7 +142,7 @@ export default async function handleFFmpegTask({ method, args }: FFmpegTask): Pr case 'convertFile': return await FFmpegService.convertFile(...args as [string, string, string]); case 'convert': - return await FFmpegService.convert(...args as [string, string, LogWrapper]); + return await FFmpegService.convert(...args as [string, string]); case 'getVideoInfo': return await FFmpegService.getVideoInfo(...args as [string, string]); default: diff --git a/src/common/ffmpeg.ts b/src/common/ffmpeg.ts index e026a2b9..efc72571 100644 --- a/src/common/ffmpeg.ts +++ b/src/common/ffmpeg.ts @@ -30,11 +30,11 @@ export class FFmpegService { await piscina.destroy(); } - public static async convert(filePath: string, pcmPath: string, logger: LogWrapper): Promise { + public static async convert(filePath: string, pcmPath: string): Promise { const piscina = new Piscina({ filename: await getWorkerPath(), }); - const result = await piscina.run({ method: 'convert', args: [filePath, pcmPath, logger] }); + const result = await piscina.run({ method: 'convert', args: [filePath, pcmPath] }); await piscina.destroy(); return result; }