backgroundremover icon indicating copy to clipboard operation
backgroundremover copied to clipboard

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

Open xiaokai0215 opened this issue 3 years ago • 1 comments

How to solve it

1

xiaokai0215 avatar Jan 16 '22 10:01 xiaokai0215

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.

hi-hmz avatar Jul 20 '22 10:07 hi-hmz

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

nadermx avatar May 06 '23 00:05 nadermx

image

435781067 avatar Jun 16 '23 02:06 435781067

I have update this version

435781067 avatar Jun 16 '23 02:06 435781067

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: @.***>

nadermx avatar Jun 16 '23 02:06 nadermx