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.45k stars 535 forks source link

Output File Is Very Huge and is Unusable / Corrupted / Undesired #86

Open chauhanvats3 opened 1 year ago

chauhanvats3 commented 1 year ago

I ran the basic command to remove background from a video : backgroundremover -i "No Security.mp4" -tv -o "No_Security_BR.mov"

It finished the conversion process as such :

FRAME RATE DETECTED: 30000/1001 (if this looks wrong, override the frame rate) FRAME RATE: 30 TOTAL FRAMES: 369 WORKER FRAMERIPPER ONLINE WORKER 0 ONLINE ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers built with Apple clang version 14.0.3 (clang-1403.0.22.14.1) configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.0 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon libavutil 58. 2.100 / 58. 2.100 libavcodec 60. 3.100 / 60. 3.100 libavformat 60. 3.100 / 60. 3.100 libavdevice 60. 1.100 / 60. 1.100 libavfilter 9. 3.100 / 9. 3.100 libswscale 7. 1.100 / 7. 1.100 libswresample 4. 10.100 / 4. 10.100 libpostproc 57. 1.100 / 57. 1.100 Input #0, rawvideo, from 'fd:': Duration: N/A, start: 0.000000, bitrate: 19660 kb/s Stream #0:0: Video: rawvideo (Y800 / 0x30303859), gray, 256x320, 19660 kb/s, 30 tbr, 30 tbn Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native)) Output #0, mp4, to '/var/folders/1h/pwf_119j13bb2kvm2pq905y00000gn/T/tmpzk3e7rgn/matte.mp4': Metadata: encoder : Lavf60.3.100 Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p(tv, progressive), 256x320, q=2-31, 2000 kb/s, 30 fps, 15360 tbn Metadata: encoder : Lavc60.3.100 mpeg4 Side data: cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 0 vbv_delay: N/A frame= 5 fps=0.0 q=2.0 size= 256kB time=00:00:00.16 bitrate=12585.0kbits/s speed=0.2 frame= 9 fps=7.2 q=8.4 size= 256kB time=00:00:00.30 bitrate=6991.7kbits/s speed=0.23 frame= 13 fps=6.9 q=11.2 size= 512kB time=00:00:00.43 bitrate=9680.0kbits/s speed=0.2 frame= 17 fps=6.8 q=23.0 size=
. . . . . frame= 353 fps=6.4 q=24.4 size= 2816kB time=00:00:11.76 bitrate=1960.5kbits/s speed=0.2 frame= 357 fps=6.4 q=24.3 size= 2816kB time=00:00:11.90 bitrate=1938.6kbits/s speed=0.2 frame= 361 fps=6.4 q=28.3 size= 2816kB time=00:00:12.03 bitrate=1917.1kbits/s speed=0.2 frame= 365 fps=6.4 q=28.2 size= 3072kB time=00:00:12.16 bitrate=2068.5kbits/s speed=0.2 frame= 369 fps=6.1 q=20.9 size= 3072kB time=00:00:12.26 bitrate=2051.6kbits/s speed=0.2 frame= 369 fps=6.0 q=20.9 Lsize= 3133kB time=00:00:12.26 bitrate=2092.0kbits/s speed=0.201x
video:3130kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.089082% FINISHED ALL FRAMES (369)! Starting alphamerge after call Process finished

The input file is 428KB while the output file is 136MB

That, in itself, is not much of an issue as I can compress the file using ffmpeg as mentioned in some previous Issue The problem is that I have used QuickTime Player, IINA, MPV player mentioned here and Even imported the video and compressed versions to DaVinci Resolve but the same corrupted/Incomplete/Unusable is shown.

Here is a Screenshot of the output file : SCR-20230622-m2c

P.S. I tried using the Web App with the same file. There, Although the file is still huge, works as desired. Here Is the Screenshot Output from the web app : SCR-20230622-moi

nadermx commented 10 months ago

So it seems perhaps running into a limiting cpu or so on your machine? I havent checked about updating the format to vp9, I think its suggested