fluent-ffmpeg / node-fluent-ffmpeg

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

How to add cover image to audio on the "fly" (stream) ? #1271

Open websharik opened 2 months ago

websharik commented 2 months ago

I was try:

//add cover image to stream
ffmpeg(audioStream)
  //.addInput("./tmp.jpg") //also no attach to streams
  .addInput(coverImageUrl)
  .addOption('-map', '0:a')
  .addOption('-map', '1')
  .addOption('-codec', 'copy')
  .addOption('-disposition:v', 'attached_pic')
  .outputFormat('mp3') //required for streams
  /*.output(
    filePath, //cover image fine
    writeStream //no cover image
  )*/
  //.run()
  .pipe(writeStream) //no cover image

Working with flac and wav.