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.86k stars 575 forks source link

'utf-8' codec can't decode byte 0xb2 in position 7: invalid start byte #25

Closed xiaokai0215 closed 1 year ago

xiaokai0215 commented 2 years ago

How to solve it

1

hi-hmz commented 2 years ago

I had the same problem in windows7 because executed the following command in the transparentvideo function in the backgrounremover/utilities.py file: cmd = "nice -10 ffmpeg -y -nostats -loglevel 0 -i %s -i %s -filter_complex '[1][0]scale2ref[mask][main];[main][mask]alphamerge=shortest=1 ' -c:v qtrle -shortest %s" % ( file_path, temp_file, output) process = sp.Popen(cmd, shell=True, stdout=sp.PIPE, stderr=sp.PIPE) stdout, stderr = process.communicate() However, the 'nice' command cannot be used in this system, and the following error will be thrown in the Chinese environment: 'nice' is not an internal or external command, nor is it a runnable program or batch file.

The stderr may be gbk encoding, use utf-8 decoding to cause 'utf-8' codec can't decode byte 0xb2 in position 7: invalid start byte

I removed 'nice -10 ' when judging the OS as windows, backgroundremover -i "/path/to/image.jpeg" -o "output.png" works fine, but the output file has only audio and no image.

Both -tg and -mk return the expected results.

nadermx commented 1 year ago

This should be fixed with the newest version, pip install --upgrade backgroundremover

435781067 commented 1 year ago

image

435781067 commented 1 year ago

I have update this version

nadermx commented 1 year ago

If you want to push a pr without nice in tbe utils ffmpeg commands, i will accept

El jue, 15 de jun de 2023 20:22, MrZhang @.***> escribió:

I have update this version

— Reply to this email directly, view it on GitHub https://github.com/nadermx/backgroundremover/issues/25#issuecomment-1594001273, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYACXABGXFQ4KFMI4AZJVLXLO7P3ANCNFSM5MCTCCRA . You are receiving this because you modified the open/close state.Message ID: @.***>