autosub icon indicating copy to clipboard operation
autosub copied to clipboard

Who can help me 求中文版教程

Open apaperumbrella opened this issue 5 years ago • 24 comments

I don't know how to use it in macbook, I'm in China mainland, is it possible to use it. Who can help me, please, 3Q! 有中文版教程吗,求,谢谢。

apaperumbrella avatar Oct 28 '18 09:10 apaperumbrella

https://github.com/agermanidis/autosub/issues/31 这里有详细教程,虽然不是中文版的,但是很简单,我也是中国大陆的,有问题一起讨论啊,小白一个

On Sun, Oct 28, 2018 at 5:15 PM apaperumbrella [email protected] wrote:

I don't know how to use it in macbook, I'm in China mainland, is it possible to use it. Who can help me, please, 3Q! 有中文版教程吗,求,谢谢。

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/agermanidis/autosub/issues/112, or mute the thread https://github.com/notifications/unsubscribe-auth/AqHw8He7BFyQcrgfA9-akxoXpEh-VLooks5upXWygaJpZM4X93Pu .

Panyidan avatar Oct 28 '18 10:10 Panyidan

我试了zh-CN和zh-TW,为什么识别结果都是粤语的……

aria-0829 avatar Nov 27 '18 08:11 aria-0829

这个看起来要接入谷歌API,是不是需要科学上网才能用。。。

XueShaoy avatar Nov 27 '18 12:11 XueShaoy

我也在用MacBook

  • Setup your env https://www.makeuseof.com/tag/install-pip-for-python/

    1. 确定你有python2 env (It does not work in python3)
    2. 2.7.9 以上的python已经有pip)
  • bash pip install autosub

  • 你需要启用 (enable) Google Translate API

    1. 这需要一个需要结算帐户 this requires a billing account, using the API key in the github constant doesn't work for me),
  • bash autosub -S en -D zh-CN -K api_key_here video_you_want_to_convert.mp4

enerestar avatar Dec 04 '18 04:12 enerestar

为什么汉语普通话的音频,识别出来文字内容像粤语的?

wwb443872831 avatar Dec 17 '18 06:12 wwb443872831

我试了zh-CN和zh-TW,为什么识别结果都是粤语的……

这个好像是因为Google Speech api见人下菜导致的,如果你的~~梯子~~……如果你的IP是香港地区的话,就算使用Zh-CN的参数,翻译出来的也会是繁体中文,而且明显是粤语繁体中文……看过代码,autosub本身并没有对此做什么检测,直接把参数传给的api,那就是api捣鬼了。我个人的解决方案是换用美国IP,暂时没有尝试过其他地区的IP识别出来的Zh-CN会变成什么样~~没钱去试那么多IP~~。

BingLingGroup avatar Feb 10 '19 07:02 BingLingGroup

你要的中文教程autosub安装使用指南(windows及ubuntu)

BingLingGroup avatar Feb 11 '19 14:02 BingLingGroup

为什么汉语普通话的音频,识别出来文字内容像粤语的?

你可能使用了香港的IP,我的教程里有讲到,其实和autosub中关于google speech api的language code过于陈旧有关系,但是依然不能解释给一个过时的语言代码,google就可以擅做主张根据你的IP随意更改zh-CN的识别结果,毕竟zh-CN再怎么变,变成yue-Hant-HK这么一个八竿子打不着,既不简体也不普通话的东西就完全不对了。

我尝试过使用香港IP和美国IP,一样的参数和音频,识别结果完全不同,是时候自己研究研究,改改autosub/autosub/constants.py

BingLingGroup avatar Feb 11 '19 16:02 BingLingGroup

我试了zh-CN和zh-TW,为什么识别结果都是粤语的……

破案了,因为开发者使用的并不是cloud speech api,所以可能并不能参考这样的语言代码得到正确的识别结果,而且事实上cloud speech api里面的语言代码也不是长这样的,有空我改改代码试试。

