Audio lag in exported movie

Using Shotcut 24.11.17 under Windows 11 Pro all updates done.

Source movies taken with Canon Vixia HF R800. MediaInfo V24.12 reports all files are 60FPS, 35MB/S, with a constant frame rate of 59.94FPS.

Audio was recorded by four Rode Wireless GO II mics. ShotCut says each file is 48KHz, 32-bit floating point PCM. I split them 2 on Left and 2 on Right, picked to get some decent sound separation in the final movie.

Movie plays fine in preview. Perfect sound sync from start to finish.

My first export attempt I wanted max quality since my next step is to do some zooming effects (you may have seen my other post about how to do that). So I picked the output preset “H.264” under “Lossless”. The 1:26:38 long project became a 268Gb MP4 file. MediaInfo says it has a constant frame rate of 60FPS, 443 MBs - AAC audio, Variable bit rate 297 kbs, compression mode “lossy”. Playback in VLC 3.0.21 starts out fine at the beginning, but by the end it is lagging the video by about 5 seconds. The VLC player clock shows the movie as 1:26:43 - 6 seconds longer! Video playback stops at 1:26:38, sound keeps playing another 5 seconds!

For my second export I tried “H.264 Main Profile” under “stock” group. This produced a 6GB MP4 file. MediaInfo says it has a constant frame rate of 60FPS, 9950 kbs - AAC audio, constant bit rate 257 kbs, compression mode “lossy”. Playback in VLC is same as first: increasing lag, audio plays 5 seconds longer than video.

For my third attempt I tried the “YouTube” profile under “stock” group. This produced a 9GB MP4 file. MediaInfo says it has a constant frame rate of 59.94FPS, 14.6Mbs - AAC audio, variable bit rate 305 kbs, compression mode “lossy”. Playback in VLC is GOOD video and audio stop together at 1:26:38, no sync issues observed.

My question is why? I need to understand what happened so I can avoid it. I still have a need to do some windowed zooming on this movie, I assume best results would be to use max quality version of exported source.

Thanks in advance!

Richard Cooke

Why did the frame rate change from the others? This change might be the explanation. The export presets do not affect the export frame rate, which is based on the project’s Video Mode. The things you described should not affect frame rate, but perhaps something you changed but did not mention. What is Frames/sec really set to in Export before you make changes? Click Reset to see.

Thanks for the reply!

I made no settings changes - that I am aware of. When I started the project, it was set to adapt the settings from the first movie I added. One sec while I open the project settings and see what they say:
It says “HD 1080p 59.94”. AFAIK it has always said that, at least I have no memory of ever looking at it let alone changing it.

What test would you like me to try next?

I found this FAQ:
https://www.shotcut.org/FAQ/#i-have-trimmed-my-video-andor-created-my-project-now-how-do-i-save-or-share-it

Which has a step I did not do: “Press RESET”

So I followed these instructions using the Pro Res 422 preset.

The resulting MP4 file is 6.77Gb, has a constant frame rate, and WORKS! Sound stays synced and ends with the video!

So now my question is which preset would yield the highest quality movie for use in another round of editing? I still have to fix volume levels in a few places, and I want to try zomming in on choir faces. Meanwhile, I will re-test witth the same presets I used first, but add pressing RESET before export.

I just logged on to do a search of this very same problem. The project was originally created in June 2024, using the latest version of Shotcut available at the time, and reopened in 24.11.17. I don’t have it in front of me at the moment, but I will take a look at it when I get back home this evening.

My project is actually four different MLT files opened as clips, one right after the other. All clips are 30fps at 1080p. The finished project is 8:11 and comes in at 331 Megabytes. Audio gradually drifts, and by the end of the project is a good second or so ahead of the video. Exported as YouTube file. Also, when I open those MLT files and export them individually, the audio is output as expected.

Thoughts?

I don’t have a full grasp of whats happening. I “get” that the first reply is thinking that the source clips frame rate has to be “constant”, otherwise the video will shift/drift w.r.t. the audio.

But that does not explain why, in my case, exporting for YouTube was fine. I’m still trying to figure this out. I posted that FAQ about how to export which says to press RELOAD first. I cant find that button, just RESET. RESET seems to blow away the preset, back to the project defaults. So now I’m confused.

Ah, here is somebody back in 2018 asking about “Reload” as well!

@RickS Your problem is not exactly the same as mine, so you might want to start a new question with it. Otherwise, advice meant for my problem might mess you up.

Is parallel processing turned on in the export settings? If so, perhaps there are fewer seeks and fewer opportunities for drift if it is turned off?

I’m zoning in on the PCM / WAV export formats working as expected, while AAC (lossy) did not.

Clicking a preset automatically does a reset before applying the preset. You need to focus on why some exports gave you 60 fps when the project frame rate is 59.94. I do not know why because I do not reproduce it. Maybe something you did you forgot about.
Test it yourself with a much shorter test project (the FPS; I know you will not see the audio lag on a very short video).

Try using the export of each sub-project in the parent project. If you want better quality export the sub-projects using the intermediate/DNxHR preset.

All of the original poster’s formats used AAC.

Maybe I missed something…

I interpreted that the source audio was 32-bit PCM from Rode mics. The export with drifting audio used AAC. I am inferring that the export which worked was PCM audio based on this sentence:

…and that one worked. The preset uses 16-bit PCM. Hence, I’m experimenting with the far-fetched idea that AAC export using parallel processing might have a drift issue on very long timelines.

But he pressed Reset after choosing the preset. So he got defaults, which are similar to the YouTube preset, which he also said worked in the first post.

Hmm, it’s a confusing read, so that appears to be the detail I missed. Sorry for the goose chase.

To your original point, the time difference between 59.94fps and 60fps to play the same number of frames in the 1h28m duration range is 5 seconds, perfectly in line with the audio lag noted by the OP.

P.S. You do not need to choose a preset. All you are required to do is

  1. start Shotcut
  2. open the project
  3. click Export > Export File (or in menu File > Export > Video does the same thing)

This gives you the defaults, which is a more efficient (less file size) version of the YouTube preset.

I always recommend people start there if they are not sure what they need. You need a baseline, and defaults give you that. Then, decide what you want different and adjust. Next, choose a preset closest to what you want (based on codec/format) before adjusting things in Advanced.

I’ll try that. Thank you for the feedback.

This topic was automatically closed after 90 days. New replies are no longer allowed.