You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The b command doesn't work for me. I have no idea why, but I found a simple fix.
To Reproduce
Steps to reproduce the behavior:
Run for example ffmpeg -hide_banner -loglevel quiet -i C0040.MP4 -ss 10 -t 1 -an -f rawvideo -pix_fmt rgb24 pipe:1 | rembg b 2160 3840 | ffmpeg -f image2pipe -framerate 60 -i pipe:1 -c:v libx265 -crf 23 output.mp4
See error
File "/mnt/deb67853-226b-4939-9bd1-3167199a8160/rembg/env/lib/python3.11/site-packages/rembg/commands/b_command.py", line 165, in main
img = PILImage.frombytes("RGB", (image_width, image_height), img_bytes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/deb67853-226b-4939-9bd1-3167199a8160/rembg/env/lib/python3.11/site-packages/PIL/Image.py", line 858, in frombytes
if self.width == 0 or self.height == 0:
^^^^^^^^^^
AttributeError: 'str' object has no attribute 'width'
If you want, use pdb to investigate. It turns out that self == "RGB".
Expected behavior
The background should have been removed from the video.
OS Version:
debian 12
Rembg version: 37bbf63 (also latest version on pip has same behaviour)
$ cat raw_rgb24.dat| rembg b 1440 1080 | cat -> rgb.dat
File "/Users/me/main_venv/lib/python3.11/site-packages/PIL/Image.py", line 858, in frombytes
if self.width == 0 or self.height == 0:
^^^^^^^^^^
AttributeError: 'str' object has no attribute 'width'
Describe the bug
The b command doesn't work for me. I have no idea why, but I found a simple fix.
To Reproduce
Steps to reproduce the behavior:
ffmpeg -hide_banner -loglevel quiet -i C0040.MP4 -ss 10 -t 1 -an -f rawvideo -pix_fmt rgb24 pipe:1 | rembg b 2160 3840 | ffmpeg -f image2pipe -framerate 60 -i pipe:1 -c:v libx265 -crf 23 output.mp4
Expected behavior
The background should have been removed from the video.
OS Version:
debian 12
Rembg version:
37bbf63 (also latest version on pip has same behaviour)
Solution
If you know why this helps, I would be glad to find out.
The text was updated successfully, but these errors were encountered: