fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to remove black areas in the video

rahulserver opened this issue · comments

Version information

  • fluent-ffmpeg version: 2.1.2
  • ffmpeg version: 6.0-6
  • OS: ubuntu1

Code to reproduce

        const outputStream = new PassThrough()
        const proc = ffmpeg()

        proc.input(outputStream)
            .inputFormat('webm')
            .inputOptions(['-re'])
            .size('1920x1080')
            .output(outputUrl)
            .outputOptions([
                '-c:v libx264',
                '-preset veryfast',
                '-b:v 3000k',
                '-maxrate 50M',
                '-bufsize 100M',
                '-profile:v main',
                '-c:a aac',
                '-b:a 192k',
                '-f flv',
                '-g 60',
                '-vf crop=640:480:0:0',
                '-s 1920:1080'
            ])
            .on('start', () => {
                console.log('FFmpeg process started');
            })
            .on('stderr', (stderrLine) => {
                console.log('Stderr output: ' + stderrLine);
            })

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

Expected results

the video should not have the blank areas as in this picture

Observed results

image

So how do I remove this black area from the video? Also is there a way to use cropdetect in the library? can't find anywhere in the docs.