ffmpeg-video-audio-sync

Diagnose and fix FFmpeg video-audio synchronization, concatenation, and duration mismatch issues.

6|1|Updated May 11, 2026
One-click install
npx skills add https://github.com/yakeworld/Synthos --skill ffmpeg-video-audio-sync-yakeworld
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ffmpeg-video-audio-sync
Source: https://github.com/yakeworld/Synthos/tree/main/skills/extended/external-automation/creative/video-audio/ffmpeg-video-audio-sync
Command: npx skills add https://github.com/yakeworld/Synthos --skill ffmpeg-video-audio-sync-yakeworld

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? FFmpeg composites often produce videos where audio and video drift out of sync, concatenated MP4 segments silently drop frames, or -shortest trims the wrong stream. This Skill provides a systematic diagnostic and repair workflow for these failures. ## Core Features & Use Cases - Duration Mismatch Repair: Compares stream durations with ffprobe and explicitly trims the longer stream with -t before muxing instead of relying on -shortest. - Safe MP4 Concatenation: Routes multi-segment MP4 joins through TS intermediate format with binary cat to avoid silent frame drops from PTS collisions. - Audio Normalization: Converts non-standard audio to AAC 44100Hz stereo 192kbps before combining to prevent drift. - Use Case: You have 11 slide-based MP4 scenes and a narration track that is longer than the video. The Skill diagnoses the ultrafast-preset data-loss trap, concatenates via TS, loops the video with -stream_loop -1, and verifies final stream durations differ by less than 0.2 seconds. ## Quick Start Use the ffmpeg-video-audio-sync skill to concatenate my scene MP4 files and mux the narration audio so the final video stays perfectly in sync.

Frequently Asked Questions about ffmpeg-video-audio-sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix audio and video out of sync in FFmpeg?

First compare stream durations with ffprobe, then explicitly trim the longer stream using -t before combining rather than relying on -shortest. Also normalize audio to AAC 44100Hz stereo 192kbps to prevent sample-rate drift over time.

Why does FFmpeg concat drop segments from my MP4 files?

When all MP4 segments share start_time of 0.000000, using -f concat with -c copy causes PTS collisions that silently drop segments without errors. Convert each MP4 to TS format, binary concatenate with cat, then re-encode back to MP4.

How do I concatenate MP4 files without re-encoding or losing frames?

Convert each MP4 to MPEG-TS with -c copy -f mpegts, concatenate the TS files with binary cat, then re-encode the combined TS to MP4. Direct cat on MP4 files fails due to the moov box structure.

Does the FFmpeg encoding preset affect video concatenation quality?

Yes. Scenes encoded with -preset ultrafast or fast can lose roughly 25 percent of data during TS conversion with -c copy. Always encode source segments with -preset medium or higher before container conversion.

How do I make a video loop to match a longer narration track?

Use -stream_loop -1 on the video input combined with -shortest so the video repeats until the audio ends. This avoids truncating the narration when the video is shorter than the audio track.

How do I verify audio and video durations match after muxing?

Run ffprobe with -select_streams v:0 and a:0 to read each stream duration separately. A difference under 0.2 seconds is acceptable; also confirm total nb_frames equals the sum of all segment frame counts.