backgroundremover: -tov/--transparentvideoovervideo: invalid value:
Hi,
I tried multiple way to get a -tv
working an example video to work with a background and it always throws the error in the title.
For instance, backgroundremover -i "./stress.mp4" -tov "vert.mp4" -o "output.mp4"
results in:
backgroundremover: error: argument -tov/--transparentvideoovervideo: invalid <lambda> value: 'vert.mp4'
Weirdly enough backgroundremover -i "./stress.mp4" -tov -o "output.mp4"
“works” … but there’s no overlay video input so I get:
/<stdin>: No such file or directory Process finished
Any idea?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 16 (1 by maintainers)
Commits related to this issue
- Close issue #28 Solution https://github.com/nadermx/backgroundremover/issues/28#issuecomment-1083139734 — committed to nadermx/backgroundremover by nadermx 2 years ago
The following command generates a video that scale-up the video for the background image. It may help in some cases. At least work for me. I spent some time writing this command, just want to share it to save your time if you need it.
ffmpeg -i test_fightclub.mp4 -i fight_matte_image.mov -i green.png -filter_complex '[1][0]scale2ref[mask][main];[main][mask]alphamerge[vid];[vid][2:v]scale2ref[fg][bg];[bg][fg]overlay[out]' -map [out] fight_image_complete_scale2ref.mp4
my output was like this:
now I can generate following output with the code:
I had this open on superuser as I had gotten stuck. I’ll fix the ‘-tov’ ffmpeg command and close this issue.
Hey,it also works with a PNG image:
ffmpeg -i stress.mp4 -i matte.mp4 -i vert.png -filter_complex '[1][0]scale2ref[mask][main];[main][mask]alphamerge[vid];[2:v][vid]overlay[out]' -map [out] complete2.mp4
(“vert” is green in French)hey @j2l,
I have used following command to combine the mate, video and the background video.
ffmpeg -i video.mp4 -i matte.mp4 -i background.mp4 -filter_complex '[1][0]scale2ref[mask][main];[main][mask]alphamerge[vid];[2:v][vid]overlay[out]' -map [out] complete.mp4
It works but has some rescaling issues. But the main point the code should give a proper output. it is working for image but now working for the video. any idea @nadermx ?
by the way here is the output: