Closed gllhjy closed 10 months ago
Btw, mk is work.
what os? Do you have the file you can upload? did you try running pip install --upgrade backgroundremover
Try upgrading, and then posting the error log
backgroundremover -i 1.mp4 -tv -o output.mp4
FRAME RATE DETECTED: 30/1 (if this looks wrong, override the frame rate) FRAME RATE: 30 TOTAL FRAMES: 2871 WORKER FRAMERIPPER ONLINE WORKER 0 ONLINE ffmpeg version 5.0.3 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2) configuration: libavutil 57. 17.100 / 57. 17.100 libavcodec 59. 18.100 / 59. 18.100 libavformat 59. 16.100 / 59. 16.100 libavdevice 59. 4.100 / 59. 4.100 libavfilter 8. 24.100 / 8. 24.100 libswscale 6. 4.100 / 6. 4.100 libswresample 4. 3.100 / 4. 3.100 Input #0, rawvideo, from 'pipe:': Duration: N/A, start: 0.000000, bitrate: 43315 kb/s Stream #0:0: Video: rawvideo (Y800 / 0x30303859), gray, 564x320, 43315 kb/s, 30 tbr, 30 tbn Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native)) Output #0, mp4, to '/tmp/tmpab6r39ca/matte.mp4': Metadata: encoder : Lavf59.16.100 Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p(tv, progressive), 564x320, q=2-31, 2000 kb/s, 30 fps, 15360 tbn Metadata: encoder : Lavc59.18.100 mpeg4 Side data: cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 0 vbv_delay: N/A frame= 2871 fps= 32 q=2.0 Lsize= 4202kB time=00:01:35.66 bitrate= 359.8kbits/s speed=1.06x video:4189kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.312076% FINISHED ALL FRAMES (2871)! Starting alphamerge ffmpeg version 5.0.3 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2) configuration: libavutil 57. 17.100 / 57. 17.100 libavcodec 59. 18.100 / 59. 18.100 libavformat 59. 16.100 / 59. 16.100 libavdevice 59. 4.100 / 59. 4.100 libavfilter 8. 24.100 / 8. 24.100 libswscale 6. 4.100 / 6. 4.100 libswresample 4. 3.100 / 4. 3.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/aigc/AIGC/backgroundremover-main/1.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.45.100 Duration: 00:01:35.72, start: 0.000000, bitrate: 2490 kb/s Stream #0:00x1: Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 2540x1440 [SAR 1:1 DAR 127:72], 2413 kb/s, 30 fps, 30 tbr, 15360 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:10x2: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 69 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0] Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/tmpab6r39ca/matte.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf59.16.100 Duration: 00:01:35.70, start: 0.000000, bitrate: 359 kb/s Stream #1:00x1: Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 564x320 [SAR 1:1 DAR 141:80], 358 kb/s, 30 fps, 30 tbr, 15360 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream mapping: Stream #0:0 (h264) -> scale2ref (graph 0) Stream #1:0 (mpeg4) -> scale2ref (graph 0) alphamerge:default (graph 0) -> Stream #0:0 (qtrle) Stream #0:1 -> #0:1 (aac (native) -> aac (native)) Press [q] to stop, [?] for help [swscaler @ 0x558bdf780040] [swscaler @ 0x558be1134900] No accelerated colorspace conversion found from yuv420p to argb. [swscaler @ 0x558bdf780040] [swscaler @ 0x558be1159500] No accelerated colorspace conversion found from yuv420p to argb. [swscaler @ 0x558bdf780040] [swscaler @ 0x558be118a9c0] No accelerated colorspace conversion found from yuv420p to argb. [swscaler @ 0x558bdf780040] [swscaler @ 0x558be11bbe80] No accelerated colorspace conversion found from yuv420p to argb. [swscaler @ 0x558bdf780040] [swscaler @ 0x558be11ed340] No accelerated colorspace conversion found from yuv420p to argb. [swscaler @ 0x558bdf780040] [swscaler @ 0x558be121e800] No accelerated colorspace conversion found from yuv420p to argb. [swscaler @ 0x558bdf780040] [swscaler @ 0x558be124fcc0] No accelerated colorspace conversion found from yuv420p to argb. [swscaler @ 0x558bdf780040] [swscaler @ 0x558be1281180] No accelerated colorspace conversion found from yuv420p to argb. [swscaler @ 0x558bdf780040] [swscaler @ 0x558be12b7dc0] No accelerated colorspace conversion found from yuv420p to argb. [mp4 @ 0x558bdf83a4c0] Could not find tag for codec qtrle in stream #0, codec not currently supported in container Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Error initializing output stream 0:0 -- [aac @ 0x558bdf71ab40] Qavg: 9868.625 [aac @ 0x558bdf71ab40] 2 frames left in the queue on closing Conversion failed! Process finished
I've got backgroundremover 0.2.5 now,this is my error log.
ffmpeg -codecs | grep qtrle ffmpeg version 5.0.3 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2) configuration: libavutil 57. 17.100 / 57. 17.100 libavcodec 59. 18.100 / 59. 18.100 libavformat 59. 16.100 / 59. 16.100 libavdevice 59. 4.100 / 59. 4.100 libavfilter 8. 24.100 / 8. 24.100 libswscale 6. 4.100 / 6. 4.100 libswresample 4. 3.100 / 4. 3.100 DEV..S qtrle QuickTime Animation (RLE) video
I checked my ffmpeg codecs
I also encountered the same problem.
Disregard this comment
The issue I think, is both of you are trying to output .mp4 files. Transparent videos can only be done in .mov, please try making .mov's instead of mp4 as your output file
ffmpeg -version ffmpeg version 5.0.3 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2) configuration: --prefix=/usr/local/ffmpeg --enable-shared --disable-static --enable-gpl --enable-libx264 --enable-libx265 --enable-libopus --enable-libvpx libavutil 57. 17.100 / 57. 17.100 libavcodec 59. 18.100 / 59. 18.100 libavformat 59. 16.100 / 59. 16.100 libavdevice 59. 4.100 / 59. 4.100 libavfilter 8. 24.100 / 8. 24.100 libswscale 6. 4.100 / 6. 4.100 libswresample 4. 3.100 / 4. 3.100 libpostproc 56. 3.100 / 56. 3.100
Successfully installed backgroundremover-0.2.4
backgroundremover -i 1.mp4 -tv -o output.mp4 FRAME RATE DETECTED: 30/1 (if this looks wrong, override the frame rate) FRAME RATE: 30 TOTAL FRAMES: 2871 WORKER FRAMERIPPER ONLINE WORKER 0 ONLINE ffmpeg version 5.0.3 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2) configuration: --prefix=/usr/local/ffmpeg --enable-shared --disable-static --enable-gpl --enable-libx264 --enable-libx265 --enable-libopus --enable-libvpx libavutil 57. 17.100 / 57. 17.100 libavcodec 59. 18.100 / 59. 18.100 libavformat 59. 16.100 / 59. 16.100 libavdevice 59. 4.100 / 59. 4.100 libavfilter 8. 24.100 / 8. 24.100 libswscale 6. 4.100 / 6. 4.100 libswresample 4. 3.100 / 4. 3.100 libpostproc 56. 3.100 / 56. 3.100 Input #0, rawvideo, from 'pipe:': Duration: N/A, start: 0.000000, bitrate: 43315 kb/s Stream #0:0: Video: rawvideo (Y800 / 0x30303859), gray, 564x320, 43315 kb/s, 30 tbr, 30 tbn Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native)) Output #0, mp4, to '/tmp/tmpbaj37t92/matte.mp4': Metadata: encoder : Lavf59.16.100 Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p(tv, progressive), 564x320, q=2-31, 2000 kb/s, 30 fps, 15360 tbn Metadata: encoder : Lavc59.18.100 mpeg4 Side data: cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 0 vbv_delay: N/A frame= 2871 fps= 34 q=2.0 Lsize= 4188kB time=00:01:35.66 bitrate= 358.6kbits/s speed=1.15x video:4175kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.313081% FINISHED ALL FRAMES (2871)! Starting alphamerge Process finished
All have run successfully but the outfile is still 0kb