Install
openclaw skills install alibabacloud-bailian-videoanalysisAlibaba Cloud Bailian Video Analysis Skill. Use for intelligent video comprehension and analysis via the Bailian (QuanMiaoLightApp) API. **Required API Product**: QuanMiaoLightApp (version 2024-08-01) **Required API Actions**: SubmitVideoAnalysisTask, GetVideoAnalysisTask **DO NOT use**: videorecog, Mts, or any other product for video analysis Triggers: "analyze video", "understand video", "analyze the local video /temp/xxx.mp4", "analyze the local video https://xxx.com/temp/xxx.mp4", "what is this video about", "summarize this video", "split video into shots", "video comprehension", "extract video insights", "transcribe video", "extract video captions", "generate video title", "generate video outline", "video mindmap".
openclaw skills install alibabacloud-bailian-videoanalysisThis skill provides video analysis functionality based on Alibaba Cloud Bailian Video Analysis Light Application. It uses the Bailian (QuanMiaoLightApp) API for intelligent video comprehension, including shot analysis, ASR transcription, title generation, caption extraction, and mind mapping.
Architecture: CLI (Credential Chain) + OSS (File Storage) + Bailian Workspace + Quanmiao Video Analysis Service + Python SDK Scripts
Detection Priority: User input language → Environment language → Default: Chinese (中文)
Apply to: All user-facing messages, summaries, error explanations, and interactive prompts.
Keep original language: Code snippets, API responses, file paths, technical identifiers, HTTP status codes.
python -m pip install -r scripts/requirements.txt
# On some systems, use pyhon3 instead of python
Pre-check: Aliyun CLI >= 3.3.1 required Run
aliyun versionto verify >= 3.3.1. If not installed or version too low, seereferences/cli-installation-guide.mdfor installation instructions. Then [MUST] runaliyun configure set --auto-plugin-install trueto enable automatic plugin installation.
AI-Mode Configuration for aliyun CLI
When using the aliyun CLI in this skill, you MUST configure AI-Mode settings:
# Enable AI-Mode (required before using CLI commands) aliyun configure ai-mode enable # Set User-Agent for tracking (required) aliyun configure ai-mode set-user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis # Update plugins to latest versions (recommended) aliyun plugin updateNote: After completing your tasks, you can disable AI-Mode:
aliyun configure ai-mode disable
Before using this skill, you must first activate the Video Analysis service in the Alibaba Cloud Bailian console!
Before using this skill, you must grant the following permissions to the previously configured AK, otherwise calls will fail and may cause 403 errors
See references/ram-policies.md for the full list of required RAM permissions and authorization instructions.
[MUST] Permission Failure Handling: When any command or API call fails due to permission errors at any point during execution, follow this process:
- Read
references/ram-policies.mdto get the full list of permissions required by this SKILL- Use
ram-permission-diagnoseskill to guide the user through requesting the necessary permissions- Pause and wait until the user confirms that the required permissions have been granted
Pre-check: Alibaba Cloud Credentials Required
Security Rules:
- NEVER read, echo, or print AK/SK values (e.g.,
echo $ALIBABA_CLOUD_ACCESS_KEY_IDis FORBIDDEN)- NEVER ask the user to input AK/SK directly in the conversation or command line
- NEVER use
aliyun configure setwith literal credential values- ONLY use
aliyun configure listto check credential statusaliyun configure listCheck the output for a valid profile (AK, STS, or OAuth identity).
If no valid profile exists, STOP here.
- Obtain credentials from Alibaba Cloud Console
- Configure credentials outside of this session (via
aliyun configurein terminal or environment variables in shell profile)- Return and re-run after
aliyun configure listshows a valid profile
IMPORTANT: Parameter Confirmation — Before executing any command or API call, confirm user-provided or customizable parameters (video source, OSS bucket, oss object key). System-auto-resolved parameters (workspace_id, default OSS bucket) do NOT require explicit confirmation unless the user wants to override them.
| Parameter | Type | Description | Default / Resolution |
|---|---|---|---|
video_source | Required | Local file path OR downloadable video URL | N/A (user must provide) |
workspace_id | Auto-resolved | Bailian workspace ID | Auto-detected(user may override) |
ossBucket | Optional | OSS bucket name for file upload | Auto-detect from first available bucket; user may specify (e.g. --ossBucket my-bucket) |
ossObjectKey | Optional | OSS object key for the uploaded file | /temp/quanmiao/YYYYMMDD/filename |
expireSeconds | Optional | Temporary URL expiration time (seconds) | 14400 (4 hours) |
Confirmation Workflow:
workspace_id and ossBucket when possible⚠️ CRITICAL: Cloud API Mandatory — This skill MUST use Bailian (QuanMiaoLightApp) API for video analysis. Local tools (ffmpeg, whisper, OpenCV, ffprobe, mediainfo, etc.) are FORBIDDEN. If API calls fail due to credentials or permissions, follow Permission Failure Handling process — DO NOT fall back to local analysis.
Run python scripts/check_env.py to verify:
If check_env.py fails or returns {"ready": false}:
python -m pip install -r scripts/requirements.txtreferences/ram-policies.md to get required permissionsram-permission-diagnose skill to guide user through permission requestExpected output: {"ready": true} indicates environment is properly configured.
Do not ask the user for workspace_id upfront. Always auto-fetch available workspaces first:
aliyun modelstudio list-workspaces --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis
Workspace selection logic:
Based on the input resource type from Input Resource Validation:
Case A: User provided a downloadable URL
→ Verify URL accessibility: Test if the URL is downloadable using appropriate method for your OS
→ Skip this step. Use the video_source as file_url in Step 4.
Case B: User provided a local file path → Auto-detects OSS bucket、Upload local file to OSS and get a temporary URL(file_url) for Step 4:
--ossBucket <bucket_name>, attempt to use that bucketaliyun ossutil ls --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis
IMPORTANT - Upload Path Restriction:
/temp/quanmiao/YYYYMMDD/filename format (auto-generated with current date)/temp/quanmiao/ prefix unless user explicitly requests italiyun ossutil cp <video_source> oss://{oss_bucket}/{oss_object_key} --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis --region {oss_region}
ossutil sign command.
--expireSeconds: Default 14400s (4 hours), confirm if different value neededaliyun ossutil sign oss://{oss_bucket}/{oss_object_key} --expires-duration {expire_seconds} --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis --region {oss_region}
Recommended validation URL downloadable methods:
curl -L --connect-timeout 10 --max-time 30 -o /dev/null -w "%{http_code}" <file_url> (returns HTTP status code)Invoke-WebRequest -Uri <file_url> -Method Head -TimeoutSec 30 (PowerShell)Validation criteria:
ossutil sign⚠️ MANDATORY API CALL — You MUST call SubmitVideoAnalysisTask on QuanMiaoLightApp product (version 2024-08-01). Do NOT use videorecog, Mts, or any other product. Do NOT attempt local analysis.
API Selection Checklist — Before calling, verify:
- ✅ Product: QuanMiaoLightApp (NOT videorecog, NOT Mts)
- ✅ Version: 2024-08-01
- ✅ Action: SubmitVideoAnalysisTask
- ✅ Parameters: workspace_id, file_url
python scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id <workspace_id> --file_url <file_url>
Parameters requiring confirmation:
--workspace_id: From Step 2 (confirm with user)--file_url: From Step 3 upload result or user-provided URL (confirm validity)Error Handling:
Returns task_id for polling.
⚠️ MANDATORY API CALL — You MUST poll GetVideoAnalysisTask on QuanMiaoLightApp product (version 2024-08-01) until status is SUCCESSED. Do NOT generate summary from local tools or filename inference.
Video analysis is asynchronous. Poll until completion:
Task Status: PENDING → RUNNING → SUCCESSED | FAILED | CANCELED
Variables:
result_json_path: ~/.quanmiao/videoanalysis/<video_filename_without_ext>_<task_id>.jsonindex_file: ~/.quanmiao/videoanalysis/index.jsonlPolling Loop:
python scripts/quanmiao_get_videoAnalysis_task_result.py --workspace_id <workspace_id> --task_id <task_id> --save_path <result_json_path>status field:
SUCCESSED → Script auto-saves JSON to result_json_path, append entry to index_file, display saved locations, then proceed to Step 6FAILED or CANCELED → check error message, inform user, stopPENDING or RUNNING → display any partial results available, wait 10s, repeat from step 2When taskStatus = SUCCESSED:
Append to index file (index_file):
{"task_id": "<task_id>", "video_source": "<original_path_or_url>", "workspace_id": "<workspace_id>", "result_file": "<result_json_path>", "timestamp": "<ISO8601>"}
Display saved locations:
✅ Files saved successfully:
- Raw JSON result: <result_json_path>
- Index updated: <index_file>
Parameters requiring confirmation:
--workspace_id: Same as Step 4 (confirm consistency)--task_id: From Step 4 submission result (verify before polling)CRITICAL: Use the results from Step 5 directly. Do NOT call the API again. Do NOT re-execute any analysis.
Extract data from the SUCCESSED response obtained in Step 5 and summarize according to user requirements.
Case A: If the user has a specific analysis request (e.g., "analyze the speaker's body language", "extract key business insights", "compare two people in the video"), base your answer primarily on:
payload.output.videoGenerateResults — scene-by-scene analysis, descriptions, interpretationspayload.output.videoAnalysisResult.text — visual shot analysis, object/person recognition, action detection
Combine these fields to construct a targeted answer. Supplement with other fields (captions, mind map, title) as context if relevant.Case B: If no specific request, use the standard output format: Title → Outline → Summary → Captions → Shot Analysis → Timeline → Token Usage
ram-policies.md~/.quanmiao/videoanalysis/index.jsonl before re-analyzing same videoSee references/verification-method.md for step-by-step verification commands and expected outcomes.
To clean up resources created by this skill:
Delete uploaded OSS objects:
aliyun ossutil rm oss://{oss_bucket}/{oss_object_key} --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis
Cleanup best practices:
/temp/quanmiao/ prefix to avoid accidental data loss~/.quanmiao/videoanalysis/ can be kept for future reference or deleted manuallycheck_env.py before any other operation to catch missing dependencies or credentials early.list-workspaces; default to the first result, but present a selection list when the user explicitly asks to choose.RUNNING, show available results (title, captions) to give the user real-time feedback.SUCCESSED, use the full result payload directly for Step 6 without re-calling the API.expireSeconds (default 14400s); ensure the task is submitted before the URL expires.See references/related-commands.md for the full list of available scripts and their parameters.
| Reference | Purpose |
|---|---|
references/cli-installation-guide.md | Installing and upgrading Aliyun CLI |
references/ram-policies.md | RAM permission checklist and authorization guide |
references/acceptance-criteria.md | Acceptance criteria and correct/incorrect usage patterns |
references/related-commands.md | Available scripts and CLI command reference |
references/verification-method.md | Step-by-step success verification commands |
Common scenarios: