--- name: video-media-production-operations description: 'Use when working with web video assets or AI video production pipelines: extracting embedded/player-hidden streams, downloading and archiving catalogs, generating Venice API assets, maintaining character consistency, and handing clips into manual studio/timeline assembly.' version: 1.0.0 author: Hermes Agent license: MIT metadata: hermes: tags: [video, media, extraction, archival, venice, ai-video, hls, production] related_skills: [youtube-content, video-watch, venice-video, venice-image-generate, embedded-video-extraction, venice-studio-production] --- # Video & Media Production Operations ## Overview Use this umbrella for two recurring video classes: 1. **Recovering and archiving videos from web players** the user legitimately has access to. 2. **Producing AI video assets** with Venice/Hermes and assembling them in a studio/timeline environment. The absorbed skills are preserved under `references/absorbed/` for player recipes, scripts, Venice workflow details, and session-specific notes. ## When to Use - A page shows only a `blob:` video URL and the user needs the real MP4/HLS source. - Downloading a catalog of gated videos for archival/upload to S3. - Generating character-consistent AI video shots, references, or music/audio stems. - Planning a hybrid Hermes API + Venice Studio editing workflow. ## Embedded Video Extraction Core rule: a `blob:` URL is never the downloadable source. Inspect DOM, script configs, iframes, and especially `performance.getEntriesByType('resource')` for `.m3u8`, `.mp4`, `.mpd`, Wistia/JWPlayer/Squarespace/Vimeo URLs. Download with `yt-dlp`, passing the correct Referer and fresh signed URL/cookies where needed. Verify the final file with `ffprobe` so a 4KB error page does not masquerade as a video. For multi-video catalogs, launch a `terminal(background=true, notify_on_complete=true)` pipeline with idempotent `.done` markers and a stable manifest path. Preserve credential hygiene after gated downloads. ### Instagram authenticated browsing and 2FA When Instagram's web login returns a generic “incorrect login information” response even though the supplied credentials may be valid, do not conclude the account is dead from the web form alone. A proven lane is: 1. Keep one stable ISP/residential proxy and use it for both login and later downloads; verify the browser itself exits through it. 2. Use `instaloader` for the initial login. Load account values from a protected CSV/secret file rather than retyping them into shell argv. 3. If `TwoFactorAuthRequiredException` is raised, generate the six-digit RFC 6238 TOTP locally from the Base32 seed (30-second window) and call `two_factor_login(code)` immediately. 4. Save the successful Instaloader session under a protected data path and export its Requests cookie jar to a mode-`0600` Netscape cookie file for `gallery-dl`/`yt-dlp`. 5. Import those cookies into the persistent Camofox `userId` through `POST /sessions/:userId/cookies`; the persistence plugin checkpoints `storage-state.json` on cookie import. Verify the saved state contains a `sessionid` cookie without printing its value. 6. Prove browser auth by opening `/accounts/edit/` and confirming the expected profile navigation is present. Prove downloader auth with one image post through `gallery-dl`, then one reel, and validate the files with `file`/`ffprobe`. ### Bounded Instagram Reels discovery For a read-only viral-candidate scan, an authenticated `/reels/` page can expose a useful bounded batch without liking, saving, or following: 1. Read loaded `video` elements and their `duration` properties; Instagram often preloads many vertically stacked reels. 2. For each video, locate the smallest surrounding container that also contains the creator's `/reels/` profile link, caption text, and trailing like/comment labels. Avoid depending on generated CSS class names. 3. Filter by duration first (for example, under 30 seconds), then scroll selected elements into view one at a time with human-paced pauses. Read `location.href` after each scroll to capture the reel permalink. 4. Run authenticated `gallery-dl --cookies COOKIE_FILE --proxy PROXY -j REEL_URL` to obtain source metadata such as creator, exact post time, canonical shortcode, and current like count without downloading. 5. Compute age and approximate like velocity from the live timestamp. Rank with several signals rather than raw likes alone: recency/velocity, comments-to-likes ratio, duration fit, creator/account size when available, hook clarity, loopability, audio reuse, and confidence in visible evidence. 6. Download only the shortlisted candidates. Use `video-watch` frames/contact sheets to assess the opening 1–3 seconds, pacing, scene changes, subtitles, payoff, and loop structure. Be explicit about missing private metrics: Instagram does not consistently expose views, shares, saves, retention, or follower-normalized performance. A discovery score is evidence-backed triage, not private analytics. For user-authorized account seeding—searching named seed profiles' Following lists, validating niche candidates, ranking hashtag videos, following a conservative handful, and proving each state change—read `references/instagram-account-seeding-and-following.md`. Keep backup accounts cold, treat Following-dialog search as substring matching rather than semantic search, and verify `Following*`/`Requested` from a fresh post-click snapshot instead of trusting the click response. Operational pitfalls: - Exporting `HTTP_PROXY`/`HTTPS_PROXY` in the persistent Hermes terminal environment also proxies requests to local Camofox. Set `NO_PROXY=127.0.0.1,localhost` or unset proxy env vars before calling `http://127.0.0.1:9377`; otherwise local cookie-import/health requests can misleadingly return proxy-side `403`. - Browser cookie login and downloader cookies are separate until explicitly bridged. - A successful password+TOTP login is not enough: verify the persistent Camofox state file and the expected authenticated identity after a real process restart. - Do not retry the same account repeatedly after a clear bad-credentials response; switch to the Instaloader lane once, then stop if it also rejects the credentials. - Keep one user-selected account active by default; leave other supplied accounts as untouched backups until the user explicitly promotes one. Full authenticated-login recipe and verification ladder: `references/instagram-agent-browsing-download.md`. Full preserved detail: `references/absorbed/embedded-video-extraction/SKILL.md`, including `players.md` and the catalog-to-S3 template. ### Instagram browsing and media retrieval For agent-driven Instagram browsing, image/reel downloading, persistent login design, and handing downloaded reels into `video-watch`, read `references/instagram-agent-browsing-download.md`. Keep browser discovery/visual inspection separate from durable media retrieval: use `yt-dlp` for public reels, authenticated `gallery-dl` for carousels/stories, and a bounded Open Graph fallback for a public single image. Prefer anonymous retrieval when it works; use one stable egress and a manually authenticated persistent browser profile for feed/private/login-gated access. Never claim complete carousel support from `og:image`, which normally represents only the first image. ### Instagram latest-N reference packs and fictional character remixes When an Instagram profile becomes a reference source for a new fictional-character image/video series, read `references/instagram-reference-pack-character-remix.md`. It covers the `/USERNAME/posts/` gallery-dl queue quirk, pinned-post-safe date sorting, exactly-N primary-asset selection from carousels, manifests/contact sheets/storyboards, original identity-board locking, strict keyframe QA/repair, quote-first background I2V, staged delivery as assets complete, and splitting oversized channel attachments without degrading production masters. ## AI Video / Venice Production Default hybrid workflow: ```text Telegram/Hermes concept → Venice API bulk generation → raw assets → Venice Studio timeline → final export ``` Use Hermes for treatment, shot lists, bulk generation, QA, regeneration decisions, and asset bookkeeping. Use the Venice API for parallel image/video/audio generation and character-reference assets, including current documented Seedance queue workflows. Use Venice Studio Web when the task actually requires manual timeline assembly, transitions, trims, layered audio editing, or export review; do not route a model away from the API solely because an older skill or incomplete catalog omits it. For a web experience that hands off from a prerecorded presenter/demo video into a live conversational avatar, use `references/prerecorded-to-realtime-avatar-handoff.md`. The durable pattern is: prove and frame the live avatar first, render screen-share UI deterministically with HTML/Remotion, extract the bridge image from the final encoded MP4, and never hide the bridge until a real live frame has painted. Choose the startup contract explicitly: **latency-first** starts/prewarms the avatar behind a 3–5 second cover; **cost-first** does not mint/start/request microphone access until the MP4's native `ended` event lands on its final frame. Both require an immediate End conversation control plus verified provider-side teardown—not merely hiding the media element or clearing a local lock. OpenAI Realtime is a voice/agent layer, not a video renderer, and batch talking-portrait/lipsync endpoints are suitable only for the fixed intro. For Anam specifically—including saved-persona `skipGreeting`, valid token shapes, failure isolation, measured canvas compositing, and using an existing agent/LLM as the brain—also load `references/anam-live-avatar-integration.md`. When LiveAvatar is the renderer, also load `references/realtime-avatar-web-compositing.md` for the HeyGen-vs-LiveAvatar credential boundary, safe non-billable auth/sandbox proof, dedicated OpenAI connector secret, raw-`MediaStream` requirement, GPU chroma-key pipeline, and the rule to rotate credentials exposed in shared threads before deployment. When handing Hermes Creative briefs into Video Story, treat overlay text, caption text, and voiceover as production data unless the actual render path has been verified to burn overlays into final video. It is safe to create draft-only social creative workspaces with these fields preserved; do not promise final text-overlay rendering from the import alone. For narration-timed or timeline-timed AI video shots, verify the exact provider endpoint schema rather than relying on a family/model name. Some endpoints expose only coarse duration enums while newer variants expose `num_frames` + `fps`. For fal LTX timing details, see `references/fal-ltx-frame-count-endpoints.md`. For direct fal Grok Imagine Video 1.5 image-to-video work, use endpoint `xai/grok-imagine-video/v1.5/image-to-video` exactly, treat it as one-image first-frame I2V with native model audio, and force vertical 9:16 via vertical first-frame images because the endpoint may not expose `aspect_ratio`. See `references/fal-grok-imagine-direct-i2v.md`. For transparent-background motion assets, use VP9 WebM with alpha as the compositing master, plus MP4 previews for easy review. When a provider returns opaque MP4, recover alpha via background removal/matting, export transparent frames, then encode WebM alpha. Do not rely on viewer screenshots or `ALPHA_MODE=1` alone; verify an extractable alpha plane and re-encode ambiguous provider WebMs through libvpx-vp9 when Alex requires real alpha channels. For web/mobile review pages, do **not** assume the WebM alpha master is the best displayed format: iOS/Safari can mis-render VP9 WebM alpha as noisy/dithered blocks even when desktop checks pass. Default mobile viewer previews to APNG or animated WebP generated from the RGBA frame sequence, and link the WebM as the master. See `references/transparent-webm-alpha-motion-assets.md`, `references/webm-alpha-verification-reencode.md`, and `references/mobile-safe-alpha-preview-formats.md`. When generating vault-ready motion from existing reference PNGs with fal I2V, first ensure the app's model catalog recognizes the requested I2V endpoint so it does not silently fall back to a default image model. Quality LTX jobs can exceed short queue timeouts, and fast/quality LTX endpoints have different schemas. Preserve both the fal MP4 source and the alpha WebM postprocess as separate assets. See `references/fal-i2v-transparent-webm-vault-assets.md`. For Video Story model-inventory/account UI work, maintain reusable model profiles as first-class app artifacts instead of a flat provider list. Profiles should document why each model is used, which Video Story modes use it, reference-input types, duration contracts, API parameters, and pricing metadata. See `references/video-story-model-profile-catalog.md`. For Video Story cost-estimate work, keep provider/model prices attached to model profiles and have estimate endpoints/UI read that same catalog rather than carrying separate hardcoded cost constants. See `references/video-story-model-profile-costing.md`. Also make estimates mode-aware: selected workflow contracts determine which rows appear (classic first+last frames vs storyboard grid/reference panels vs dialogue/provider-audio modes). See `references/video-story-mode-aware-costing.md`. When comparing external agentic video platforms or deciding what to adopt, use the evidence-first audit, capability rubric, licensing checks, layer taxonomy, and consolidation/promotion model in `references/creative-video-platform-comparison.md`. Do not confuse a provider catalog, node canvas, skill library, deterministic renderer, or story-production workspace with a complete creative operating system; verify business intelligence, execution governance, publishing, and performance-learning separately. Important practices: - **Provider-fit scope for Alex:** when he names a provider (for example, “what about Venice?”), answer that provider’s native capabilities and gaps first. Clearly separate: available on the named provider, available only through post-processing, and narrow external escape hatches. Do not lead with a provider-agnostic best-of-market survey and make him ask again for the requested provider fit. - **Build-status communication for Alex:** lead with a short binary status—`built`, `partially built`, or `not built`—then name the single current blocker or next gate. Do not describe research, architecture, credential probes, plans, or provider validation as if they were an implemented/deployed artifact. When he asks “did you build it?”, answer that first in one sentence; continue tool work immediately if implementation was requested rather than giving another long research recap. - **Credential-use communication for Alex:** when Alex explicitly supplies credentials/account recovery data and tells Hermes to use it for the requested login, proceed with a bounded evidence-driven attempt instead of repeating warnings or deleting the only accessible source before use. Keep secrets out of user-facing output, stop after explicit invalid-credential evidence rather than guessing, and report the exact authentication stage that blocked progress. For Instagram-specific handling, use `references/instagram-agent-browsing-download.md`. - For local static-slide + narration astrology/social videos, refine the existing draft in place unless Alex explicitly asks to route it into Video Story or another app. Use Video Story/Hermes Video only as a reference for timing ideas when he says so; do not change the render architecture by default. Fix glyph legibility by giving glyphs their own clear visual zone, sync slide durations to narration beats/word counts normalized to the actual audio duration, and make multiple MP4 variants when requested (e.g. glyph-only fix, chart/wheel visual, time-wave visual). Verify with true all-slide contact sheets plus vision before delivery. See `references/local-astrology-slideshow-refinement.md`. - When Alex asks for a Remotion version of an approved static narrated slideshow, treat Remotion as the visual/component renderer while keeping the proven alignment/audio layer separate. For static variants, render representative Remotion stills per slide and stitch them with the approved timing manifest + original narration audio (`scripts/sync_static_slideshow.py`) rather than relying on a full per-frame render unless real animation is required. For planetary-god variants, use transparent North Star deity PNGs where available, mirror one side so figures face each other, use glyph fallbacks for missing outer-planet/point assets, and QA contrast because transparent line art can be too faint on dark backgrounds. If the finished renderer needs to become a product-facing Lab experiment, keep the reusable source in the vault but copy review/download media into the app's public static directory; provide inline vertical video playback, direct MP4 downloads, and a single representative portrait poster frame (not a contact sheet). Build and prove the live Lab route plus both MP4 URLs, then perform desktop visual QA as well as mobile smoke. See `references/remotion-static-astrology-slideshows.md` and `references/product-labs-motion-experiment-gallery.md`. - When the user asks for a video, deliver an actual MP4 asset, not only a production brief, prompt sheet, script, or reference sheet. Briefs are supporting artifacts unless the user explicitly asked only for planning. If a previous step produced only a concept and the user asks “where’s the video?”, immediately render or generate a real media artifact and return it as `MEDIA:/absolute/path.mp4`, or state the exact remaining blocker. - For simple talking-portrait / quote videos, do not over-route through a full story pipeline by default. If the requested output is one visible reference-locked speaker with prewritten/generated speech, use a direct single-portrait video endpoint first (`image_url + prompt` when native/generated audio is acceptable, or `image_url + audio_url` when exact supplied audio must drive the clip), then verify duration/audio/identity with ffprobe + contact-sheet/video QA. Use Video Story only when the user wants richer scene planning, comparisons, or app-level artifacts. - For supplied-audio claims, keep **conditioning** and **final preservation** separate. A provider may use the recording to drive motion while re-encoding the returned track. Keep the source as master, generate one canonical delivery audio stream, and stream-copy it into final clips when identical final audio matters. If a visual-only/reference job receives the audio only after generation, label it post-muxed—not audio-driven. For the verified Venice WAN 2.7 case, load `venice-video` and read `references/wan27-supplied-audio-validation-2026-07-21.md`. - Do not assume “native audio” means “accepts audio references.” For fal Grok Imagine Video 1.5, the endpoint generates audio but does not expose `audio_url`; Seedance 2.0 reference-to-video exposes `audio_urls` and is the better route when a supplied voice/music/performance reference is required. - Generate four character angles: front, three-quarter, profile, full-body. - For API clips, prefer “no music, only ambient sound effects” so final music can be unified in the editor. - Queue multiple shots in parallel, but download assets promptly because URLs expire. - Keep aspect ratio consistent from the start. - Do not promise API-only timeline editing; transitions/cuts belong in Studio or local ffmpeg/editor work. Full preserved detail: `references/absorbed/venice-studio-production/SKILL.md` and its support files. ## Local Shot-Boundary QA and Nondestructive Recutting For imported-video segmentation, generated-clip cut QA, final-mixdown boundary verification, or scene-aware Social clip extraction, also load `video-watch` and read its `references/shot-boundary-scene-manifests.md`. Keep authored production scenes, detected visual shots, semantic scenes, and human assembly-review gates as separate concepts. Persist a complete local boundary manifest before thinning representative frames for vision. Analyze generated clips after generation and compare final detected boundaries with expected cumulative blueprint boundaries, but never silently rewrite the blueprint or trigger paid regeneration. Accepted split/trim/reorder decisions belong in a nondestructive EDL that preserves source clips and provenance. Mechanical detection/splitting stays local; vision/LLM spend begins only when semantic labeling or grouping is requested. ## Verification Checklist - [ ] User has legitimate access/rights to the source content. - [ ] Player type and real media URL are identified; `blob:` is not used as source. - [ ] Downloaded files pass `ffprobe` duration/codec checks. - [ ] Realtime-avatar startup policy is explicit and tested: latency-first prewarm or cost-first final-frame start. - [ ] A latency-first prewarm failure cannot interrupt or replace the prerecorded intro; it is retried only after native `ended` while the exact bridge frame remains visible. - [ ] If Anam must preload silently, `skipGreeting` is configured on the saved persona, the token uses a valid saved-persona or full-config shape (not a hybrid), and the intentional greeting is sent only after handoff. - [ ] Cost-first flows show no provider client/session/microphone request before the MP4's native `ended` event. - [ ] The bridge remains visible until a genuine provider first-frame/play event. - [ ] **End conversation** is available from provider startup onward and invokes SDK teardown plus any available authenticated server-side force-stop. - [ ] Provider concurrency/session status returns to zero after stop, failure, permission denial, and unmount, allowing a brief asynchronous settle window. - [ ] Catalog jobs run in the background with resumable markers. - [ ] AI video assets have consistent aspect ratio and downloaded copies. - [ ] If using direct I2V for a requested final video, the user receives the MP4 path/media attachment, not only a brief or reference image. - [ ] Transparent-background assets are verified both as production masters and in the actual target viewer/browser/device; mobile pages use APNG/WebP fallbacks when VP9 WebM alpha artifacts appear. - [ ] Timeline/narration-timed clips use a provider endpoint whose duration contract matches the planner: frame-count (`num_frames`/`fps`) for micro-shots when available, not a long minimum-duration enum silently trimmed later. - [ ] Character references and audio-stem strategy are documented before shot generation. ## Common Pitfalls - Trying to download a browser `blob:` URL. - Letting signed URLs expire before downloading. - Forgetting Referer/cookies for gated streams. - Baking incompatible music into every generated AI clip. - Assuming one endpoint's duration schema represents the whole model family; search provider docs/OpenAPI for newer variants before accepting coarse duration enums for narration micro-shots. - Assuming WebM VP9 alpha will render reliably in mobile/iOS viewers; use APNG/WebP `` fallbacks for review pages and keep WebM as the linked master. - Skipping manual timeline assembly when the requested edit requires cuts/transitions/sync.