fluent-ffmpeg / node-fluent-ffmpeg

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

drawtext conversion slows down #1212

Open jxccc1998 opened 1 year ago

jxccc1998 commented 1 year ago

Version information

Code to reproduce

ffmpeg(filePath)
      .complexFilter([
        {
          filter: 'drawtext',
          options: {
            fontfile:
              'D\\\\:/webwork/wms-pack-video-plugin/assets/Arial.ttf',
            expansion: 'strftime',
            basetime: `${Math.floor(
              new Date('2020-08-08T14:10:50').getTime()
            )}000000`,
            text: '%Y-%m-%d %H\\\\:%M\\\\: %S',
            fontsize: 12,
            fontcolor: 'white',
            x: 6,
            y: 6,
            enable: 'gte(n,20)',
          },
        },
      ])
      .setFfmpegPath(fixedPath)
      .outputOptions(['-preset faster', '-an', '-threads auto'])
      .output(`${dir}/${fileName}.webm`)
      .on('end', () => {
        fs.unlinkSync(filePath);
      })
      .run();

Expected results

I hope the conversion speed will be faster.

Observed results

The quality of the converted video has been reduced. In this way a 1 minute video spins for 40 seconds.