fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)
MIT License
7.85k stars 874 forks source link

No errors thrown, fluent-ffmpeg gives me an almost empty file #1208

Closed TheoCouss closed 1 year ago

TheoCouss commented 1 year ago

Version information

Code to reproduce

const fs = require('node:fs');
const ffmpeg = require('fluent-ffmpeg');
const path = require('node:path');

const tempFile = fs.createWriteStream(path.join(__dirname, './music.mp3'))
const originalFile = fs.createReadStream(path.join(__dirname, './music.m4a')) // M4a ALAC

const transcoder = ffmpeg(originalFile)
.withNoVideo()
.audioChannels(2)
.audioBitrate('128k')
.audioCodec('libmp3lame')
.toFormat('mp3')
.output(tempFile)

transcoder.run()

(note: if the problem only happens with some inputs, include a link to such an input file)

Here is the file I tried https://temp.sh/ZNOzj/music.m4a

Expected results

A playable mp3 file

Observed results

The lib does not throw any error and gives me a small file with only ID3 data(I think). The result weights 144 bytes.

TheoCouss commented 1 year ago

I found that my issue is a duplicate of #616