media-command-guide/generate-pdf.js

784 lines
40 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const { chromium } = require('playwright');
const fs = require('fs');
const path = require('path');
const SCREENSHOTS_DIR = '/home/zgaetano/media-command-guide/screenshots';
const OUTPUT_PDF = '/home/zgaetano/media-command-guide/Media-Command-Guide.pdf';
// Read all screenshots as base64
function imgBase64(filename) {
const fpath = path.join(SCREENSHOTS_DIR, filename);
if (!fs.existsSync(fpath)) return '';
const data = fs.readFileSync(fpath);
return `data:image/png;base64,${data.toString('base64')}`;
}
// Build screenshots map
const shots = {};
const files = fs.readdirSync(SCREENSHOTS_DIR).filter(f => f.endsWith('.png'));
for (const f of files) {
shots[f] = imgBase64(f);
}
console.log(`Loaded ${Object.keys(shots).length} screenshots`);
function img(filename, caption) {
if (!shots[filename]) return `<p class="caption" style="color:#888;">Screenshot: ${filename} (not found)</p>`;
return `<figure>
<img src="${shots[filename]}" alt="${caption}" />
<figcaption>${caption}</figcaption>
</figure>`;
}
const html = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
@page {
size: A4 landscape;
margin: 18mm 20mm 20mm 20mm;
@bottom-center { content: counter(page) " / " counter(pages); font-size: 9px; color: #999; }
}
* { box-sizing: border-box; }
body {
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
color: #1a1a1a;
line-height: 1.5;
font-size: 11pt;
max-width: 100%;
margin: 0;
padding: 0;
}
/* Cover page */
.cover {
page-break-after: always;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
background: linear-gradient(135deg, #0a0e1a 0%, #1a2040 50%, #0d1225 100%);
color: white;
padding: 60px;
margin: -18mm -20mm;
width: calc(100% + 40mm);
}
.cover h1 {
font-size: 42pt;
font-weight: 800;
letter-spacing: -1.5px;
margin: 0 0 8px;
background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.cover .subtitle {
font-size: 16pt;
font-weight: 300;
color: #94a3b8;
margin-bottom: 40px;
letter-spacing: 2px;
text-transform: uppercase;
}
.cover .meta {
font-size: 11pt;
color: #64748b;
line-height: 2;
}
.cover .meta strong { color: #94a3b8; }
.cover .badge {
display: inline-block;
padding: 6px 18px;
border: 1px solid #334155;
border-radius: 20px;
font-size: 10pt;
color: #60a5fa;
margin-top: 30px;
letter-spacing: 1px;
}
/* TOC */
.toc { page-break-after: always; padding-top: 20px; }
.toc h2 { font-size: 22pt; color: #1e293b; border-bottom: 2px solid #3b82f6; padding-bottom: 8px; }
.toc ul { list-style: none; padding: 0; }
.toc li { padding: 6px 0; border-bottom: 1px solid #f1f5f9; font-size: 11pt; }
.toc li a { text-decoration: none; color: #1e293b; }
.toc .section-header { font-weight: 700; color: #3b82f6; margin-top: 16px; font-size: 12pt; }
/* Section styling */
h1 { font-size: 24pt; color: #0f172a; border-bottom: 3px solid #3b82f6; padding-bottom: 8px; margin-top: 40px; page-break-before: always; }
h1:first-of-type { page-break-before: avoid; }
h2 { font-size: 18pt; color: #1e293b; margin-top: 30px; border-bottom: 1px solid #e2e8f0; padding-bottom: 6px; }
h3 { font-size: 14pt; color: #334155; margin-top: 20px; }
p { margin: 8px 0; }
/* Figures */
figure {
margin: 16px 0;
page-break-inside: avoid;
}
figure img {
width: 100%;
max-height: 480px;
object-fit: contain;
border: 1px solid #e2e8f0;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
figcaption {
font-size: 9pt;
color: #64748b;
text-align: center;
margin-top: 6px;
font-style: italic;
}
/* Tables */
table {
width: 100%;
border-collapse: collapse;
margin: 12px 0;
font-size: 10pt;
}
th {
background: #f1f5f9;
color: #1e293b;
font-weight: 600;
text-align: left;
padding: 8px 12px;
border-bottom: 2px solid #cbd5e1;
}
td {
padding: 6px 12px;
border-bottom: 1px solid #e2e8f0;
vertical-align: top;
}
/* Feature lists */
ul { padding-left: 24px; }
li { margin: 4px 0; }
strong { color: #0f172a; }
/* Code blocks */
code {
background: #f1f5f9;
padding: 1px 5px;
border-radius: 3px;
font-size: 9.5pt;
font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
pre {
background: #0f172a;
color: #e2e8f0;
padding: 14px 18px;
border-radius: 8px;
font-size: 9pt;
overflow-x: auto;
line-height: 1.6;
}
pre code { background: none; padding: 0; color: inherit; }
/* Info boxes */
.callout {
background: #eff6ff;
border-left: 4px solid #3b82f6;
padding: 12px 16px;
margin: 14px 0;
border-radius: 0 6px 6px 0;
font-size: 10pt;
}
.callout.warning {
background: #fef3c7;
border-left-color: #f59e0b;
}
.callout.danger {
background: #fef2f2;
border-left-color: #ef4444;
}
</style>
</head>
<body>
<!-- ═══════════════ COVER PAGE ═══════════════ -->
<div class="cover">
<h1>Media Command™</h1>
<div class="subtitle">End-to-End System &amp; Operations Guide</div>
<div class="meta">
<strong>Organization:</strong> Broadcast Management Group (BMG)<br>
<strong>System Version:</strong> Media Command™ v0.91 · Dragonflight Architecture<br>
<strong>Reference Data:</strong> 12,353 Indexed Broadcast Assets<br>
<strong>Cluster Topology:</strong> 6-Node Distributed (dragon1 – dragon6)<br>
<strong>Date:</strong> October 2026
</div>
<div class="badge">PRODUCTION · TOOL-VERIFIED WITH REAL MEDIA</div>
</div>
<!-- ═══════════════ TABLE OF CONTENTS ═══════════════ -->
<div class="toc">
<h2>Table of Contents</h2>
<ul>
<li class="section-header">Foundation</li>
<li>1. Executive Overview &amp; System Architecture</li>
<li>2. Authentication &amp; Workspace Access</li>
<li>3. Global Operations Dashboard</li>
<li class="section-header">Live Ingest &amp; Control</li>
<li>4. Recorders (Physical SDI / Deltacast / SRT / RTMP)</li>
<li>5. Schedule (Automated Event Ingest)</li>
<li>6. Live Graphics &amp; HTML Overlays</li>
<li>7. Monitor Wall (High-Density Multiviewer)</li>
<li class="section-header">Media Asset Management</li>
<li>8. Projects Management</li>
<li>9. Media Library (BMG Workspace)</li>
<li>10. Asset Inspector, Timecode &amp; Player</li>
<li>11. Media Upload</li>
<li>12. Contribution Feeds (SRT / RTMP)</li>
<li>13. YouTube Direct Ingest</li>
<li>14. Cloud Import (S3 / Frame.io)</li>
<li class="section-header">Operations &amp; Post-Production</li>
<li>15. Background Jobs &amp; BullMQ Processing</li>
<li>16. Staging &amp; Scratch Management</li>
<li>17. Playout (Master Control &amp; CasparCG NDI)</li>
<li>18. Clip Server (Instant Replay)</li>
<li>19. Editor (Browser Rough-Cut NLE)</li>
<li>20. Engineering (Signal Flow &amp; Timing)</li>
<li>21. Applications &amp; Downloads Hub</li>
<li class="section-header">System Administration</li>
<li>22. Users &amp; Groups</li>
<li>23. API Tokens</li>
<li>24. Containers &amp; Fleet Health</li>
<li>25. System Logs</li>
<li>26. Audit Trail &amp; Governance</li>
<li>27. Cluster Topology</li>
<li>28. System Alerts</li>
<li>29. System Settings</li>
<li class="section-header">Plugins &amp; Companion Applications</li>
<li>30. Adobe Premiere Pro UXP Plugin</li>
<li>31. DaVinci Resolve Studio Plugin</li>
<li>32. Media Command Transfer (Desktop Uploader)</li>
<li>33. Media Command REMI (Multiviewer)</li>
<li>34. Dragon-ISO (Teams / NDI ISO Controller)</li>
</ul>
</div>
<!-- ═══════════════ SECTION 1: OVERVIEW ═══════════════ -->
<h1>1. Executive Overview &amp; System Architecture</h1>
<p><strong>Media Command™</strong> is an enterprise-grade broadcast Media Asset Management (MAM), live capture, signal routing, and playout automation platform developed by Wild Dragon LLC for high-velocity broadcast environments.</p>
<h3>System Architecture</h3>
<pre><code>┌──────────────────────────────────────────────────────────────────────────┐
│ MEDIA COMMAND™ │
│ Web UI (React 18 / Nginx) │
└─────────────────────────────────┬────────────────────────────────────────┘
│ REST / WebSocket (Port 47432 / HTTPS)
┌─────────────────────────────────┴────────────────────────────────────────┐
│ MAM-API Cluster Gateway │
│ (Node.js / Express / BullMQ / pg) │
└────┬───────────────────────────┬──────────────────────────────────┬──────┘
│ │ │
┌────┴──────────────┐ ┌──────────┴──────────────┐ ┌────────────────┴──────┐
│ Distributed Worker│ │ Database Cluster │ │ Playout &amp; Ingest │
│ Fleet (GPU/CMAF) │ │ PostgreSQL 16 / Redis 7 │ │ CasparCG / Deltacast │
│ dragon2,3,4,6 │ │ (dragon1) │ │ SDI / SRT / WebRTC │
└───────────────────┘ └─────────────────────────┘ └──────────────────────┘</code></pre>
<h3>Technology Stack</h3>
<ul>
<li><strong>Frontend:</strong> React 18 SPA with dark/light themes, HLS.js adaptive streaming, MediaPipe AI segmentation, WebRTC Adaptor for sub-second multiviewing, and SMPTE timecode parsers.</li>
<li><strong>Backend:</strong> Distributed Node.js/TypeScript microservices with express-session, PostgreSQL 16, Redis 7, and BullMQ worker queue orchestration.</li>
<li><strong>Worker Pipeline:</strong> GPU-accelerated transcoding (NVIDIA NVENC/NVDEC) for stream-copying, proxy generation, audio waveform extraction, and HLS packaging.</li>
<li><strong>Playout Engine:</strong> CasparCG Server fork with custom NDI playout, HTML graphics overlays, and SW-P-08 / BCS router protocol bridges.</li>
</ul>
<h3>TAMS CMAF/fMP4 Master Flow Paradigm</h3>
<p>Media Command uses <strong>Fragmented MP4 (fMP4 / CMAF)</strong> master flows for live ingest. Unlike traditional monolithic files that require finalization before reading:</p>
<ul>
<li><strong>Live Growing Ingest:</strong> Segments are written to NVMe sequentially, allowing editors to scrub up to the live record edge seconds behind real-time.</li>
<li><strong>Stream-Copy Efficiency:</strong> H.264 and HEVC feeds bypass transcode stages, stream-copying directly into master containers.</li>
<li><strong>Padded In/Out Trimming:</strong> Non-destructive sub-clipping enables storage reclamation without re-encoding.</li>
</ul>
<!-- ═══════════════ SECTION 2: AUTH ═══════════════ -->
<h1>2. Authentication &amp; Workspace Access</h1>
${img('01-login-page.png', 'Media Command™ Login Screen — Broadcast Management Group tenant')}
<h3>Authentication Channels</h3>
<ul>
<li><strong>Local Credentials:</strong> Secure PBKDF2/Argon2-hashed credential authentication.</li>
<li><strong>Enterprise SSO (Authentik):</strong> Federated OAuth2/OIDC brokering @broadcastmgmt.com (M365) and @bmgremi.com (Google Workspace) identities via <code>auth.broadcastmgmt.cloud</code>.</li>
<li><strong>MFA/TOTP:</strong> Time-based One-Time Password enforcement for administrative tiers.</li>
</ul>
<h3>Role-Based Access Control (RBAC)</h3>
<table>
<tr><th>Role</th><th>Scope &amp; Permissions</th></tr>
<tr><td><strong>Admin</strong></td><td>Full cluster control, user/token provisioning, container restart, S3 and storage configuration.</td></tr>
<tr><td><strong>Operator</strong></td><td>Recorder control, schedule automation, playout queue manipulation, graphics triggering.</td></tr>
<tr><td><strong>Editor</strong></td><td>Library browsing, bin curation, rough-cut editor, NLE plugin connectivity, upload/import.</td></tr>
<tr><td><strong>Viewer</strong></td><td>Read-only access to metadata and proxy streams. Cannot modify content.</td></tr>
</table>
<!-- ═══════════════ SECTION 3: DASHBOARD ═══════════════ -->
<h1>3. Global Operations Dashboard</h1>
${img('02-dashboard-home.png', 'Media Command™ Operations Dashboard — Real-time system overview')}
<p>The <strong>Operations Dashboard</strong> is the command center, providing unified visibility into system vitals, recent activity, and quick access navigation.</p>
<h3>Dashboard Components</h3>
<ul>
<li><strong>Cluster Status:</strong> Live aggregate node state (e.g., <code>cluster healthy · 6/6 nodes</code>).</li>
<li><strong>Asset Indexing:</strong> Real-time counter of all registered broadcast assets (<code>16,076 assets indexed</code>).</li>
<li><strong>Active Queue Metrics:</strong> Running and failed worker tasks (<code>42 running · 2 failed</code>).</li>
<li><strong>Ingest Port Summary:</strong> Online capture channels (<code>24 enabled · 29 configured</code>).</li>
<li><strong>Last 24 Hours:</strong> Stream of newly ingested files with format indicators and direct links.</li>
</ul>
<p>Quick navigation tiles provide one-click access to Library, Recorders, Playout, Jobs, Downloads, and Settings.</p>
<!-- ═══════════════ SECTION 4: RECORDERS ═══════════════ -->
<h1>4. Recorders</h1>
${img('05-live-recorders.png', 'Recorders — Physical SDI capture ports and network ingest engines across the cluster')}
<p>The <strong>Recorders</strong> interface controls physical SDI capture ports (Deltacast PCIe) and network ingest engines across the distributed cluster.</p>
<ul>
<li><strong>Port Matrix:</strong> Each card represents a physical Deltacast SDI port or network stream receiver (e.g., <code>dragon4-dc0</code> through <code>dragon6-dc7</code>).</li>
<li><strong>Signal Detection:</strong> Real-time input format indication (<code>1080i59.94</code>, <code>1080p29.97</code>, <code>2160p59.94</code>).</li>
<li><strong>Codec Selection:</strong> Per-port independent codec profiles including ProRes 422/HQ, DNxHD/DNxHR, H.264, and HEVC (fMP4).</li>
<li><strong>Actions:</strong> <code>Create Recording</code> (immediate manual), <code>Add Stream</code> (SRT/RTMP/NDI provisioning), <code>Reset to Default</code>.</li>
</ul>
<!-- ═══════════════ SECTION 5: SCHEDULE ═══════════════ -->
<h1>5. Schedule</h1>
${img('06-live-schedule.png', 'Schedule — Automated broadcast event capture calendar')}
<p>The <strong>Schedule</strong> module automates recurring broadcast captures and satellite/fiber ingest events.</p>
<ul>
<li><strong>Event Calendar:</strong> Grid-based timeline of upcoming scheduled recordings.</li>
<li><strong>Traffic Import:</strong> CSV run-sheet and broadcast traffic schedule imports.</li>
<li><strong>Auto-Routing:</strong> Matches events to available ports and target project bins.</li>
<li><strong>Pre/Post-Roll:</strong> Configurable safety buffer times around scheduled windows.</li>
</ul>
<!-- ═══════════════ SECTION 6: GRAPHICS ═══════════════ -->
<h1>6. Live Graphics &amp; HTML Overlays</h1>
${img('07-live-graphics.png', 'Live Graphics — HTML5 broadcast overlay engine')}
<ul>
<li><strong>Sandboxed HTML5 Engine:</strong> Chromium-backed offscreen rendering for dynamic graphics packages.</li>
<li><strong>DataLinq Integration:</strong> Live XML/JSON data feeds (sports scores, lower-thirds, tickers).</li>
<li><strong>DSK Layer Stacking:</strong> Controls downstream keying (DSK 1-4) over playout or recorder previews.</li>
</ul>
<!-- ═══════════════ SECTION 7: MONITOR WALL ═══════════════ -->
<h1>7. Monitor Wall</h1>
${img('08-live-monitor-wall.png', 'Monitor Wall — High-density WebRTC multiviewer for control rooms')}
<ul>
<li><strong>Dynamic Grid Layouts:</strong> <code>Auto</code>, <code>2×2</code>, <code>3×3</code>, <code>4×4</code>, <code>6×6</code>.</li>
<li><strong>Feed Filters:</strong> Recorders, WebRTC, Playout Channels, Live Feeds.</li>
<li><strong>Sub-Second Latency:</strong> WHEP/WebRTC streaming (&lt;300ms) without plugins.</li>
<li><strong>Audio Meters:</strong> Multi-channel VU meters on active video tiles.</li>
</ul>
<!-- ═══════════════ SECTION 8: PROJECTS ═══════════════ -->
<h1>8. Projects Management</h1>
${img('03-projects.png', 'Projects — Workspace directory showing all active productions')}
<p>Projects are top-level workspaces isolating media, permissions, bins, and storage quotas. The BMG production environment hosts 8 active projects including <strong>Broadcast Management Group</strong> (12,353 assets), <strong>UBS</strong> (3,447 assets), <strong>Protour</strong>, and others.</p>
${img('04-project-bmg-overview.png', 'Broadcast Managment Group project opened — bins and folders (Marketing Google Drive 11,458 items, Los Angeles 380, FX3 Ground 162)')}
<ul>
<li><strong>Project Creation:</strong> Define name, storage allocation, default codec preset, and assigned user groups.</li>
<li><strong>Recycle Bin Isolation:</strong> Deleted assets quarantine separately per project.</li>
</ul>
<!-- ═══════════════ SECTION 9: LIBRARY ═══════════════ -->
<h1>9. Media Library</h1>
${img('09-media-library-bmg.png', 'Media Library — Broadcast Managment Group: bins (4.15.26 Rehearsals, Chicago, Dallas, Dearborn, Exterior Drone) and folders')}
${img('09a-library-grid-thumbnails.png', 'Media Library — folder grid with real thumbnails (FX3 Ground, Los Angeles, Marketing Google Drive)')}
<ul>
<li><strong>Project Workspace Switcher:</strong> Quick dropdown to toggle between projects or master <code>★ All Projects (Admin View)</code>.</li>
<li><strong>Search &amp; Filtering:</strong> Full-text search across filenames, tags, tape IDs, and custom metadata. Faceted filters by file type, codec, resolution, and date range.</li>
<li><strong>Display Modes:</strong> List view, thumbnail grid, and filmstrip scrub view.</li>
<li><strong>Bin Navigation:</strong> Hierarchical folder and smart-bin tree organization.</li>
</ul>
<!-- ═══════════════ SECTION 10: ASSET INSPECTOR ═══════════════ -->
<h1>10. Asset Inspector &amp; Player</h1>
${img('09b-media-library-asset-inspector.png', 'Asset Detail — BMG Al Jazeera Sizzle v2.mp4 (1920x1080 HEVC, 0:49) paused at 00:00:17; Proxy, Hi-Res Master (TAMS) and Thumbnail renditions READY')}
${img('09c-asset-metadata.png', 'Asset Detail: Metadata tab — technical and descriptive metadata')}
${img('09c-asset-transcript.png', 'Asset Detail: Transcript tab — speech-to-text transcript')}
${img('09c-asset-ai.png', 'Asset Detail: AI Analysis &amp; Faces tab')}
${img('09c-asset-versions.png', 'Asset Detail: Versions tab')}
${img('09c-asset-comments.png', 'Asset Detail: Comments tab — review annotations')}
<ul>
<li><strong>Broadcast Timecode Player:</strong> Frame-accurate scrubbing, J-K-L shuttle, SMPTE timecode readout.</li>
<li><strong>TAMS Adaptive Playback:</strong> Smooth scrubbing on multi-hour growing capture files.</li>
<li><strong>Multi-Track Audio:</strong> Visual waveform display with individual channel solo/mute (up to 16 discrete channels).</li>
<li><strong>Technical Metadata:</strong> Container, stream profile, resolution, frame rate, bit rate, color space, S3 object key, checksums.</li>
<li><strong>Markers &amp; Sub-clipping:</strong> Set In/Out points (<code>I</code>/<code>O</code> keys) for subclip export or render job dispatch.</li>
</ul>
<!-- ═══════════════ SECTION 11: UPLOAD ═══════════════ -->
<h1>11. Media Upload</h1>
${img('10-media-upload.png', 'Media Upload — Chunked resumable web ingest into target project bins')}
<ul>
<li><strong>Chunked Resumable Upload:</strong> Pause/resume for 100GB+ files.</li>
<li><strong>Target Bin Selector:</strong> Direct assignment to project folders.</li>
<li><strong>Automated Ingest:</strong> Triggers proxy creation, thumbnail extraction, and waveform generation on completion.</li>
</ul>
<!-- ═══════════════ SECTION 12: CONTRIBUTION ═══════════════ -->
<h1>12. Contribution Feeds</h1>
${img('11-media-contribution.png', 'Contribution — SRT/RTMP caller/listener for remote broadcast feeds')}
<ul>
<li><strong>SRT Caller/Listener:</strong> Passphrase-protected low-latency streams (20ms – 2000ms).</li>
<li><strong>RTMP/RTMPS Ingest:</strong> Custom streaming keys for OBS, vMix, Wirecast.</li>
<li><strong>Auto-Recording:</strong> Automatically initiate TAMS recording on stream connect.</li>
</ul>
<!-- ═══════════════ SECTION 13: YOUTUBE ═══════════════ -->
<h1>13. YouTube Direct Ingest</h1>
${img('12-media-youtube.png', 'YouTube Ingest — Archive public/unlisted videos and live streams')}
<ul>
<li><strong>URL Capture:</strong> Paste any YouTube video or live broadcast URL for background download into the Library.</li>
<li><strong>Live Stream Recording:</strong> Records live YouTube feeds into TAMS fMP4 files for immediate editing.</li>
</ul>
<!-- ═══════════════ SECTION 14: CLOUD IMPORT ═══════════════ -->
<h1>14. Cloud Import</h1>
${img('13-media-cloud-import.png', 'Cloud Import — S3 bucket sync and Frame.io integration')}
<ul>
<li><strong>S3 Bucket Sync:</strong> Ingest from Amazon S3, Wasabi, Backblaze B2, or MinIO.</li>
<li><strong>Frame.io Sync:</strong> Import approved sequences, review comments, and dailies.</li>
</ul>
<!-- ═══════════════ SECTION 15: JOBS ═══════════════ -->
<h1>15. Background Jobs</h1>
${img('14-ops-jobs.png', 'Background Jobs — BullMQ distributed task pipeline monitoring')}
<ul>
<li><strong>Queue Categories:</strong> Transcode, Thumbnails/Waveforms, Conform/Export, Cloud Sync/Transfer.</li>
<li><strong>Job Controls:</strong> Live progress, error logs, retry, priority adjustment, failed job flushing.</li>
</ul>
<!-- ═══════════════ SECTION 16: STAGING ═══════════════ -->
<h1>16. Staging</h1>
${img('15-ops-staging.png', 'Staging — NVMe scratch storage monitoring and retention policies')}
<ul>
<li><strong>Scratch Volume Utilization:</strong> Tracks free space across cluster scratch disks.</li>
<li><strong>Automated Retention:</strong> Moves finalized assets to cold storage, purges temporary render artifacts.</li>
</ul>
<!-- ═══════════════ SECTION 17: PLAYOUT ═══════════════ -->
<h1>17. Playout</h1>
${img('16-ops-playout.png', 'Playout — Master control channel automation and CasparCG NDI output')}
${img('29-playout-rundown.png', 'Playout: Rundown (#rundown)')}
${img('30-playout-schedule.png', 'Playout: Playout Schedule (#playout-schedule)')}
${img('31-playout-ads.png', 'Playout: Ad Break (#playout-ads)')}
<ul>
<li><strong>Multi-Channel Playout:</strong> CasparCG instances emitting SDI or NDI feeds.</li>
<li><strong>Rundown Management:</strong> Drag-and-drop playlist builder with CUE, PLAY, PAUSE, STOP, LOOP controls.</li>
<li><strong>Confidence Monitoring:</strong> Real-time program and preview return video monitors.</li>
</ul>
<!-- ═══════════════ SECTION 18: CLIP SERVER ═══════════════ -->
<h1>18. Clip Server</h1>
${img('17-ops-clip-server.png', 'Clip Server — Instant-access cart wall for live studio replay')}
<ul>
<li><strong>Cart Wall:</strong> Configurable instant-trigger video clips, bumpers, stingers, and sound effects.</li>
<li><strong>Zero-Latency Playback:</strong> Pre-loaded frames in shared memory (<code>/dev/shm</code>) for frame-accurate firing.</li>
</ul>
<!-- ═══════════════ SECTION 19: EDITOR ═══════════════ -->
<h1>19. Web Editor</h1>
${img('18-ops-editor.png', 'Web Editor (/editor.html) — BMG project media bin loaded; source monitor, V1-V2/A1-A5 timeline, EDL / Save / Export to Library')}
<ul>
<li><strong>Multi-Track Timeline:</strong> Video and audio tracks with ripple edit and razor tools.</li>
<li><strong>Frame-Accurate Cuts:</strong> GOP-boundary or smart-rendered trims on TAMS master flows.</li>
<li><strong>Export Presets:</strong> Social media presets (16:9, 9:16, 1:1) and MAM master bin publishing.</li>
</ul>
<!-- ═══════════════ SECTION 20: ENGINEERING ═══════════════ -->
<h1>20. Engineering</h1>
${img('19-ops-engineering.png', 'Engineering — Broadcast signal flow, GPU diagnostics, and timing infrastructure')}
<ul>
<li><strong>SDI Matrix &amp; Frame Sync:</strong> Deltacast PCIe status, genlock, and reference clock timing.</li>
<li><strong>GPU Acceleration:</strong> NVIDIA NVENC/NVDEC load, temperature, VRAM, and persistence mode status.</li>
<li><strong>Network Statistics:</strong> 10GbE throughput, PTP (IEEE 1588) timing, and Dante audio multicast.</li>
</ul>
<!-- ═══════════════ SECTION 21: APPLICATIONS ═══════════════ -->
<h1>21. Applications &amp; Downloads Hub</h1>
${img('20-ops-applications.png', 'Applications — Central distribution portal for client tools and plugins')}
${img('20b-downloads-modal.png', 'Downloads: Editing plugins tab — Premiere Pro UXP v2.27.6 and DaVinci Resolve panel v0.1.0 beta')}
${img('20c-downloads-desktop-apps.png', 'Downloads: Desktop apps tab — Dragon-ISO v1.1.0, Media Command Transfer v0.2.1, Media Command REMI v0.3.3 (Apple silicon, Intel, Windows x64)')}
<table>
<tr><th>Application</th><th>Platform</th><th>Installer</th></tr>
<tr><td>Adobe Premiere Pro UXP Plugin</td><td>macOS / Windows</td><td><code>dragonflight-mam-2.27.6.ccx</code></td></tr>
<tr><td>DaVinci Resolve Studio Plugin</td><td>macOS / Windows</td><td><code>dragonflight-resolve-0.1.0.zip</code></td></tr>
<tr><td>Media Command Transfer</td><td>macOS / Windows</td><td><code>Media-Command-Transfer-0.2.1-{platform}.{ext}</code></td></tr>
<tr><td>Media Command REMI</td><td>macOS / Windows</td><td><code>Media-Command-REMI-0.3.3-{platform}.{ext}</code></td></tr>
<tr><td>Dragon-ISO</td><td>Windows</td><td><code>Dragon-ISO-Setup-1.1.0.msi</code></td></tr>
</table>
<!-- ═══════════════ SECTION 22-29: ADMIN ═══════════════ -->
<h1>22. Users &amp; Groups</h1>
${img('21-admin-users-groups.png', 'Users & Groups — Multi-tenant user provisioning with RBAC role enforcement')}
<ul>
<li><strong>User Provisioning:</strong> Create accounts, email invitations, password resets.</li>
<li><strong>Group Assignments:</strong> Functional production groups with project access boundaries.</li>
<li><strong>Role Enforcement:</strong> Global platform roles (Admin, Operator, Editor, Viewer).</li>
</ul>
<h1>23. API Tokens</h1>
${img('22-admin-api-tokens.png', 'API Tokens — Scoped service automation keys with revocation controls')}
<ul>
<li><strong>Service Tokens:</strong> Scoped API keys for automated pipelines, external transcoders, and CI/CD.</li>
<li><strong>Permission Scoping:</strong> Restrict to specific actions (read-only, ingest-only, playout cueing).</li>
<li><strong>Revocation &amp; Expiry:</strong> Automated expiration and instant revocation triggers.</li>
</ul>
<h1>24. Containers &amp; Fleet Health</h1>
${img('23-admin-containers.png', 'Containers — Docker fleet status across the 6-node cluster')}
<ul>
<li><strong>Docker Fleet:</strong> Real-time container status across all cluster nodes.</li>
<li><strong>Resource Metrics:</strong> CPU, RAM, and GPU memory per container.</li>
<li><strong>Lifecycle Controls:</strong> Graceful restart of worker queues and service daemons.</li>
</ul>
<h1>25. System Logs</h1>
${img('24-admin-logs.png', 'Logs — Centralized log aggregation with severity filtering and regex search')}
<ul>
<li><strong>Centralized Aggregation:</strong> Live streaming logs from all nodes with severity filters.</li>
<li><strong>Regex Search:</strong> Instant query across millions of log entries.</li>
</ul>
<h1>26. Audit Trail</h1>
${img('25-admin-audit-log.png', 'Audit Log — Immutable record of all user actions for security compliance')}
<ul>
<li><strong>Immutable History:</strong> Every user action recorded: logins, deletions, metadata edits, permission changes, playout triggers.</li>
<li><strong>Security Compliance:</strong> User ID, IP address, timestamp, asset ID, and state changes.</li>
</ul>
<h1>27. Cluster Topology</h1>
${img('26-admin-cluster.png', 'Cluster — Distributed 6-node topology visualizer with heartbeat monitoring')}
<ul>
<li><strong>Multi-Node Map:</strong> Graphical view of dragon1 (core) through dragon6 (GPU/capture workers).</li>
<li><strong>Heartbeat Monitoring:</strong> Inter-node latency, SSH connectivity, and cluster agent sync.</li>
</ul>
<h1>28. System Alerts</h1>
${img('27-admin-alerts.png', 'Alerts — Critical operational incident monitoring and webhook notification')}
<ul>
<li><strong>Incident Monitor:</strong> Storage capacity, SDI signal loss, worker heartbeat drops.</li>
<li><strong>Notification Webhooks:</strong> Discord, Slack, PagerDuty, and email dispatch.</li>
</ul>
<h1>29. System Settings</h1>
${img('28-admin-settings.png', 'Settings — Central configuration for storage, encoders, and SDK bridges')}
${img('28-settings-tab-storage.png', 'Settings: Storage Tab — S3 endpoint credentials, NFS/CIFS mounts, scratch paths')}
<ul>
<li><strong>Storage:</strong> Local scratch paths, NFS/CIFS mounts, TrueNAS pools, and S3 endpoint credentials.</li>
<li><strong>Transcoder Profiles:</strong> GPU encoding presets, bitrate ladders, and proxy resolutions.</li>
<li><strong>Playout Settings:</strong> CasparCG channel topologies, NDI labels, and genlock timing.</li>
</ul>
<!-- ═══════════════ SECTION 30-34: PLUGINS ═══════════════ -->
<h1>30. Adobe Premiere Pro UXP Plugin</h1>
<p>The <strong>Media Command UXP Plugin</strong> provides deep bidirectional NLE integration directly inside Adobe Premiere Pro 2026 (v26+).</p>
<h3>Installation</h3>
<ol>
<li>Download <code>dragonflight-mam-2.27.6.ccx</code> from the Downloads menu in Media Command.</li>
<li>Double-click the <code>.ccx</code> file to install via Adobe Creative Cloud / UPI.</li>
<li>In Premiere Pro: <strong>Window → Extensions → Media Command™</strong>.</li>
</ol>
<h3>Key Capabilities</h3>
<ul>
<li><strong>Connect Pane:</strong> Username/password (with TOTP 2FA) or API bearer token.</li>
<li><strong>Library &amp; Search Browser:</strong> Grid/list views with asset thumbnails, technical metadata, duration, and creation timestamps. Project, Bin, Collection, Live Ingest, and Uploads navigation.</li>
<li><strong>Live Growing File Editing:</strong> Mount active capture streams for editing while recording is in progress. The playhead scrubs up to the live record edge.</li>
<li><strong>Proxy / Hi-Res Import &amp; Relinking:</strong> Edit with lightweight H.264 proxies, then one-click relink to full ProRes/DNxHR masters. Automatic batch relinking across project items.</li>
<li><strong>Conform Timeline → MAM:</strong> Render sequences to broadcast codecs (ProRes 422 HQ, Web H.264, Archive ProRes 4444, custom DNxHR/HEVC/PCM) and upload directly to MAM bins.</li>
<li><strong>Direct Asset Uploader:</strong> Drag external files or Premiere sequences into MAM folders from the panel footer.</li>
</ul>
<h1>31. DaVinci Resolve Studio Plugin</h1>
<p>Native <strong>DaVinci Resolve Studio 18.5+</strong> Workflow Integration for browsing and importing media directly into the Resolve Media Pool.</p>
<h3>Installation</h3>
<ol>
<li>Download <code>dragonflight-resolve-0.1.0.zip</code>.</li>
<li>Extract to the Workflow Integration Plugins directory:
<ul>
<li><strong>macOS:</strong> <code>/Library/Application Support/Blackmagic Design/DaVinci Resolve/Workflow Integration Plugins/</code></li>
<li><strong>Windows:</strong> <code>%PROGRAMDATA%\\Blackmagic Design\\DaVinci Resolve\\Support\\Workflow Integration Plugins\\</code></li>
</ul>
</li>
<li>In Resolve: <strong>Workspace → Workflow Integrations → Media Command™ MAM</strong>.</li>
</ol>
<h3>Key Capabilities</h3>
<ul>
<li><strong>Asset Browser:</strong> Instant debounced search with folder/bin tree navigation.</li>
<li><strong>Media Pool Import:</strong> One-click import via <code>MediaStorage.AddItemListToMediaPool()</code>.</li>
<li><strong>Color-Managed Workflows:</strong> Automatic project-level color tags and metadata application.</li>
</ul>
<h1>32. Media Command Transfer</h1>
<p>High-speed desktop utility for bulk broadcast file ingest with accelerated multi-threaded transfers.</p>
<table>
<tr><th>Platform</th><th>Package</th></tr>
<tr><td>macOS Apple Silicon</td><td><code>Media-Command-Transfer-0.2.1-mac-arm64.zip</code></td></tr>
<tr><td>macOS Intel</td><td><code>Media-Command-Transfer-0.2.1-mac-x64.zip</code></td></tr>
<tr><td>Windows x64</td><td><code>Media-Command-Transfer-0.2.1-win-x64.exe</code></td></tr>
</table>
<h3>Key Features</h3>
<ul>
<li><strong>Watch Folders:</strong> Map local directories to MAM project bins for automatic ingest with file stability detection.</li>
<li><strong>Multi-Part S3 Transfer:</strong> Direct presigned PUT uploads to S3 with configurable concurrency (2 parallel files, 8 chunks per file) and bandwidth throttling.</li>
<li><strong>Deep-Link Protocol:</strong> <code>mediacommand://download?asset=&lt;id&gt;&amp;rendition=&lt;type&gt;</code> for instant download from web UI.</li>
<li><strong>Checksum Validation:</strong> Per-part MD5 ETag + full-file SHA-256 verification.</li>
<li><strong>Pause/Resume:</strong> Graceful cancel with server-side multipart abort cleanup.</li>
</ul>
<h1>33. Media Command REMI</h1>
<p>Low-latency hardware-accelerated <strong>broadcast multiviewer</strong> and monitor wall application for remote control rooms.</p>
<table>
<tr><th>Platform</th><th>Package</th></tr>
<tr><td>macOS Apple Silicon</td><td><code>Media-Command-REMI-0.3.3-mac-arm64.zip</code></td></tr>
<tr><td>macOS Intel</td><td><code>Media-Command-REMI-0.3.3-mac-x64.zip</code></td></tr>
<tr><td>Windows x64</td><td><code>Media-Command-REMI-0.3.3-win-x64.exe</code> (portable, unsigned — SmartScreen: More info → Run anyway)</td></tr>
</table>
<h3>Key Features</h3>
<ul>
<li><strong>Multi-Tile Grid (up to 8 tiles/window):</strong> Layouts: 1×1, 2×1, 2×2, 3×2, 4×2. Single-tile fullscreen solo.</li>
<li><strong>Proxy / QC Mode Toggle:</strong> Switch between low-latency preview and full-quality NVENC streams for critical QC.</li>
<li><strong>Audio Monitoring:</strong> Dual-channel PPM/VU meters with peak-hold and dBFS scale. Channel pair selection (Ch 1-2 through Ch 7-8). Solo and mute toggles.</li>
<li><strong>Broadcast OSD:</strong> Tile labels, format indicators, tally badges, timecode, safe-area graticules, progress bars, center crosshairs.</li>
<li><strong>Multi-Window Multi-Display:</strong> Independent wall windows across up to 8 attached displays.</li>
<li><strong>Automation API:</strong> HTTP REST (<code>/api/tile/:n/source</code>, <code>/api/layout</code>, <code>/api/mute</code>) and WebSocket for Bitfocus Companion / Stream Deck integration.</li>
</ul>
<h1>34. Dragon-ISO</h1>
<p>Enterprise automation tool for capturing individual <strong>Microsoft Teams</strong> and <strong>NDI</strong> participants into isolated broadcast feeds.</p>
<table>
<tr><th>Platform</th><th>Package</th></tr>
<tr><td>Windows 10/11 x64</td><td><code>Dragon-ISO-Setup-1.1.0.msi</code></td></tr>
</table>
<h3>Key Features</h3>
<ul>
<li><strong>NDI Participant Extraction:</strong> Auto-discovers Teams meeting attendees, strips UI wrappers, isolates individual clean video/audio feeds.</li>
<li><strong>Signal Normalization:</strong> Re-clocks varied webcam streams to uniform broadcast standards (framerate, resolution, audio mapping).</li>
<li><strong>Direct ISO Recording:</strong> Simultaneous disk recording of raw streams with automated FFmpeg batch conversion.</li>
<li><strong>Control Integration:</strong> REST &amp; WebSocket on <code>127.0.0.1:9755</code>, OSC server on UDP <code>127.0.0.1:9000</code> for Companion and TouchOSC.</li>
<li><strong>Mobile Controller:</strong> Responsive web controller at <code>http://localhost:9755/ui</code>.</li>
</ul>
<!-- ═══════════════ SAFETY PROTOCOLS ═══════════════ -->
<h1>35. Safety Protocols &amp; Operational Runbooks</h1>
<div class="callout danger">
<strong>MEDIA DELETION SAFETY PROTOCOL — TRIPLE CONFIRMATION REQUIRED</strong><br>
Under no circumstances may raw media files, S3 objects, or database records be purged without explicit, multi-step authorization. Deleted assets first enter the project's isolated Recycle Bin. Permanent purging from physical storage requires administrative credentials and double confirmation dialogs.
</div>
<h3>Live Growing File Workflow</h3>
<ol>
<li>In <strong>Recorders</strong>, enable the target capture port and set container format to fMP4/CMAF (HEVC/H.264) or ProRes (Segmented).</li>
<li>Click <strong>Create Recording</strong> to begin the live feed.</li>
<li>Open Adobe Premiere Pro and launch the <strong>Media Command UXP Plugin</strong>.</li>
<li>Locate the active recording (tagged with red <code>LIVE</code> badge) and click <strong>Mount Growing File</strong>.</li>
<li>Edit immediately — new video segments are dynamically recognized without re-importing.</li>
</ol>
<p style="text-align:center; color:#94a3b8; margin-top:40px; font-size:9pt;">
Media Command™ End-to-End System Guide · Broadcast Management Group · Wild Dragon LLC · October 2026
</p>
</body>
</html>`;
// Write the HTML
const htmlPath = '/home/zgaetano/media-command-guide/guide.html';
fs.writeFileSync(htmlPath, html);
console.log('HTML written to', htmlPath);
// Generate PDF using Playwright
(async () => {
const browser = await chromium.launch({
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage']
});
const context = await browser.newContext();
const page = await context.newPage();
await page.goto(`file://${htmlPath}`, { waitUntil: 'load' });
await page.waitForTimeout(3000); // allow images to decode
await page.pdf({
path: OUTPUT_PDF,
format: 'A4',
landscape: true,
printBackground: true,
margin: { top: '18mm', right: '20mm', bottom: '20mm', left: '20mm' },
displayHeaderFooter: true,
headerTemplate: '<span></span>',
footerTemplate: '<div style="font-size:8px; text-align:center; width:100%; color:#999;">Media Command™ End-to-End Guide · Broadcast Management Group · Page <span class="pageNumber"></span> of <span class="totalPages"></span></div>'
});
console.log('PDF generated at:', OUTPUT_PDF);
const stats = fs.statSync(OUTPUT_PDF);
console.log('PDF size:', (stats.size / 1024 / 1024).toFixed(1), 'MB');
await browser.close();
})();