Skip to main content

Autosub-baidu

Auto-generated subtitles for any video

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

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

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

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

  1. 短语音识别标准版产品首页
  2. 百度AI开放平台语音技术新手入门 (通过阅读可以了解如何获得API_KEY、SECRET_KEY和APP_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

Metadata

Release files for autosub-baidu 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autosub-baidu 0.2.0
File Size Uploaded Provenance Actions
autosub-baidu-0.2.0.tar.gz 7.9 kB Without provenance Details for autosub-baidu-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for autosub-baidu 0.2.0
File Interpreter ABI Platform Actions
autosub_baidu-0.2.0-py3-none-any.whl Python 3 none any Details for autosub_baidu-0.2.0-py3-none-any.whl

Total release size: 16.2 kB

Release files / autosub-baidu-0.2.0.tar.gz

Download URL autosub-baidu-0.2.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
58f569332f5e490c441b33ae47fadf1e20ca297eefcc6f0f570914484523e46d
BLAKE2b-256 checksum
How to use checksums
5ce3ab729acffd42db79869396fe7564f561b0b00a857e5dd73edcf7f8783074
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / autosub_baidu-0.2.0-py3-none-any.whl

Download URL autosub_baidu-0.2.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1357de564c78b30bf7542e49bc102a61af1b634dfb43c5977fa3429fd3a25ff
BLAKE2b-256 checksum
How to use checksums
37ccdf4f57782dd75abdc6b06ee412c79a767b64bd990e3df28657da531d3638
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for autosub-baidu 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page