如何从 fluent-ffmpeg 传输到 AWS s3?

How can I pipe from fluent-ffmpeg to AWS s3?

我正在尝试:

        const passthroughStream = new PassThrough()
        ffmpeg(stream).audioBitrate(8)
            .output(passthroughStream, { end: true })
            .on('progress', (p) => console.log(p))
            .on('error', (err) => console.log(err))

        const bucketStreamParams = {
            Bucket: 'mybucket,
            Key: outputFilename,
            Body: passthroughStream
        }

        const s3Response = await s3.upload(bucketStreamParams).promise()

但似乎什么也没有发生。我以为 PassThrough 会处理这个问题,但它似乎没有。任何帮助将不胜感激。

我需要添加一个 .format 然后它起作用了:

        ffmpeg(stream)
            .format('mp3')
            .output(passthroughStream, { end: true })
            .on('error', (err) => console.log(err))
            .run()