Fix FFmpeg out-of-sync glitches during concatenation by resetting video timestamps with setpts and resampling audio to ensure continuous timing.