node.js – How to use FFMPEG to add moov to the begining of the file?

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

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

and despite using "-movflags" the video file doesn’t present metadata especially the duration of the video on remote buffer playing. How can I add metadata information of duration to the written file?

Read more here: Source link