相关问题:#1 #111

BingLingGroup avatar Feb 13 '19 05:02 BingLingGroup

@aria-0829 我在我fork的alpha分支里已修复该问题alpha,你可以使用pip install git+https://github.com/BingLingGroup/autosub.git@alpha进行安装。我也提了pull request,可以去看 #136 。

BingLingGroup avatar Feb 14 '19 15:02 BingLingGroup

我试了zh-CN和zh-TW,为什么识别结果都是粤语的……

这个好像是因为Google Speech api见人下菜导致的,如果你的梯子……如果你的IP是香港地区的话,就算使用Zh-CN的参数,翻译出来的也会是繁体中文,而且明显是粤语繁体中文……看过代码,autosub本身并没有对此做什么检测,直接把参数传给的api,那就是api捣鬼了。我个人的解决方案是换用美国IP,暂时没有尝试过其他地区的IP识别出来的Zh-CN会变成什么样没钱去试那么多IP。

不是的呀, 用 autosub -F srt -S zh-CN -D zh-CN video.mp4 就可以生成简体中文字幕呀

gfw-breaker avatar Feb 15 '19 06:02 gfw-breaker

@gfw-breaker 我pull request #136 后面的测试写得很清楚了,香港IP会遇到问题,所以更改了语言代码,改为更精确的语言代码。不是参数怎么写的问题。

BingLingGroup avatar Feb 15 '19 06:02 BingLingGroup

谢谢@BingLingGroup 兄弟,教程很仔细,受益匪浅

ajxz avatar Feb 16 '19 14:02 ajxz

@aria-0829 我在我fork的alpha分支里已修复该问题alpha,你可以使用pip install git+https://github.com/BingLingGroup/autosub.git@alpha进行安装。我也提了pull request,可以去看 #136 。

感谢优化,试了下确实可行。这种事情果然还得大佬来解决吖,另外教程里的讲解真的简直不能更详细了,感激! /膜拜&比心

aria-0829 avatar Feb 18 '19 09:02 aria-0829

@aria-0829 其实教程那篇文章需要更新了,因为我alpha分支里面其实已经改进了许多东西,首先是语言代码改掉了,所以选项也有变化,顺便把它的那个逻辑问题改了,虽然错误信息还是有点怪还需要改进……还有就是api的url换成了https,在另一个我自己提的pull request里面提到了。以及我还增加了用于构建pyinstaller免安装版的一些兼容性代码和build需要的指令和配置文件。

而dev分支则是相对稳定的分支,所有dev分支的改动都是基于原仓库代码和一些其他人之前提出的pull request里面改动,譬如windows下的ffmpeg依赖检测和windows下的缓存删除权限,基本只是消除兼容性bug的部分。

BingLingGroup avatar Feb 19 '19 05:02 BingLingGroup

请问我用的百度的api接口代码要怎么改,调试的时候明明能看到识别出来的英语句子,可是最后出来的transcripts都是None None None怎么办啊 有改过国内api的大佬吗?

    try:
        for i in range(self.retries):
            resp = client.asr(data, self.fmat, self.rate, {
                'dev_pid': self.dev_pid,
            })
            # for line in resp.content.split("\n"):
            for line in resp['result']:
                try:
                    line = line.split(' ')# 请问需要把识别出来自的英语句子变成list吗?
                    line = json.loads(line)# 这里面好像也有问题
                    line = line['result'][0]['alternative'][0]['transcript']

                    return line[:1].upper() + line[1:]
                except:
                    # no result
                    continue

1MountainNo4400 avatar Feb 22 '19 18:02 1MountainNo4400

@ILWM 你最好看一下百度官方的文档……如果你用的是民间逆向api,最好看一下那些给出逆向api的人给出的请求方法和返回信息。 谷歌这个是因为很清楚它的返回信息和官方的api文档给出的一样,代码才这么写的。之所以你这里显示为None,估计是百度返回的json里面变量名不是这两个……如果你不懂python,建议你看一下python里的json库是怎么用的,或者看一下python的字典定义。

