export
Export media collection to platform-specific formats (Plex, Jellyfin, MPD, mobile, archival)
What this skill does
# Export Media Collection
Export a curated media collection to platform-specific formats with appropriate transcoding, metadata, and directory structures.
## Purpose
Users consume media across diverse platforms, each with different format requirements, metadata standards, and organizational conventions. This command transforms a curated collection into the optimal structure for each target platform.
## Platform Profiles
### Plex Profile
**Formats:**
- Audio: FLAC (preferred), MP3 (320kbps), M4A (AAC)
- Video: MP4 (H.264/H.265), MKV
- Artwork: Embedded + `folder.jpg` in album directory
**Directory Structure:**
```
Music/
├── Artist Name/
│ ├── Album Name (Year)/
│ │ ├── folder.jpg
│ │ ├── 01 - Track Title.flac
│ │ ├── 02 - Track Title.flac
│ │ └── ...
│ └── Videos/
│ └── Video Title.mp4
```
**YAML Spec:**
```yaml
profile: plex
audio_formats: [flac, mp3, m4a]
video_formats: [mp4, mkv]
artwork:
embedded: true
folder_jpg: true
max_resolution: 1500x1500
directory_pattern: "{artist}/{album} ({year})/{track:02d} - {title}.{ext}"
video_directory: "{artist}/Videos/{title}.{ext}"
metadata:
prefer_embedded: true
id3v2_version: 2.4
```
### Jellyfin Profile
**Formats:**
- Audio: FLAC (preferred), Opus, MP3
- Video: MP4, MKV, WebM
- Artwork: Embedded + `folder.jpg` + `artist.jpg`
- NFO: Supported for rich metadata
**Directory Structure:**
```
Music/
├── Artist Name/
│ ├── artist.jpg
│ ├── artist.nfo
│ ├── Album Name (Year)/
│ │ ├── folder.jpg
│ │ ├── album.nfo
│ │ ├── 01 - Track Title.flac
│ │ └── ...
│ └── Videos/
│ ├── Video Title.mp4
│ └── Video Title.nfo
```
**YAML Spec:**
```yaml
profile: jellyfin
audio_formats: [flac, opus, mp3]
video_formats: [mp4, mkv, webm]
artwork:
embedded: true
folder_jpg: true
artist_jpg: true
max_resolution: 1500x1500
nfo_files:
album: true
artist: true
video: true
directory_pattern: "{artist}/{album} ({year})/{track:02d} - {title}.{ext}"
video_directory: "{artist}/Videos/{title}.{ext}"
metadata:
prefer_embedded: true
id3v2_version: 2.4
```
### MPD Profile
**Formats:**
- Audio: FLAC (preferred), Opus, MP3
- Artwork: `folder.jpg` in album directory
**Directory Structure:**
```
Music/
├── Artist Name/
│ └── Album Name/
│ ├── folder.jpg
│ ├── 01 - Track Title.flac
│ └── ...
```
**YAML Spec:**
```yaml
profile: mpd
audio_formats: [flac, opus, mp3]
artwork:
embedded: true
folder_jpg: true
max_resolution: 1000x1000
directory_pattern: "{artist}/{album}/{track:02d} - {title}.{ext}"
metadata:
prefer_embedded: true
id3v2_version: 2.4
scanning:
auto_rescan: true
watch_mode: inotify
```
### Mobile Profile
**Formats:**
- Audio: Opus (preferred, 128-192kbps), M4A (AAC), MP3
- Video: MP4 (H.264, max 720p)
- Artwork: Embedded, max 500x500
**Size Constraints:**
- Transcode high-res audio to save space
- Limit video resolution
- Budget-aware export (stop when size limit reached)
**YAML Spec:**
```yaml
profile: mobile
audio_formats: [opus, m4a, mp3]
audio_quality:
opus: 128k
m4a: 192k
mp3: 192k
video_formats: [mp4]
video_quality:
max_resolution: 720p
codec: h264
bitrate: 1500k
artwork:
embedded: true
max_resolution: 500x500
transcode:
always: true
source_formats: [flac, wav, alac]
size_budget:
enabled: true
prioritize_by: importance
directory_pattern: "{artist}/{album}/{track:02d} - {title}.{ext}"
```
### Archival Profile
**Formats:**
- Audio: FLAC, WAV (no lossy formats)
- Video: MKV (preserve original quality)
- Checksums: SHA256SUMS
- Provenance: PROVENANCE.jsonld
**Directory Structure:**
```
Archive/
├── Artist Name/
│ ├── Album Name (Year)/
│ │ ├── 01 - Track Title.flac
│ │ ├── ...
│ │ ├── SHA256SUMS
│ │ ├── PROVENANCE.jsonld
│ │ └── folder.jpg
│ └── MANIFEST.json
```
**YAML Spec:**
```yaml
profile: archival
audio_formats: [flac, wav]
video_formats: [mkv]
preserve:
original_filenames: true
source_metadata: true
acquisition_dates: true
checksums:
algorithm: sha256
filename: SHA256SUMS
provenance:
format: jsonld
filename: PROVENANCE.jsonld
include_source_urls: true
include_timestamps: true
manifest:
per_album: false
per_artist: true
format: json
directory_pattern: "{artist}/{album} ({year})/{original_filename}"
```
## Transcoding Commands
### Audio Transcoding
**FLAC to Opus:**
```bash
ffmpeg -i input.flac -c:a libopus -b:a 128k -vn output.opus
```
**FLAC to MP3:**
```bash
ffmpeg -i input.flac -c:a libmp3lame -b:a 320k -id3v2_version 4 output.mp3
```
**Opus to MP3:**
```bash
ffmpeg -i input.opus -c:a libmp3lame -b:a 192k -id3v2_version 4 output.mp3
```
**Preserve Metadata:**
```bash
ffmpeg -i input.flac -c:a libopus -b:a 128k -vn -map_metadata 0 output.opus
```
### Video Transcoding
**4K to 1080p:**
```bash
ffmpeg -i input.mkv -vf scale=1920:1080 -c:v libx264 -crf 23 -c:a copy output.mp4
```
**1080p to 720p (mobile):**
```bash
ffmpeg -i input.mp4 -vf scale=1280:720 -c:v libx264 -crf 23 -b:v 1500k -c:a aac -b:a 128k output.mp4
```
**Extract Audio Only:**
```bash
ffmpeg -i video.mp4 -vn -c:a libopus -b:a 192k audio.opus
```
### Artwork Processing
**Resize Artwork:**
```bash
ffmpeg -i folder.jpg -vf scale=500:500:force_original_aspect_ratio=decrease -q:v 2 folder_mobile.jpg
```
**Extract Artwork from Audio:**
```bash
ffmpeg -i track.flac -an -vcodec copy folder.jpg
```
**Embed Artwork into Audio:**
```bash
ffmpeg -i track.flac -i folder.jpg -map 0:a -map 1:v -c:a copy -id3v2_version 4 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" output.flac
```
## NFO File Generation
### Album NFO Template (Jellyfin/Kodi)
```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<album>
<title>{album_title}</title>
<artist>{artist_name}</artist>
<year>{release_year}</year>
<genre>{genre}</genre>
<style>{style}</style>
<mood>{mood}</mood>
<label>{label}</label>
<releasedate>{release_date}</releasedate>
<rating>{rating}</rating>
<userrating>{user_rating}</userrating>
<review>{review}</review>
<musicbrainzalbumid>{mbid}</musicbrainzalbumid>
<thumb aspect="thumb">{artwork_url}</thumb>
</album>
```
## Size-Budgeted Export (Mobile)
When exporting to mobile devices with limited storage:
1. **Calculate Space Budget:**
- Parse `--max-size` parameter
- Convert to bytes
- Reserve 10% buffer for filesystem overhead
2. **Prioritize Content:**
- Sort by importance score (frequency * rating * recency)
- Essential albums first
- Deep cuts last
3. **Transcode to Mobile Formats:**
- FLAC → Opus 128kbps
- High-res video → 720p H.264
- Resize artwork to 500x500
4. **Track Running Total:**
- Sum file sizes as files are added
- Stop when budget exhausted
- Generate report of included/excluded content
5. **Export Algorithm:**
```bash
budget_bytes=$(( max_size_gb * 1024 * 1024 * 1024 * 9 / 10 ))
total_bytes=0
while read -r file importance; do
file_size=$(stat -f%z "$file" 2>/dev/null || stat -c%s "$file")
if (( total_bytes + file_size > budget_bytes )); then
echo "Budget exhausted. Stopping export." >&2
break
fi
# Transcode and copy
transcode_and_copy "$file" "$output_dir"
total_bytes=$(( total_bytes + file_size ))
done < <(prioritized_file_list)
```
## Archival Export
### Preserve Original Formats
Never transcode. Copy files as-is to preserve quality and authenticity.
### Generate SHA-256 Checksums
```bash
cd "$album_dir"
find . -type f -not -name "SHA256SUMS" -exec sha256sum {} \; > SHA256SUMS
```
### Record Provenance
Create `PROVENANCE.jsonld` per W3C PROV standard:
```json
{
"@context": "https://www.w3.org/ns/prov",
"entity": "urn:aiwg:media:album:{mbid}",
"wasGeneratedBy": {
"activity": "urn:aiwg:activity:acquisition:{timestamp}",
"time": "{iso8601_timestamp}",
"wasAssociatedWith": "urn:aiwg:agent:media-curator"
},
"wasDerivedFrom": [
{
"entity": "{source_url}",
"type": "download",
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.