jianchang512 / pyvideotrans

Translate the video from one language to another and add dubbing. 将视频从一种语言翻译为另一种语言,并支持api调用
https://pyvideotrans.com
GNU General Public License v3.0
10.21k stars 1.13k forks source link

執行單個字幕配音會出現'NoneType' object is not subscriptable 訊息 #461

Closed ginhon123 closed 2 months ago

ginhon123 commented 3 months ago

出错信息 執行單個字幕配音會出現'NoneType' object is not subscriptable 訊息,就中斷了 v1.9.1 比前的版本不會有這個問題 2024-07-04 15 00 16

复现步骤

  1. 執行單個字幕配音 2.導入字幕 3.開始配音

操作系统

jianchang512 commented 3 months ago

未复现。 请打开软件目录下 logs文件夹,删掉所有文件,然后重新测试,到出错时,将 logs下的文件上传

AdaZhou commented 3 months ago

我也遇到相同问题,下面是日志 INFO:VideoTrans:runffmpeg-arg=['-y', '-i', '/Users/xiaocao/xiaocao/data/chattts/static/wavs/000107_use8.04s-audio1.25s-seed16-te0.3-tp0.7-tk20-textlen16-79915.wav', '/Users/xiaocao/xiaocao/pyvideotrans/tmp/20240706-000000/ba5d2da68266deb08828222235996175.mp3'] INFO:VideoTrans:runffmpeg-tihuan:cmd=['ffmpeg', '-hide_banner', '-ignore_unknown', '-y', '-i', '/Users/xiaocao/xiaocao/data/chattts/static/wavs/000107_use8.04s-audio1.25s-seed16-te0.3-tp0.7-tk20-textlen16-79915.wav', '/Users/xiaocao/xiaocao/pyvideotrans/tmp/20240706-000000/ba5d2da68266deb08828222235996175.mp3'] INFO:VideoTrans:chatTTS:data={'text': 'Has the corpse been disposed of?', 'voice': '16', 'prompt': '', 'is_split': 1},res.text='{"audio_files":[{"audio_duration":1.85,"filename":"/Users/xiaocao/xiaocao/data/chattts/static/wavs/000109_use10.01s-audio1.85s-seed16-te0.3-tp0.7-tk20-textlen32-66374.wav","inference_time":10.01,"url":"http://127.0.0.1:9966/static/wavs/000109_use10.01s-audio1.85s-seed16-te0.3-tp0.7-tk20-textlen32-66374.wav"}],"code":0,"filename":"/Users/xiaocao/xiaocao/data/chattts/static/wavs/000109_use10.01s-audio1.85s-seed16-te0.3-tp0.7-tk20-textlen32-66374.wav","msg":"ok","url":"http://127.0.0.1:9966/static/wavs/000109_use10.01s-audio1.85s-seed16-te0.3-tp0.7-tk20-textlen32-66374.wav"}\n' INFO:VideoTrans:runffmpeg-arg=['-y', '-i', '/Users/xiaocao/xiaocao/data/chattts/static/wavs/000109_use10.01s-audio1.85s-seed16-te0.3-tp0.7-tk20-textlen32-66374.wav', '/Users/xiaocao/xiaocao/pyvideotrans/tmp/20240706-000000/a98cf047a81bd7be74b826496800d485.mp3'] INFO:VideoTrans:runffmpeg-tihuan:cmd=['ffmpeg', '-hide_banner', '-ignore_unknown', '-y', '-i', '/Users/xiaocao/xiaocao/data/chattts/static/wavs/000109_use10.01s-audio1.85s-seed16-te0.3-tp0.7-tk20-textlen32-66374.wav', '/Users/xiaocao/xiaocao/pyvideotrans/tmp/20240706-000000/a98cf047a81bd7be74b826496800d485.mp3'] INFO:VideoTrans:开始配音 [18/21] INFO:VideoTrans:开始配音 [19/21] INFO:VideoTrans:chatTTS:data={'text': 'You must reveal your secret when she wake up later', 'voice': '16', 'prompt': '', 'is_split': 1},res.text='{"audio_files":[{"audio_duration":3.34,"filename":"/Users/xiaocao/xiaocao/data/chattts/static/wavs/000115_use11.16s-audio3.34s-seed16-te0.3-tp0.7-tk20-textlen50-10643.wav","inference_time":11.16,"url":"http://127.0.0.1:9966/static/wavs/000115_use11.16s-audio3.34s-seed16-te0.3-tp0.7-tk20-textlen50-10643.wav"}],"code":0,"filename":"/Users/xiaocao/xiaocao/data/chattts/static/wavs/000115_use11.16s-audio3.34s-seed16-te0.3-tp0.7-tk20-textlen50-10643.wav","msg":"ok","url":"http://127.0.0.1:9966/static/wavs/000115_use11.16s-audio3.34s-seed16-te0.3-tp0.7-tk20-textlen50-10643.wav"}\n' INFO:VideoTrans:runffmpeg-arg=['-y', '-i', '/Users/xiaocao/xiaocao/data/chattts/static/wavs/000115_use11.16s-audio3.34s-seed16-te0.3-tp0.7-tk20-textlen50-10643.wav', '/Users/xiaocao/xiaocao/pyvideotrans/tmp/20240706-000000/f9bde798e685b0335913163090d90f24.mp3'] INFO:VideoTrans:runffmpeg-tihuan:cmd=['ffmpeg', '-hide_banner', '-ignore_unknown', '-y', '-i', '/Users/xiaocao/xiaocao/data/chattts/static/wavs/000115_use11.16s-audio3.34s-seed16-te0.3-tp0.7-tk20-textlen50-10643.wav', '/Users/xiaocao/xiaocao/pyvideotrans/tmp/20240706-000000/f9bde798e685b0335913163090d90f24.mp3'] INFO:VideoTrans:开始配音 [20/21] INFO:VideoTrans:开始配音 [21/21] INFO:VideoTrans:ChatTTS:api=http://127.0.0.1:9966 INFO:VideoTrans:chatTTS:data={'text': 'Are you awake?', 'voice': '16', 'prompt': '', 'is_split': 1},res.text='{"audio_files":[{"audio_duration":0.82,"filename":"/Users/xiaocao/xiaocao/data/chattts/static/wavs/000118_use2.44s-audio0.82s-seed16-te0.3-tp0.7-tk20-textlen14-61221.wav","inference_time":2.44,"url":"http://127.0.0.1:9966/static/wavs/000118_use2.44s-audio0.82s-seed16-te0.3-tp0.7-tk20-textlen14-61221.wav"}],"code":0,"filename":"/Users/xiaocao/xiaocao/data/chattts/static/wavs/000118_use2.44s-audio0.82s-seed16-te0.3-tp0.7-tk20-textlen14-61221.wav","msg":"ok","url":"http://127.0.0.1:9966/static/wavs/000118_use2.44s-audio0.82s-seed16-te0.3-tp0.7-tk20-textlen14-61221.wav"}\n' INFO:VideoTrans:runffmpeg-arg=['-y', '-i', '/Users/xiaocao/xiaocao/data/chattts/static/wavs/000118_use2.44s-audio0.82s-seed16-te0.3-tp0.7-tk20-textlen14-61221.wav', '/Users/xiaocao/xiaocao/pyvideotrans/tmp/20240706-000000/b4c378555deb0ce1ea83c2a0a98eb05c.mp3'] INFO:VideoTrans:runffmpeg-tihuan:cmd=['ffmpeg', '-hide_banner', '-ignore_unknown', '-y', '-i', '/Users/xiaocao/xiaocao/data/chattts/static/wavs/000118_use2.44s-audio0.82s-seed16-te0.3-tp0.7-tk20-textlen14-61221.wav', '/Users/xiaocao/xiaocao/pyvideotrans/tmp/20240706-000000/b4c378555deb0ce1ea83c2a0a98eb05c.mp3'] INFO:VideoTrans:audio:0 INFO:VideoTrans:audio:1 INFO:VideoTrans:audio:2 INFO:VideoTrans:audio:3 INFO:VideoTrans:audio:4 INFO:VideoTrans:audio:5 INFO:VideoTrans:audio:6 INFO:VideoTrans:audio:7 INFO:VideoTrans:audio:8 INFO:VideoTrans:audio:9 INFO:VideoTrans:audio:10 INFO:VideoTrans:audio:11 INFO:VideoTrans:audio:12 INFO:VideoTrans:audio:13 INFO:VideoTrans:audio:14 INFO:VideoTrans:audio:15 INFO:VideoTrans:audio:16 INFO:VideoTrans:audio:17 INFO:VideoTrans:audio:18 INFO:VideoTrans:audio:19 INFO:VideoTrans:audio:20 ERROR:VideoTrans:'NoneType' object is not subscriptable

jianchang512 commented 3 months ago

看看 chatTTS终端是否有报错

jianchang512 commented 3 months ago

无法复现,出错时截图下控制台终端信息

everythingnew1 commented 2 months ago

Hello and thank you for all your hard work.I get the same error.I use the gui version for linux and "subtitle create dubbing" with Edge tts.My terminal shows only "ffprobe---errore=CalledProcessError(1, ['ffprobe', '-v', 'quiet', '-print_format', 'json', '-show_format', '-show_streams', '/home/jim/Videos/pyvideotrans/only_dubbing/novoice.mp4']),e.args=(1, ['ffprobe', '-v', 'quiet', '-print_format', 'json', '-show_format', '-show_streams', '/home/jim/Videos/pyvideotrans/only_dubbing/novoice.mp4'])" .Before this with previous versions there were sync issues for video and audio.The last version that works is 1.45 (still use 1.45 without any issues).

jianchang512 commented 2 months ago

update to 2.05 patch

everythingnew1 commented 2 months ago

Tested the new version and works fine now for me.Thank you