Alibaba Cloud Bailian - Video to Text: Local Video Speech Transcription

Preface

When reviewing short videos, organizing spoken scripts, or archiving meeting recordings, the common practices are manual transcription or uploading files to third-party websites to export subtitles. The former is time-consuming, while the latter is unfriendly to local paths, batch processing, and automation within Agent conversations. The following introduces the community Skill on SkillHub: “Alibaba Cloud Bailian - Video to Text” (Coordinates @user_238e6fa6/aliyun-video2text, Version 1.0.0). Once triggered on the Agent side according to the universal SKILL.md convention, it uses local scripts to extract audio, upload files, and call Alibaba Bailian speech recognition, returning the results as structured JSONL.

What is this

One-sentence positioning: Extract speech from local video files, store them temporarily via Alibaba Cloud OSS, call the Alibaba Bailian Paraformer-v2 transcription API, and output text transcripts.

  • Publisher & Maintenance: Categorized as content-creation on SkillHub, sourced from the community, and published by user_238e6fa6 (the SkillHub page attributes the authorship to “托利亚斯”).
  • Problem Solved: When users describe needs in natural language within a conversation (e.g., “video to text,” “speech transcription”), the Agent can follow a fixed workflow guided by the Skill, rather than manually writing ffmpeg and API calls every time.
  • Official Entry: SkillHub Skill Page; The API metadata address is https://api.skillhub.cn/user_238e6fa6/aliyun-video2text. The page indicates requires_api_key=true, requiring the user to configure Alibaba Cloud and DashScope credentials independently.

Core Functions

The following capabilities are derived from the Skill’s SKILL.md and accompanying script documentation, and have been verified:

  1. Local Video Audio Extraction: Depends on a system-available ffmpeg to convert audio from videos to mp3.
  2. OSS Transit: Audio is uploaded to the configured Alibaba Cloud OSS Bucket, generating a temporary URL for the transcription service to retrieve.
  3. Bailian Transcription: Calls the DashScope transcription capability (documented as Paraformer-v2) and polls the task until completion.
  4. Output Transcript: The standard output is JSONL (one JSON per line), containing a single video_result entry and a final summary, facilitating streaming reading and batch aggregation.

Trigger Keywords (used by the Agent to match user intent): video to text, extract video transcript, video speech to text, short video script extraction, video script extraction, speech transcription.

Installation and Activation

Install via SkillHub

The installation prompt provided on the SkillHub page is: Refer to SkillHub Installation & Priority Source Configuration and install the coordinates @user_238e6fa6/aliyun-video2text.

If the skillhub CLI is already installed on your machine, you need to use --dir to point to the current Agent’s skills directory during installation; otherwise, it defaults to ./skills/ and may not be recognized. Example:

command -v skillhub && skillhub --version

If the CLI is not installed, follow the official documentation (full installation includes CLI and default Skills):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

Install this Skill (replace <skills directory> with the path in your current environment):

skillhub install user_238e6fa6/aliyun-video2text --dir <skills directory>

Skills directories for common Agents (excerpted from SkillHub installation docs; subject to your local machine):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

You can also ask the AI in the conversation to complete the installation according to the install documentation above. After installation, restart or refresh the Agent’s loading strategy for skills (refer to your client’s documentation).

Prerequisites and Credentials

1. Install ffmpeg

Linux (Ubuntu/Debian) example:

sudo apt install ffmpeg

For macOS, use brew install ffmpeg; for Windows, winget install ffmpeg is available, etc. See the SKILL.md within the Skill for details.

2. Configure environment variables or .env in the Skill directory

# Alibaba Cloud DashScope API Key (Required)
DASHSCOPE_API_KEY=your-dashscope-api-key

# Alibaba Cloud OSS Configuration (Required)
ALIYUN_ACCESS_KEY_ID=your-access-key-id
ALIYUN_ACCESS_KEY_SECRET=your-access-key-secret
ALIYUN_OSS_BUCKET=your-bucket-name
ALIYUN_OSS_ENDPOINT=oss-cn-beijing.aliyuncs.com

The script reads .env from the Skill root directory by default (at the same level as scripts/). Before running, ensure Python 3 and script dependencies (such as requests) are installed on your machine, and execute the commands below in the Skill root directory.

Typical Usage

After entering the installed @user_238e6fa6/aliyun-video2text directory, pass JSON arguments via scripts/video2text.py.

Single Video:

python3 scripts/video2text.py '{"video": "/path/to/video.mp4"}'

Multiple Videos:

python3 scripts/video2text.py '{"videos": ["/path/video1.mp4", "/path/video2.mp4"]}'

Specify Output Directory:

python3 scripts/video2text.py '{"video": "/path/to/video.mp4", "output_dir": "/path/to/output"}'

Output Example (Single line JSONL):

{"type": "video_result", "index": 0, "video_path": "/path/to/video.mp4", "status": "completed", "text": "Video transcript content...", "duration": 65000}

The summary line format is {"type": "summary", "status": "completed", "total": 3, "completed": 2, "failed": 1}. When the Agent triggers this Skill in a conversation, it should guide the user to provide local paths and credentials, then execute via the above entry or an equivalent wrapper.

Documented Processing Order: Validate ffmpeg → Extract audio to mp3 → Upload to OSS → Create transcription task → Poll status → Output text.

Scenarios and Notes

Who is it for

  • Creators, operators, or developers working in Skill-supported environments like Cursor, Claude Code, or Codex who need to complete “Local Video → Chinese Text” with a single command.
  • Teams that already possess or can apply for Alibaba Cloud OSS and DashScope (Bailian) API keys.

Format and Scale Limits (Stated in Skill Documentation)

  • Videos: mp4, avi, mov, mkv, flv, wmv; single file maximum 500MB.
  • Audio files can also be processed directly: mp3, wav, m4a, pcm.
  • Transcription Language: Mandarin Chinese; duration is handled server-side with no hard limit (subject to API and billing actuals).

Usage Notes

  • Audio is temporarily stored via OSS; ensure Bucket, Endpoint, and key permissions are correct. Do not commit credentials to repositories.
  • The script will provide error messages if ffmpeg is unavailable, credentials are missing, or OSS/transcription fails. In batch scenarios, a single failure allows continuation with other files (see Skill error handling description).
  • SkillHub Statistics (Scraped Data): Rating 100000, Downloads 3867, Installs 121; This is a community Skill. Behavior is subject to the SKILL.md and scripts in the repository. If there are discrepancies with official Alibaba Cloud product documentation, please refer to the console and API documentation.

Conclusion

“Alibaba Cloud Bailian - Video to Text” ties together local audio extraction, OSS transit, and Paraformer-v2 transcription into a reproducible pipeline, written as a Skill recognizable by Agents. It is suitable for handling “video to text” type needs within conversations. For installation and details, see the SkillHub Skill Page.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye