nadermx / backgroundremover

Background Remover lets you Remove Background from images and video using AI with a simple command line interface that is free and open source.
https://www.backgroundremoverai.com
MIT License
6.43k stars 534 forks source link

invalid argument when trying to make a transparent mov #115

Open jurassicjordan opened 6 months ago

jurassicjordan commented 6 months ago

[Parsed_alphamerge_1 @ 0x559b72360280] This filter does not take any options, but options were provided: shortest=1. [AVFilterGraph @ 0x559b722b2100] Error initializing filter 'alphamerge' with args 'shortest=1' Error initializing complex filters. Invalid argument Process finished

LeonadroW commented 3 months ago

I also have this problem

nadermx commented 3 months ago

What version of ffmpeg are you all using?

LeonadroW commented 3 months ago

I use [ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers], well , I found the cmd code in utilities.py saying:{ 'ffmpeg', '-y', '-i', file_path, '-i', temp_file, '-filter_complex', '[1][0]scale2ref[mask][main];[main][mask]alphamerge=shortest=1,fps=10,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse', '-shortest', output ]}} and my ffmpeg can't take arguments behind alphamerge, so change it into: { cmd = [ 'ffmpeg', '-y', '-i', file_path, '-i', temp_file, '-filter_complex', '[1][0]scale2ref[mask][main];[main][mask]alphamerge,fps=10,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse', '-shortest', output] } and in this way it works

nadermx commented 3 months ago

For it to work with backgroundremover it has to be ffmpeg 4.4+, I have it listed on the requriements. You're method is interesting if it works with ffmpeg 4.2, maybe should do that if it works for 4.4+ too.. hrm