BingLingGroup avatar Feb 23 '19 00:02 BingLingGroup

Mac系统下的,安装过py3.7,然后用pip下了autosub,但是提示这个……哪里出错了?求问求指导~

File "/Library/Frameworks/Python.framework/Versions/3.7/bin/autosub", line 136 print "The given file does not exist: {0}".format(filename) ^ SyntaxError: invalid syntax

gaoqy219 avatar Feb 25 '19 16:02 gaoqy219

@gaoqy219 你文件名写对了吗?这里提示的是文件不存在。

还有就是,你是用我教程里面的pip VCS装的0.4.0还是PyPI装的0.3.2,据我所知0.3.2对python3的兼容性好像不是很好,0.4.0则是可以在python3环境运行。

BingLingGroup avatar Feb 26 '19 01:02 BingLingGroup

@BingLingGroup 之前那个问题是因为我用的python3.7 和 autosub0.3.2,换成0.4.0确实不报错了。然而找不到ffmpeg……明明安装了…… Package Version
autosub 0.4.0
ffmpeg 1.4

先谢谢啦,不折腾了……

gaoqy219 avatar Feb 26 '19 17:02 gaoqy219

@BingLingGroup 之前那个问题是因为我用的python3.7 和 autosub0.3.2,换成0.4.0确实不报错了。然而找不到ffmpeg……明明安装了…… Package Version autosub 0.4.0 ffmpeg 1.4

先谢谢啦,不折腾了……

@gaoqy219 找不到ffmpeg,首先确定你有没有使用修改过的代码,特别是你有没有使用我仓库里dev分支的代码(这个分支的代码使用了pull request #132 中的改进,以增强对windows平台的兼容性),其次你需要搞清楚你的ffmpeg是否在系统环境变量的路径中,是否能在命令行界面下输入ffmpeg然后看到ffmpeg有启动有输出信息。 如果你完整地看过我的教程,应该不会出问题才对,我就不再赘述了。

BingLingGroup avatar Feb 26 '19 20:02 BingLingGroup

#31 这里有详细教程,虽然不是中文版的,但是很简单,我也是中国大陆的,有问题一起讨论啊,小白一个 On Sun, Oct 28, 2018 at 5:15 PM apaperumbrella @.***> wrote: I don't know how to use it in macbook, I'm in China mainland, is it possible to use it. Who can help me, please, 3Q! 有中文版教程吗,求,谢谢。 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#112>, or mute the thread https://github.com/notifications/unsubscribe-auth/AqHw8He7BFyQcrgfA9-akxoXpEh-VLooks5upXWygaJpZM4X93Pu .

我有一个问题,如果使用这个工具很多次,会被限制吗?现在已经使用不了了,生成不了srt了

niusijian avatar Mar 13 '19 16:03 niusijian

#31 这里有详细教程,虽然不是中文版的,但是很简单,我也是中国大陆的,有问题一起讨论啊,小白一个 On Sun, Oct 28, 2018 at 5:15 PM apaperumbrella @.***> wrote: I don't know how to use it in macbook, I'm in China mainland, is it possible to use it. Who can help me, please, 3Q! 有中文版教程吗,求,谢谢。 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#112>, or mute the thread https://github.com/notifications/unsubscribe-auth/AqHw8He7BFyQcrgfA9-akxoXpEh-VLooks5upXWygaJpZM4X93Pu .

我有一个问题,如果使用这个工具很多次,会被限制吗?现在已经使用不了了,生成不了srt了

一般来讲不是使用限制,而是你的网络问题,导致无法生成。建议远程连接外网ubuntu服务器来使用autosub。

BingLingGroup avatar Mar 15 '19 03:03 BingLingGroup

此题终结,中文版且可独立运行的autosub/包含使用方法的readme现已推出

BingLingGroup avatar Jul 30 '19 12:07 BingLingGroup