Skip to main content

Auto-generates subtitles for any video or audio file. (Using Baidu AIP)

Project description

Autosub-baidu

Auto-generated subtitles for any video

Autosub 是用于自动语音识别和字幕生成的实用程序。

但是这个项目已经不再维护了,而且在中国使用有些困难。 于是我克隆了这个项目的代码,在内部把Google Web Speech API替换为了百度短语音识别API

项目结构也做出了一些修改,使其即可以在命令行使用,也可以在其他代码中导入使用(主要目的是方便在代码中使用)。语言也改为了仅支持中文。

运行参数有些不一样,要想顺利使用这个新项目你必须提供API_KEYSECRET_KEYAPP_ID。这里贴出了一些链接,可以跟随这些链接去自行探索:

  1. 短语音识别标准版产品首页
  2. 百度AI开放平台语音技术新手入门 (通过阅读可以了解如何获得API_KEYSECRET_KEYAPP_ID

Autosub is a utility for automatic speech recognition and subtitle generation.

But this project is no longer maintained, and it is somewhat difficult to use in China. So I cloned the code of this project and replaced Google Web Speech API with Baidu Short Speech Recognition API internally.

Now Autosub-baidu only supports Chinese.

Installation

  1. Install ffmpeg.
  2. Run pip install autosub-baidu.

Usage

python -m autosubb -h
usage: __main__.py [-h] [-C CONCURRENCY] [-o OUTPUT] [-F FORMAT] [-L LANG] [-K API_KEY] [-S SECRET_KEY] [-A APP_ID]
                   [--list-formats] [--list-languages]
                   [source_path]

positional arguments:
  source_path           Path to the video or audio file to subtitle

optional arguments:
  -h, --help            show this help message and exit
  -C CONCURRENCY, --concurrency CONCURRENCY
                        Number of concurrent API requests to make
  -o OUTPUT, --output OUTPUT
                        Output path for subtitles (by default, subtitles are saved in the same directory and name as
                        the source path)
  -F FORMAT, --format FORMAT
                        Destination subtitle format
  -L LANG, --lang LANG  Language spoken in source file. default 1537.
  -K API_KEY, --api-key API_KEY
                        The Baidu Cloud API key to be used.
  -S SECRET_KEY, --secret-key SECRET_KEY
                        The Baidu Cloud Secret Key to be used.
  -A APP_ID, --app-id APP_ID
                        The Baidu Cloud AppID to be used.
  --list-formats        List all available subtitle formats
  --list-languages      List all available source/destination languages

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autosub-baidu-0.2.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

autosub_baidu-0.2.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file autosub-baidu-0.2.0.tar.gz.

File metadata

  • Download URL: autosub-baidu-0.2.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

File hashes

Hashes for autosub-baidu-0.2.0.tar.gz
Algorithm Hash digest
SHA256 58f569332f5e490c441b33ae47fadf1e20ca297eefcc6f0f570914484523e46d
MD5 3f51853fe82a7cf47d0ec674ed12c80b
BLAKE2b-256 5ce3ab729acffd42db79869396fe7564f561b0b00a857e5dd73edcf7f8783074

See more details on using hashes here.

File details

Details for the file autosub_baidu-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: autosub_baidu-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

File hashes

Hashes for autosub_baidu-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1357de564c78b30bf7542e49bc102a61af1b634dfb43c5977fa3429fd3a25ff
MD5 b45831eb6859225415db056b4012517b
BLAKE2b-256 37ccdf4f57782dd75abdc6b06ee412c79a767b64bd990e3df28657da531d3638

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page