botbahlul / pyvosklivesubtitle

PySimpleGUI based DESKTOP APP that can RECOGNIZE any live streaming in 23 languages that supported by VOSK then TRANSLATE (using unofficial online Google Translate API) and display it as LIVE CAPTION / LIVE SUBTITLE
MIT License
28 stars 5 forks source link

Error on Windows10 #6

Closed wuzimi closed 8 months ago

wuzimi commented 8 months ago

Hi, I tried to install your application and ran into below error, could you pls help when convenient? Thanks.

C:\Users\Administrator\Documents\GitHub\pyvosklivesubtitle>pyvosklivesubtitle Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyvosklivesubtitle__init__.py", line 2138, in stop_ffmpeg_windows tasklist_output = subprocess.check_output(['tasklist'], creationflags=subprocess.CREATE_NO_WINDOW).decode('utf-8') UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 4: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Scripts\pyvosklivesubtitle.exe__main.py", line 7, in File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyvosklivesubtitle\init.py", line 3258, in main stop_ffmpeg_windows(error_messages_callback=show_error_messages) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyvosklivesubtitle\init.py", line 2157, in stop_ffmpeg_windows error_messages_callback(e) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyvosklivesubtitle\init__.py", line 3050, in show_error_messages main_window.write_event_value("-EXCEPTION-", messages) NameError: name 'main_window' is not defined

C:\Users\Administrator\Documents\GitHub\pyvosklivesubtitle>

botbahlul commented 8 months ago

wuzimi

Try to change the code page of your Command Prompt to UTF-8

https://stackoverflow.com/questions/57131654/using-utf-8-encoding-chcp-65001-in-command-prompt-windows-powershell-window#:~:text=You%20must%20additionally%20set%20the,AllUsersCurrentHost%20(all%20users)%20file.

wuzimi commented 8 months ago

Thanks for your instruction and the above problem solved. However a new issue raised. It can now only worked only about 10 seconds and then the app window freezed with the following information on the python window. I tried several times with the same result.

C:\Users\Administrator\Documents\GitHub\pyvosklivesubtitle>pyvosklivesubtitle Traceback (most recent call last): File "\?\C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Scripts\pyvosklivesubtitle-script.py", line 33, in sys.exit(load_entry_point('pyvosklivesubtitle==0.2.1', 'console_scripts', 'pyvosklivesubtitle')()) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyvosklivesubtitle__init__.py", line 3996, in main main_window['-ML-DST-RESULTS-'].update(translated_line + "\n", background_color_for_value='yellow1', append=True, autoscroll=True) TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

C:\Users\Administrator\Documents\GitHub\pyvosklivesubtitle>

issue

botbahlul commented 8 months ago

Thanks for your instruction and the above problem solved. However a new issue raised. It can now only worked only about 10 seconds and then the app window freezed with the following information on the python window. I tried several times with the same result.

C:\Users\Administrator\Documents\GitHub\pyvosklivesubtitle>pyvosklivesubtitle Traceback (most recent call last): File "\?\C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Scripts\pyvosklivesubtitle-script.py", line 33, in sys.exit(load_entry_point('pyvosklivesubtitle==0.2.1', 'console_scripts', 'pyvosklivesubtitle')()) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyvosklivesubtitleinit.py", line 3996, in main main_window['-ML-DST-RESULTS-'].update(translated_line + "\n", background_color_for_value='yellow1', append=True, autoscroll=True) TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

C:\Users\Administrator\Documents\GitHub\pyvosklivesubtitle>

issue

Have you done these too?

image

If you're still get bug please do a whole screen capture by pressing "Control+Shift+PrintScreen" keys simultaneously when the bug happened and paste it here.

If you don't mind I need to know the live streaming you watch, the audio and translation languages, so I can try to reproduce the error.

wuzimi commented 8 months ago

Yes, I have done that following the instruction you recommended. Anyway I figured out why I had the issue. To do the translation I have to use VPN, but that time I didn't use VPN. After I turned on VPN, the real time transcription works well. So maybe you could consider another version which only provided transcription without translation. By the way, is there any way I can turn off translation so that I can continue to use transcription? Thanks!

botbahlul commented 8 months ago

Yes, I have done that following the instruction you recommended. Anyway I figured out why I had the issue. To do the translation I have to use VPN, but that time I didn't use VPN. After I turned on VPN, the real time transcription works well. So maybe you could consider another version which only provided transcription without translation. By the way, is there any way I can turn off translation so that I can continue to use transcription? Thanks!

It looks like your country has banned all google servers. To see only original Audio Language captions just select same language for the Translation Language, for example if the Audio Language is Chinese, just select Chinese too for the Translation Language. The main purpose of this app is TO WATCH A LIVE STREAMING that you didn't understand the language but you wanna know what they were talking about. If your main purpose is to GET A TRANSCRIPTION FILE OF A VIDEO YOU HAVE ALREADY DOWNLOADED you can try the command line version : vosk_autosrt https://github.com/botbahlul/vosk_autosrt (using VOSK API), or whisper_autosrt https://github.com/botbahlul/whisper_autosrt (using Whisper API), or autosrt https://github.com/botbahlul/autosrt (using Google API). The most accurate app (I think) is whisper_autosrt, but also is the slowest app. The fastest app is google autosrt, but also not as accurate as whisper_autosrt. Feel free to try my other projects : https://github.com/botbahlul?tab=repositories

wuzimi commented 8 months ago

Thanks for your instructions. I did try your other project especially this one: VOSK-Powered-Live-Subtitle-V3 and it works well on my Pixel 4a.

Regarding the current project the main problem is I have to change the code page of your Command Prompt to UTF-8 to use it. Especially if I make this change my other software on PC will be impacted and some fonts can't be displayed correctly. Thanks any way!