[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-101c68a4-6283-4705-bb5b-9ab00fe387f8":3,"$fnZBuf0DjAQIqAdLLo48NLnGm9V0-5f3woI18VlJnVfo":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"101c68a4-6283-4705-bb5b-9ab00fe387f8","videodb","视频和音频感知、索引和编辑。导入文件\u002FURL\u002F直播流，构建视觉\u002F语音索引，按时间戳搜索，编辑时间线，添加叠加\u002F字幕，生成媒体，创建实时警报。","cat_design_graphic","mod_design","sickn33,design","---\nname: videodb\ndescription: Video and audio perception, indexing, and editing. Ingest files\u002FURLs\u002Flive streams, build visual\u002Fspoken indexes, search with timestamps, edit timelines, add overlays\u002Fsubtitles, generate media, and create real-time alerts.\ncategory: media\nrisk: safe\nsource: community\ntags: \"[video, editing, transcription, subtitles, search, streaming, ai-generation, media, live-streams, desktop-capture]\"\ndate_added: \"2026-02-27\"\nallowed-tools: Read Grep Glob Bash(python:*)\nargument-hint: \"[task description]\"\n---\n\n# VideoDB Skill\n\n**Perception + memory + actions for video, live streams, and desktop sessions.**\n\nUse this skill when you need to:\n\n## When to Use\n- You need video or audio perception, indexing, search, or timeline editing from files, URLs, desktop sessions, or live streams.\n- The task involves timestamps, searchable evidence, subtitles, clips, overlays, or real-time monitoring alerts.\n- You want one workflow that combines ingestion, understanding, retrieval, and media actions.\n\n## 1) Desktop Perception\n- Start\u002Fstop a **desktop session** capturing **screen, mic, and system audio**\n- Stream **live context** and store **episodic session memory**\n- Run **real-time alerts\u002Ftriggers** on what's spoken and what's happening on screen\n- Produce **session summaries**, a searchable timeline, and **playable evidence links**\n\n## 2) Video ingest + stream\n- Ingest a **file or URL** and return a **playable web stream link**\n- Transcode\u002Fnormalize: **codec, bitrate, fps, resolution, aspect ratio**\n\n## 3) Index + search (timestamps + evidence)\n- Build **visual**, **spoken**, and **keyword** indexes\n- Search and return exact moments with **timestamps** and **playable evidence**\n- Auto-create **clips** from search results\n\n## 4) Timeline editing + generation\n- Subtitles: **generate**, **translate**, **burn-in**\n- Overlays: **text\u002Fimage\u002Fbranding**, motion captions\n- Audio: **background music**, **voiceover**, **dubbing**\n- Programmatic composition and exports via **timeline operations**\n\n## 5) Live streams (RTSP) + monitoring\n- Connect **RTSP\u002Flive feeds**\n- Run **real-time visual and spoken understanding** and emit **events\u002Falerts** for monitoring workflows\n\n---\n\n## Common inputs\n- Local **file path**, public **URL**, or **RTSP URL**\n- Desktop capture request: **start \u002F stop \u002F summarize session**\n- Desired operations: get context for understanding, transcode spec, index spec, search query, clip ranges, timeline edits, alert rules\n\n## Common outputs\n- **Stream URL**\n- Search results with **timestamps** and **evidence links**\n- Generated assets: subtitles, audio, images, clips\n- **Event\u002Falert payloads** for live streams\n- Desktop **session summaries** and memory entries\n\n---\n\n## Canonical prompts (examples)\n- \"Start desktop capture and alert when a password field appears.\"\n- \"Record my session and produce an actionable summary when it ends.\"\n- \"Ingest this file and return a playable stream link.\"\n- \"Index this folder and find every scene with people, return timestamps.\"\n- \"Generate subtitles, burn them in, and add light background music.\"\n- \"Connect this RTSP URL and alert when a person enters the zone.\"\n\n## Running Python code\n\nBefore running any VideoDB code, change to the project directory and load environment variables:\n\n```python\nfrom dotenv import load_dotenv\nload_dotenv(\".env\")\n\nimport videodb\nconn = videodb.connect()\n```\n\nThis reads `VIDEO_DB_API_KEY` from:\n1. Environment (if already exported)\n2. Project's `.env` file in current directory\n\nIf the key is missing, `videodb.connect()` raises `AuthenticationError` automatically.\n\nDo NOT write a script file when a short inline command works.\n\nWhen writing inline Python (`python -c \"...\"`), always use properly formatted code — use semicolons to separate statements and keep it readable. For anything longer than ~3 statements, use a heredoc instead:\n\n```bash\npython \u003C\u003C 'EOF'\nfrom dotenv import load_dotenv\nload_dotenv(\".env\")\n\nimport videodb\nconn = videodb.connect()\ncoll = conn.get_collection()\nprint(f\"Videos: {len(coll.get_videos())}\")\nEOF\n```\n\n## Setup\n\nWhen the user asks to \"setup videodb\" or similar:\n\n### 1. Install SDK\n\n```bash\npip install \"videodb[capture]\" python-dotenv\n```\n\nIf `videodb[capture]` fails on Linux, install without the capture extra:\n\n```bash\npip install videodb python-dotenv\n```\n\n### 2. Configure API key\n\nThe user must set `VIDEO_DB_API_KEY` using **either** method:\n\n- **Export in terminal** (before starting Claude): `export VIDEO_DB_API_KEY=your-key`\n- **Project `.env` file**: Save `VIDEO_DB_API_KEY=your-key` in the project's `.env` file\n\nGet a free API key at https:\u002F\u002Fconsole.videodb.io (50 free uploads, no credit card).\n\n**Do NOT** read, write, or handle the API key yourself. Always let the user set it.\n\n## Quick Reference\n\n### Upload media\n\n```python\n# URL\nvideo = coll.upload(url=\"https:\u002F\u002Fexample.com\u002Fvideo.mp4\")\n\n# YouTube\nvideo = coll.upload(url=\"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=VIDEO_ID\")\n\n# Local file\nvideo = coll.upload(file_path=\"\u002Fpath\u002Fto\u002Fvideo.mp4\")\n```\n\n### Transcript + subtitle\n\n```python\n# force=True skips the error if the video is already indexed\nvideo.index_spoken_words(force=True)\ntext = video.get_transcript_text()\nstream_url = video.add_subtitle()\n```\n\n### Search inside videos\n\n```python\nfrom videodb.exceptions import InvalidRequestError\n\nvideo.index_spoken_words(force=True)\n\n# search() raises InvalidRequestError when no results are found.\n# Always wrap in try\u002Fexcept and treat \"No results found\" as empty.\ntry:\n    results = video.search(\"product demo\")\n    shots = results.get_shots()\n    stream_url = results.compile()\nexcept InvalidRequestError as e:\n    if \"No results found\" in str(e):\n        shots = []\n    else:\n        raise\n```\n\n### Scene search\n\n```python\nimport re\nfrom videodb import SearchType, IndexType, SceneExtractionType\nfrom videodb.exceptions import InvalidRequestError\n\n# index_scenes() has no force parameter — it raises an error if a scene\n# index already exists. Extract the existing index ID from the error.\ntry:\n    scene_index_id = video.index_scenes(\n        extraction_type=SceneExtractionType.shot_based,\n        prompt=\"Describe the visual content in this scene.\",\n    )\nexcept Exception as e:\n    match = re.search(r\"id\\s+([a-f0-9]+)\", str(e))\n    if match:\n        scene_index_id = match.group(1)\n    else:\n        raise\n\n# Use score_threshold to filter low-relevance noise (recommended: 0.3+)\ntry:\n    results = video.search(\n        query=\"person writing on a whiteboard\",\n        search_type=SearchType.semantic,\n        index_type=IndexType.scene,\n        scene_index_id=scene_index_id,\n        score_threshold=0.3,\n    )\n    shots = results.get_shots()\n    stream_url = results.compile()\nexcept InvalidRequestError as e:\n    if \"No results found\" in str(e):\n        shots = []\n    else:\n        raise\n```\n\n### Timeline editing\n\n**Important:** Always validate timestamps before building a timeline:\n- `start` must be >= 0 (negative values are silently accepted but produce broken output)\n- `start` must be \u003C `end`\n- `end` must be \u003C= `video.length`\n\n```python\nfrom videodb.timeline import Timeline\nfrom videodb.asset import VideoAsset, TextAsset, TextStyle\n\ntimeline = Timeline(conn)\ntimeline.add_inline(VideoAsset(asset_id=video.id, start=10, end=30))\ntimeline.add_overlay(0, TextAsset(text=\"The End\", duration=3, style=TextStyle(fontsize=36)))\nstream_url = timeline.generate_stream()\n```\n\n### Transcode video (resolution \u002F quality change)\n\n```python\nfrom videodb import TranscodeMode, VideoConfig, AudioConfig\n\n# Change resolution, quality, or aspect ratio server-side\njob_id = conn.transcode(\n    source=\"https:\u002F\u002Fexample.com\u002Fvideo.mp4\",\n    callback_url=\"https:\u002F\u002Fexample.com\u002Fwebhook\",\n    mode=TranscodeMode.economy,\n    video_config=VideoConfig(resolution=720, quality=23, aspect_ratio=\"16:9\"),\n    audio_config=AudioConfig(mute=False),\n)\n```\n\n### Reframe aspect ratio (for social platforms)\n\n**Warning:** `reframe()` is a slow server-side operation. For long videos it can take\nseveral minutes and may time out. Best practices:\n- Always limit to a short segment using `start`\u002F`end` when possible\n- For full-length videos, use `callback_url` for async processing\n- Trim the video on a `Timeline` first, then reframe the shorter result\n\n```python\nfrom videodb import ReframeMode\n\n# Always prefer reframing a short segment:\nreframed = video.reframe(start=0, end=60, target=\"vertical\", mode=ReframeMode.smart)\n\n# Async reframe for full-length videos (returns None, result via webhook):\nvideo.reframe(target=\"vertical\", callback_url=\"https:\u002F\u002Fexample.com\u002Fwebhook\")\n\n# Presets: \"vertical\" (9:16), \"square\" (1:1), \"landscape\" (16:9)\nreframed = video.reframe(start=0, end=60, target=\"square\")\n\n# Custom dimensions\nreframed = video.reframe(start=0, end=60, target={\"width\": 1280, \"height\": 720})\n```\n\n### Generative media\n\n```python\nimage = coll.generate_image(\n    prompt=\"a sunset over mountains\",\n    aspect_ratio=\"16:9\",\n)\n```\n\n## Error handling\n\n```python\nfrom videodb.exceptions import AuthenticationError, InvalidRequestError\n\ntry:\n    conn = videodb.connect()\nexcept AuthenticationError:\n    print(\"Check your VIDEO_DB_API_KEY\")\n\ntry:\n    video = coll.upload(url=\"https:\u002F\u002Fexample.com\u002Fvideo.mp4\")\nexcept InvalidRequestError as e:\n    print(f\"Upload failed: {e}\")\n```\n\n### Common pitfalls\n\n| Scenario | Error message | Solution |\n|----------|--------------|----------|\n| Indexing an already-indexed video | `Spoken word index for video already exists` | Use `video.index_spoken_words(force=True)` to skip if already indexed |\n| Scene index already exists | `Scene index with id XXXX already exists` | Extract the existing `scene_index_id` from the error with `re.search(r\"id\\s+([a-f0-9]+)\", str(e))` |\n| Search finds no matches | `InvalidRequestError: No results found` | Catch the exception and treat as empty results (`shots = []`) |\n| Reframe times out | Blocks indefinitely on long videos | Use `start`\u002F`end` to limit segment, or pass `callback_url` for async |\n| Negative timestamps on Timeline | Silently produces broken stream | Always validate `start >= 0` before creating `VideoAsset` |\n| `generate_video()` \u002F `create_collection()` fails | `Operation not allowed` or `maximum limit` | Plan-gated features — inform the user about plan limits |\n\n## Additional docs\n\nReference documentation is in the `reference\u002F` directory adjacent to this SKILL.md file. Use the Glob tool to locate it if needed.\n\n- [reference\u002Fapi-reference.md](reference\u002Fapi-reference.md) - Complete VideoDB Python SDK API reference\n- [reference\u002Fsearch.md](reference\u002Fsearch.md) - In-depth guide to video search (spoken word and scene-based)\n- [reference\u002Feditor.md](reference\u002Feditor.md) - Timeline editing, assets, and composition\n- [reference\u002Fstreaming.md](reference\u002Fstreaming.md) - HLS streaming and instant playback\n- [reference\u002Fgenerative.md](reference\u002Fgenerative.md) - AI-powered media generation (images, video, audio)\n- [reference\u002Frtstream.md](reference\u002Frtstream.md) - Live stream ingestion workflow (RTSP\u002FRTMP)\n- [reference\u002Frtstream-reference.md](reference\u002Frtstream-reference.md) - RTStream SDK methods and AI pipelines\n- [reference\u002Fcapture.md](reference\u002Fcapture.md) - Desktop capture workflow\n- [reference\u002Fcapture-reference.md](reference\u002Fcapture-reference.md) - Capture SDK and WebSocket events\n- [reference\u002Fuse-cases.md](reference\u002Fuse-cases.md) - Common video processing patterns and examples\n\n## Screen Recording (Desktop Capture)\n\nUse `ws_listener.py` to capture WebSocket events during recording sessions. Desktop capture supports **macOS** only.\n\n### Quick Start\n\n1. **Start listener**: `python scripts\u002Fws_listener.py &`\n2. **Get WebSocket ID**: `cat \u002Ftmp\u002Fvideodb_ws_id`\n3. **Run capture code** (see reference\u002Fcapture.md for full workflow)\n4. **Events written to**: `\u002Ftmp\u002Fvideodb_events.jsonl`\n\n### Query Events\n\n```python\nimport json\nevents = [json.loads(l) for l in open(\"\u002Ftmp\u002Fvideodb_events.jsonl\")]\n\n# Get all transcripts\ntranscripts = [e[\"data\"][\"text\"] for e in events if e.get(\"channel\") == \"transcript\"]\n\n# Get visual descriptions from last 5 minutes\nimport time\ncutoff = time.time() - 300\nrecent_visual = [e for e in events \n                 if e.get(\"channel\") == \"visual_index\" and e[\"unix_ts\"] > cutoff]\n```\n\n### Utility Scripts\n\n- [scripts\u002Fws_listener.py](scripts\u002Fws_listener.py) - WebSocket event listener (dumps to JSONL)\n\nFor complete capture workflow, see [reference\u002Fcapture.md](reference\u002Fcapture.md).\n\n**Do not use ffmpeg, moviepy, or local encoding tools** when VideoDB supports the operation. The following are all handled server-side by VideoDB — trimming, combining clips, overlaying audio or music, adding subtitles, text\u002Fimage overlays, transcoding, resolution changes, aspect-ratio conversion, resizing for platform requirements, transcription, and media generation. Only fall back to local tools for operations listed under Limitations in reference\u002Feditor.md (transitions, speed changes, crop\u002Fzoom, colour grading, volume mixing).\n\n### When to use what\n\n| Problem | VideoDB solution |\n|---------|-----------------|\n| Platform rejects video aspect ratio or resolution | `video.reframe()` or `conn.transcode()` with `VideoConfig` |\n| Need to resize video for Twitter\u002FInstagram\u002FTikTok | `video.reframe(target=\"vertical\")` or `target=\"square\"` |\n| Need to change resolution (e.g. 1080p → 720p) | `conn.transcode()` with `VideoConfig(resolution=720)` |\n| Need to overlay audio\u002Fmusic on video | `AudioAsset` on a `Timeline` |\n| Need to add subtitles | `video.add_subtitle()` or `CaptionAsset` |\n| Need to combine\u002Ftrim clips | `VideoAsset` on a `Timeline` |\n| Need to generate voiceover, music, or SFX | `coll.generate_voice()`, `generate_music()`, `generate_sound_effect()` |\n\n## Repository\n\nhttps:\u002F\u002Fgithub.com\u002Fvideo-db\u002Fskills\n\n**Maintained By:** [VideoDB](https:\u002F\u002Fgithub.com\u002Fvideo-db)\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,202,1480,"2026-05-16 13:46:24",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"设计创意","design","mdi-palette-outline","UI 设计、生成艺术、品牌视觉等创意 Skill",3,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"视觉创意","graphic","mdi-brush","海报、Logo、插画等视觉创作",2,48,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"b3a07f3a-5db7-47bc-a614-03ca5ad60bf9","1.0.0","videodb.zip",42735,"uploads\u002Fskills\u002F101c68a4-6283-4705-bb5b-9ab00fe387f8\u002Fvideodb.zip","cfe41f3bcffeaf4836ad4a2d9687064d78f8d6b776474cd73400c0022c410c39","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":14145},{\"path\":\"reference\u002Fapi-reference.md\",\"isDirectory\":false,\"size\":20329},{\"path\":\"reference\u002Fcapture-reference.md\",\"isDirectory\":false,\"size\":11093},{\"path\":\"reference\u002Fcapture.md\",\"isDirectory\":false,\"size\":4847},{\"path\":\"reference\u002Feditor.md\",\"isDirectory\":false,\"size\":16326},{\"path\":\"reference\u002Fgenerative.md\",\"isDirectory\":false,\"size\":9836},{\"path\":\"reference\u002Frtstream-reference.md\",\"isDirectory\":false,\"size\":14791},{\"path\":\"reference\u002Frtstream.md\",\"isDirectory\":false,\"size\":1881},{\"path\":\"reference\u002Fsearch.md\",\"isDirectory\":false,\"size\":7928},{\"path\":\"reference\u002Fstreaming.md\",\"isDirectory\":false,\"size\":9844},{\"path\":\"reference\u002Fuse-cases.md\",\"isDirectory\":false,\"size\":4451},{\"path\":\"scripts\u002Fws_listener.py\",\"isDirectory\":false,\"size\":7725}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]