plex_ffmpeg_mgr
Repair and inspect Plex media files using FFmpeg: probe streams, sync audio/subtitles, extract clips or subtitles, and change aspect ratio.
Instructions
Industrial-grade FFmpeg management tool for Plex media.
PORTMANTEAU PATTERN RATIONALE: Consolidates low-level media repair and inspection tasks that require system-level FFmpeg binaries. This avoids tool explosion while providing powerful repair capabilities for broken rips or sync-drifted media.
OPERATIONS:
probe: Inspect media file streams and format metadata.
sync_audio: Shift audio track timing by an offset.
sync_subtitles: Shift subtitle track timing by an offset.
revert: Restore the .bak backup of a modified file.
extract_subtitles: Extract a subtitle stream to a sidecar file.
extract_clip: Extract a video segment using FFmpeg with stream copy.
extract_audio: Extract an audio segment as WAV PCM.
set_aspect: Change display aspect ratio (metadata or re-encode).
Return Format
{"success": bool, "data": dict, "message": str}
Examples
await plex_ffmpeg_mgr(operation="probe", media_key="12345") await plex_ffmpeg_mgr(operation="sync_audio", media_key="12345", offset_seconds=-1.5) await plex_ffmpeg_mgr(operation="extract_clip", media_key="12345", start_seconds=30, duration_seconds=10) await plex_ffmpeg_mgr(operation="extract_audio", media_key="12345", start_seconds=60, duration_seconds=15)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reencode | No | Full re-encode for set_aspect. | |
| media_key | Yes | Plex ratingKey of the media item. | |
| operation | Yes | Operation to perform. | |
| output_path | No | Output file path. Auto-generated in temp dir if omitted. | |
| aspect_ratio | No | Target aspect ratio (e.g. 16:9). | |
| stream_index | No | Stream index for subtitle extraction. | |
| start_seconds | No | Start offset in seconds for clip extraction. | |
| offset_seconds | No | Delay in seconds for sync operations. | |
| duration_seconds | No | Duration in seconds for clip extraction. |