Audio Aligns With Video In Shotcut, But Goes Out Of Sync After Export

Unfortunately this issue goes way beyond win10 and vfr.
For FOUR hours already(!) I’ve been trying to add audio to video, but the best alignment I achieved lasted only through the first watch. Odd enough, after that first watch shotcut cuts off the beginning of the audio when I listen to it/watch the created video with sound.

I’ve tried all I could think of, but shotcut does seem to have an issue there that none of my programs in the past had, as far as I remember.

Now, without sound correctly added, sadly I cannot use it. Very disturbing for me.
If anyone has other ideas for fixing this odd behavior please let us know.

Have you updated to the just released version 18.01?

Thanks, I downloaded the new version, gonna try a new project soon, and let you know, thank you!

Has anyone found a new solution to this problem from a few years ago? I am new to shotcut and finished cutting a 4 minute music video from a variety of sources including multiple frame rates. It plays great within the app but sync drifts upon export. Is there a magic export setting or codec that I don’t know about? (I’m on windows 10) Or do I really need to reconvert my footage and overcut so that all of the frame rates are the same? Would be so thankful for any advice!

bump

This issue is resolved by using ffmpeg with vsync and async options. Variable is just that… Its variable. One time its this, the next time IT VARIES! If you are editing footage that uses these variable settings, convert to an intermediate codec, like utvideo or ffvhuff, with pcm audio and all of these issues go away.

Here is a sample from a script I use when this occurs.

ffmpeg -hide_banner -y -i INPUT.xxx -c:v utvideo -g 1 -r YOURRATE -vsync 1 -c:a pcm_s16le -ar 44100 -ac 2 -async 1 -fflags +fastseek+genpts OUTPUT.avi

This will export a lossless CONSTANT rate avi file to edit. I choose audio rate of 44100, you can choose 48000 or whatever and change ac if more channels are in the audio.

I’m having a similar issue to this, but the difference is that

  1. The audio is ahead, not the video.
  2. The video is already split from the music I’m using.

I looked to see the frame rate and it is 60 fps. I changed the music to a .wav file instead of a .mp3. I tried disabling Parallel Processing (something I do usually). And I tried to simplify the video to be less chaotic. Still nothing.

I put an example of what Shotcut shows, what it exports into, and what the timeline looks like.

The video is exporting 1920x1080 at 60fps. The video I’m using is the same and the music is .wav with a 48000 sample rate. I’m using Windows 10 and the latest version of Shotcut which is currently 18.06.02.

Example of what Shotcut shows me (excuse the lag): https://www.youtube.com/watch?v=a1Q-nbxTbNk

What it exports as: https://www.youtube.com/watch?v=S-ggMDu_330

As you can see, it gets much more desynced as it goes so that by the end it’s clearly off.
Also, if you couldn’t tell, this is from an intro to a Hardcore series on Terraria I’m doing. As a result of that and the music I ended up cramming a ton of clips into 30 seconds.

Any help would be much appreciated!

I run into this a lot as well. I don’t know if it’s because my PC isn’t fast enough or if it’s a flaw in the program itself. I use Shadowplay to record and if I set it at 60fps it tends to help. Also if you have a lot of edits/effects it’s hard to gauge if it’s in sync or not, it’s really annoying.

The work around I came up with is editing short portions of the video 30 seconds - 2 minutes at a time, exporting the small chunks to check the syncing. If it’s synced then I remove the video track which has the edits that are slowing it down and drop the synced video in it’s place, which will still have the edits, except Shotcut isn’t applying in real time, check it once more just to be sure, then move on to the next little chunk. Repeat that process and although it’s very tedious it can save you a lot of headache and frustration when you sit waiting for the video to export, only to have it finish and not be synced up correctly.

I was considering that as a solution. I’m glad to see it’s viable. I’ll give it a shot and report back on my results.

I redid the clips the way suggested and it turned out fine! (sort of). The point is, is that it’s better. I found it strange though that when I put the clips together on one track it looked out of sync for Shotcut, but when it was exported then it was fine. It’s like there’s a syncing issue in shotcut for my files.

Bangs head against desk

Oh well, it turned out fine. Thanks for the suggestion Judge.

My issue with the audio getting out of sync was caused from realtek’s audio drivers. Once I went to Realtek’s website and got the correct drivers for my motherboard, all issues of audio went away.

I tried this method, but unfortunately this didn’t seem to fix the issue.
Just to double check though, you meant this website correct? http://www.realtek.com.tw/downloads/downloadsCheck.aspx?Langid=1&PNid=14&PFid=24&Level=4&Conn=3&DownTypeID=3&GetDown=false

It’s based off of operating system, not motherboard from what I can tell.

Cool, glad it worked out. Usually I will make a lot of backups of everything just in case. I’ve accidentally screwed up a whole project because I wasn’t paying attention a couple times, so I learned my lesson. Like I said I think the issue is because Shotcut is applying effects and edits in real time. Something to look out for is when you’re playing a preview and the program hesitates for a second as it passes over an edit or effect. Usually as soon as that starts happening, I know I better start using the McGuiver method.

I actually spent 9 hours editing a 3 minute video last night. Usually I just work with 1 video and 1 audio track, but this one required 4 video tracks and one audio track, because I had to edit out teamspeak chatter and I had to crop the video to hide stuff on the player HUD for a game. So there was a lot of tiny edits and the cropping apparently puts a lot of stress on my computer. So I was having to take it even farther and editing 10 seconds at a time.

Same. it was about 8-10 seconds and still went off a little in the end. But it was suffer able.

Solved for us.

Ours wasn’t a framerate issue or any kind of audio problem (or at least not as described in the replies). The devices are working fine. Not a driver issue. None of the solutions here worked.

Although to be fair, qubodup’s and MrCorleone’s solutions may work, I just didn’t feel like trying to figure out a whole slew of new commands + new software+ split every video into a video and audio.

I found a much simpler solution.

What finally slotted it was just converting the videos (TS format) to MP4 (what we upload at the end) using Handbrake
(download here: https://handbrake.fr/downloads.php --handbrake gives you a straightforward GUI and it’s free).

Do note, we lost the first few audio seconds on a few videos. No idea why but nothing happens in there anyway for us so no big deal.

Use handbrake to convert the video to whatever format you need at the end of the process, then use shotcut to edit+export and as best as I can tell, it’ll work.

I think there’s something flawed in how shotcut converts video file types, resulting in a desync. (took forever to narrow this down, LEARN FROM ME!)
So don’t use shotcut to switch video formats and you’ll avoid syncing issues – is my hypothesis confirmed in our gaming videos at least.

Happy hunting.

2 Likes

There is an A/V sync fix coming in the next version 18.11, but I cannot guarantee it works for all files and cases. I am just saying there was a fix for what I found:

Having this issue as well, however it’s not due to clips having variable frame rates (mine don’t). Only happens when I speed up a clip beyond 10X normal. Been using the latest version for quite a while with no issues, this just started happening last night.

@Llama_Commando, thank you! Converting the original video using Handbrake did it for me. It was definitely an issue with the way shotcut converts video files. If anyone’s having this issue, try converting your original file to constant frame rate using other software and only then open in shotcut. Cheers

1 Like