I’ve seen that other people have also had issues with their renders having the audio and video out of sync. Since it’s still happening I thought would be worth bringing it up again.
In my case I have only noticed it now that I have used images mixed with videos in the timeline. When I used only videos before I didn’t notice the render being out of sync.
I’m using:
Linux Mint 21.3
Kdenlive 24.12.2
Standard settings for project, codecs, rendering MP4-H264/AAC
Videos are all same frame rate and encoding, all came from same place.
Images are all jpeg, all came from same place.
Audio is mp3 48kHz 256kb/s
When I’m editing in Kdenlive everything is in sync. When rendered it’s out of sync when played on VLC. When the rendered (out of sync) video is imported back into Kdenlive it plays in sync inside of Kdenlive.
When I imported it back into Kdenlive, I changed the speed of the video to 101%, rendered it again, and then the syncing sort of matched. It’s a workaround but it’s not perfect. And would depend on the length of the video for how much the speed needs to be changed.
There’s a pretty long list of reasons you might hear audio out of sync with the imagery and only a few of them are at the creator side. And just because someone else had sync problems, doesn’t at all mean that yours are related or due to the same causes - so you’re going to need to do some exploring about exactly why its happening to you.
VLC itself has options to adjust playback synchronisation - and they are needed often enough that there are hotkeys to tweak it (see J, K and tools->track synchronisation).
If your system is still using pulse, ditch it for pipewire - pulse is notorious for adding audio delay. Update your system to something newer than 2021. Then test your video with other players and on other systems.
Cry when you realise that there is no one answer to getting it perfectly synchronised everywhere except to run one of those sweep clock test patterns you’d see in old movies and tweak the player until the pips match up with the action. That thing existed for a reason.
It’s possible there’s a bug in what MLT is doing or what kdenlive is feeding it - but there’s a lot of other reasons AV streams can desync.
Oh! And how could I forget: cry again even harder when you realise that after you’ve spent enormous amounts of effort getting this all Just Perfect, as soon as someone plays your video on their big screen and sits back from their front surround speakers, it will all be out of sync for them again!
At 10m, they’ll hear the audio ~30ms later than they see the image, which is enough to be jarring for real time communication. There’s a reason that orchestra’s have a conductor waving their hands around too, and it’s not to remind them what to play. It’s that without that visual cue, they’d all be playing late if they took their timing from listening to the players at the other side of the room.
It’s on that short list of Genuinely Persistent problems.