It appears possible to have multiple outputs from a single FFMPEG command: ffmpeg overlay on multiple outputs
I'd like to know how to do this in FFMPEG. I'm specifically using the complexFilter option in an attempt to split the video into 4 different sizes and place an overlay, and then save the 4 resulting files.
The code is my attempt to simply split the video into 4 and save it. I get the Error: ffmpeg exited with code 1: Filter split:output3 has an unconnected output
error. I'm unsure how to connect the output to a file in fluent-ffmpeg.
let ffmpegCommand = ffmpeg()
.addInput(path.join(__dirname, PROCESSING_CACHE_DIRECTORY, "tempImage_%d.jpg"))
.addOutput(outputPathFull)
.addOutput(outputPathMed)
.addOutput(outputPathSmall)
.addOutput(outputPathThumb)
.toFormat('mp4')
.videoCodec('libx264')
.outputOptions('-pix_fmt yuv420p')
.complexFilter([
{
filter: 'split', options: '4',
inputs: ['0:v'], outputs: [outputPathFull, outputPathMed, outputPathSmall, outputPathThumb]
},
])
When I flip the outputs and put them below the complexFilter, I get 4 files - one with the appropriate quality (and 4x bigger than expected) and the others in very low quality.
The correct way to do this in
ffmpeg
is to define the desired filters for each output using-map
, follow the example withfluent-ffmpeg
: