BingLingGroup / autosub

Command-line utility to transcribe/translate from video/audio/subtitles to subtitles
GNU General Public License v2.0
1.97k stars 243 forks source link

讯飞api调用超时 #197

Open samulenzz opened 1 year ago

samulenzz commented 1 year ago

确保你已经看过 readme,也搜索并阅读过和你遇到的情况相关的问题。否则会被认为是重复的并被立刻关闭。

描述问题 讯飞api调用超时

复现问题 复现问题的步骤:

autosub -sapi xfyun -i "/media/huabing/Data/RawCodes/682.mp4" -sconf /media/huabing/Data/RawCodes/xunfei.json
warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
Translation destination language not provided. Only performing speech recognition.
Override "-of"/"--output-files" due to your args too few.
Output source subtitles file only.

Convert source file to "/tmp/tmpxe4wr4mf.wav" to detect audio regions.
/usr/bin/ffmpeg -hide_banner -y -i "/media/huabing/Data/RawCodes/nizz/682.mp4" -vn -ac 1 -ar 48000 -loglevel error "/tmp/tmpxe4wr4mf.wav"

Use ffprobe to check conversion result.
/usr/bin/ffprobe "/tmp/tmpxe4wr4mf.wav" -show_format -pretty -loglevel quiet
[FORMAT]
filename=/tmp/tmpxe4wr4mf.wav
nb_streams=1
nb_programs=0
format_name=wav
format_long_name=WAV / WAVE (Waveform Audio)
start_time=N/A
duration=3:56:08.213333
size=1.266737 Gibyte
bit_rate=768 Kbit/s
probe_score=99
TAG:encoder=Lavf58.29.100
[/FORMAT]

Conversion completed.
Use Auditok to detect speech regions.
Auditok detection completed.
"/tmp/tmpxe4wr4mf.wav" has been deleted.

Converting speech regions to short-term fragments.
Converting: 100% |####################################################################################################################################################| Time:  0:00:45

Sending short-term fragments to Xun Fei Yun WebSocket API and getting result.
Speech-to-Text: 100% |################################################################################################################################################| Time:  0:02:09
Receive something unexpected:
[Errno 110] Connection timed out
Error: Speech-to-text failed.
All work done.
{
"app_id": "xxxx",
"api_secret": "xxxx",
"api_key": "xxxx",
"api_address": "iat-niche-api.xfyun.cn",
"business": {
    "language": "ja_jp",
    "domain": "iat",
    "accent": "mandarin"
}
}

期待的行为 期望调用讯飞api,不知道哪里出问题,超时了。

截图 合适的话可以提供用以描述问题的截图。但是不推荐用截图来展示命令行输出,除非你真的认为这很有必要。

操作环境(请提供以下完整数据):

额外信息(可选) 任何其他的能描述问题的信息。