editly icon indicating copy to clipboard operation
editly copied to clipboard

Audio out of sync

Open nikolay opened this issue 3 years ago • 2 comments

I merged a bunch of videos with different formats and codes and at one point the video started to lag behind the audio.

nikolay avatar Feb 27 '21 05:02 nikolay

if you can provide a minimal reproducable case for me to test, then i can look into it

mifi avatar Mar 27 '21 06:03 mifi

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]
};

felipemullen avatar Dec 14 '21 21:12 felipemullen