Quicktime: video and sound drifting apart

What is your operating system?
Windows 10

What is your Shotcut version (see Help > About Shotcut)? Is it 32-bit?
22.09.23

Can you repeat the problem? If so, what are the steps?
I have a quicktime video (.MOV) which runs just fine in the VLC player. But after editing it with Shortcut and exporting it as MP4, video and sound are drifting apart, up to 5 seconds. The video is lagging behind the sound. However, I have the same problem with “Sony Vegas”, ist this a “Quicktime” problem? Anything I can do in the settings? Would it be helpful to convert it to MP4 first?

Thanks for any advice!
Frank

Try using Properties > Convert on the file and report back if the converted file works any better.

Hey, thanks a lot. Can you tell me which settings to use, for example should I override the frame rate?

Do not override anything. Choose any of the quality/size options.

Somehow the conversion didn’t work, but I will try again later.

So, here’s the story. I taped a concert with a simple Panasonic video camera, the recording is MP4. I want to cut the recording to single songs and upload them to YouTube into a playlist. Well, the sound quality was rather poor due to big speakers onto the inbulit microphone of the camera. Somebody I know is an excellent audio engineer and he took those MP4 files, imported them into his Apple computer and enhanced the sound with some professional software (The improvement is just incredible!) Then he rendered them into MOV files. When I play those MOV files on my Windows 10 computer they are just fine. Then I used a very old version of “Sony Vegas” to edit those MOV files into single songs. The files are about 25 minutes each and at the beginning the edited videos are fine, but towards the end of those 25 minutes sound and video are drifting more and more apart with the video lagging behind the sound. This almost 10 years old version of Sony Vegas always served my purposes well, but I thought, it’s by now at the end of its life cycle and just can’t handle the latest video formats any more, so I installed Shotcut. But I am experiencing the very same effect with Shotcut as with Vegas. What’s going on here? This is just bizarre…

Any hint appreciated!
Frank

It’s a normal Editing day from the sound of it.

I think the easiest way is to insert Jump cut for every song so that each Song is correct from the start. Then there would be little drift compared to what you are getting now.

Consider adding Chapters or Markers at the start of every song to make the workspace cleaner.

You could also add padding frames which are repeated frames made with black, light bokeh, camera-blur etc to fill in shortening sections. Get those by exporting a frame to a graphic editing program and get creative with the effects.

Another example would be picking a nice visual image and then enlarging that. So using the features of SC to zoom in on a musical instrument for some portion of time. It will also make the footage more interesting.

Enjoy :slight_smile:

Hey, thanks a lot!!! Well, I never experienced anything like that until now. As I said, the song plays in the timeline just fine, just when it’s rendered (“exported” in this case), then it’s drifting apart.

I know, in the analog world of NTSC video there was a thing called “drop frame”, as the 110V world doesn’t operate really with 60 Hz, but actually 59.99…, so in the time code every so often a frame is dropped and it jumps from e.g. 2:47:15:28 to 2:47:16:00. Is there anything like that in the digital world? Slightly varying frame rates or something?

It could be anything - who knows.

The important thing is not to fix it in the SC Timeline, that’s like fixing it on the LCD of your video camera. You have to fix it in the Exported file even if it is correct in the Timeline.

That’s what I suggest would be the most efficient use of the Editing time.

What I think has happened is that your Audio Engineer may have stretched the Audio file to correct it. Musicians aren’t metranomes and can be affected by umm… alcohol and … things … tiredness was the word that I was looking for.

I would do every song in its own .MLT file then add them all into one final .MLT for the concert then Export that. If you need to, you could write an MP4 file for every song and join those together for the final deliverable.

That way, you are going to be absolutely sure that there will be no Audio drift.

I have tried splitting up the video and sound tracks and shifting them manually to make it fit. But with music it’s awfully hard. You easily see (even when you are not paying attention) the drummer hitting the drum and the sound of this drum being too early or late if it’s just 1 of 2 frames off.

That happens because the speed of sound and the speed of light are different.

The speed of sound is 343 metres per second. If you are 34.3m from the stage that means that you will see the drummer hit the drum 1/10th second before the sound starts.

If you really want to “adjust” that then you need to do the calculation of how far the camera is from the Stage, work out the time offset then deduct that many frames.

For the 34.3m example, you’ll be deducting 11 frames from the start of the song if your framerate is set at 30fps. You’ll have to do the calculation yourself.

You can do this be moving the Audio Track in the timeline. I can’t remember how to do this off the top of my head in SC but it’s pretty easy.

I forgot to mention that the speed of sound also decreases due to temperature.

So if it’s an outdoor concert at night, the amount of Audio drift will increase by anything up to another 10% ?

Just the change in temperate might require several frames difference from the start of the Concert to the end.

In my opinion, these could be contributing factors?

This is the recommended fix and is worth another attempt.

Differences in the speed of light and sound will not accumulate to cause a 5-second lag as the OP experienced. This is more likely due to problematic timestamps in the source video. Conversion will normalize them.

@David, yes I know about that, but the camera was only 15 meters away and at the beginning it is correct and later drifts apart.

@Austin, ok I will try that. Do I convert the source file or the CS edited output file? Which settings should I use in the conversion?

Just use the “Good” option as this produces the smallest filesize and your MOV file is probably not ultra-definition anyway.

If it works and you decide the video quality is poor you could then try “Better”, but I doubt you’d need that.

Do not go into the “Advanced” settings and start changing anything - just use the defaults.

The source file. It’s too late to fix these kinds of timing problems once Shotcut starts processing it.

I was only replying in that you said the video and sound were 1-2 frames out. Even at 15m the delay is 1/20th of a second.

Here is the conversion that I had to use to get Quicktime files off my camera from the command line. You might need to set the framerate manually for the conversion as that is what I had to do.

ffmpeg -fflags +genpts -i <inputfile.MOV> -r 30 <output.mp4>

I don’t see this as a bug in SC per se. More likely something else - that was my point. A bug in the Quicktime codecs on Windows, more likely. I have recorded a fair amount of video in Quicktime format and moved it to Windows for Editing so I’m not exactly without experience in using that Codec.

The source file. It’s too late to fix these kinds of timing problems once Shotcut starts processing it.

Ok, that was my problem, I will try this tomorrow, thanks a lot!

I was only replying in that you said the video and sound were 1-2 frames out. Even at 15m the delay is 1/20th of a second.

I see. What I meant is that I had tried to shift the tracks manually, but this is very difficult and legnthy to do and even with only 1 or 2 frames off it is still wrong. Sorry for the misunderstanding

No problem.

If it’s any help, you aren’t the first person with issues exporting Quicktime from a Panasonic Camera.

fwiw I also use Panasonic Video cameras on a regular basis so I’m not really pointing the finger at them. There’s a lot of questions generally from older cameras with different codecs. Things can be very complicated and somewhere in there is where the problem lies.

The OP’s Panasonic recorder created an MP4 file. It was the audio engineer who took this, cleaned up the audio and created a MOV file. When (s)he plays the MOV files themselves they are OK. In Shotcut’s player they are OK. It is only the exported video where there is a problem. I would expect the conversion to edit-friendly action to sort this out.

1 Like