fluent-ffmpeg / node-fluent-ffmpeg

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

How to use FFMPEG to add moov to the begining of the file? #1211

Open hypo-thesis opened 1 year ago

hypo-thesis commented 1 year ago

I am saving a webm file from a buffer array as such :

Code to reproduce

const stream = Readable.from(buffer);

ffmpeg().input(stream).videoCodec('libx264').audioCodec('libfaac').format('webm').outputOptions([
                "-movflags", "+faststart",
                "-preset", "veryfast",
                "-crf", "30", "-threads 5"
              ])

Version information

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

Expected results

I wish to have the duration of the video at the start of the video ( having MOOV)

Observed results

The file is missing MOOV apparently because ffprobe -v trace -i myfile.mp4 2>&1 | grep -e type:\'mdat\' -e type:\'moov\' returns no results.