editly
editly copied to clipboard
Audio out of sync
I merged a bunch of videos with different formats and codes and at one point the video started to lag behind the audio.
if you can provide a minimal reproducable case for me to test, then i can look into it
I had the same issue when using keepSourceAudio
, happens with any number of .mp4
clips that I tried to combine using their own audio. Updated ffmpeg but it didn't help. Found a workaround using detached-audio
layers:
(rough code port for readability)
const clips: editly.Clip[] = videoFiles.map(file => ({
layers: [
{ type: 'detached-audio', path: path.join(videoDirectory, file), start: 0 },
{ type: 'video', path: path.join(videoDirectory, file) }
]
}));
const videoConfig: editly.Config = {
outPath,
fps: 23,
// keepSourceAudio: true,
loopAudio: true,
defaults: {
transition: { duration: 0.2, name: 'dummy' },
},
clips: [firstClip, introClip, ...allClips, outroClip]
};