Audio and video are out of sync when imported into Vegas Pro 20

MtSplashmore schrieb am 21.01.2023 um 07:28 Uhr

I've recently switched to filming on a Samsung Galaxy S22 Ultra with an attached Rode VideoMic Me-C. The video and audio are in sync when I view the raw footage on my phone. However, the video and audio are about 1/6 of a second out of sync (the video lags) when I import it into Vegas Pro 20.

I've imported some videos from my S9+ into the same project, and their video and audio are in sync. Does anyone know why the S22 footage is going out of sync?

Kommentare

EricLNZ schrieb am 21.01.2023 um 08:44 Uhr

Possibly because it's VFR with a large variation. Please post media info on the problem file. Instructions here

https://www.vegascreativesoftware.info/us/forum/faq-how-to-post-mediainfo-and-vegas-pro-file-properties--104561/

MtSplashmore schrieb am 21.01.2023 um 13:53 Uhr

Hi EricLNZ, thanks for the reply. Below is the media info of the problem file...

General
Complete name                            : C:\Users\...
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42)
File size                                : 1.14 GiB
Duration                                 : 3 min 22 s
Overall bit rate                         : 48.2 Mb/s
Encoded date                             : UTC 2023-01-20 00:18:22
Tagged date                              : UTC 2023-01-20 00:18:22
com.android.version                      : 13

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L5.1
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 1 frame
Format settings, GOP                     : M=1, N=30
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 3 min 22 s
Bit rate                                 : 48.0 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 30.000 FPS
Minimum frame rate                       : 29.990 FPS
Maximum frame rate                       : 30.000 FPS
Real frame rate                          : 30.000 FPS
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.193
Stream size                              : 1.13 GiB (99%)
Title                                    : VideoHandle
Language                                 : English
Encoded date                             : UTC 2023-01-20 00:18:22
Tagged date                              : UTC 2023-01-20 00:18:22
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 3 min 22 s
Source duration                          : 3 min 22 s
Bit rate mode                            : Constant
Bit rate                                 : 256 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 6.18 MiB (1%)
Source stream size                       : 6.18 MiB (1%)
Title                                    : SoundHandle
Language                                 : English
Encoded date                             : UTC 2023-01-20 00:18:22
Tagged date                              : UTC 2023-01-20 00:18:22
mdhd_Duration                            : 202686

MtSplashmore schrieb am 21.01.2023 um 14:07 Uhr

PS I'm surprised to see 'Variable' as the Frame Rate Mode above, because I thought I turned it off in the camera settings... (see attached screenshot of my settings). Thought the minimum and maximum frame rates are very close

Musicvid schrieb am 21.01.2023 um 14:44 Uhr

@MtSplashmore I'm not surprised that you are surprised, because this is a common but mostly undocumented shortcoming of the MediaInfo application, not your footage.

Your frame rate mode is Constant. Believe it.

Here's the tl;dr

The MediaInfo error occurs, often with Handbrake encodes but also others like yours, because:

  • MediaInfo cannot rely on reported framerate metadata, there are simply too many traps and pitfalls.
  • In order to find the framerate, MediaInfo divides the measured frame interval by the internal clock frequency (in ticks) of your sample.
  • If the quotient is a rational number (a discrete fraction), everything is fine; a constant frame rate is reported in MediaInfo. If the result is an irrational number (either the numerator or nominator is a noninteger and not equal to zero), then your binary computer language is in trouble because it does not understand it. So it simply reports the numbers rounded up and rounded down to their nearest rational neighbors.
  • So, we have what is commonly known as clock jitter, or rounding error. If you took all of the +/- numbers from your clip and averaged them, you would indeed get the target frame rate.
  • All that MediaInfo can do at the present is report the high and low "rationalized" numbers, and call the frame rate "variable." Perhaps they will refine this with a smarter algorithm at some point in the future. But it's been this way ever since MediaInfo hit the streets.
  • If MediaInfo reports a difference of greater than one frame, your media frame rate is probably variable.
  • One can find a few more posts about this on the Handbrake forum. Here's a common NTSC fixed frame rate that almost always reports as variable in MediaInfo:
  • 30(fps) x 1000/1001(NTSC) / 90,000hZ(clock) = ? Given the additional rounding written by some cameras, and your actual frame rate may be just that (~29.970)

Sorry, it seems I'm always in teacher mode this time of year...

EricLNZ schrieb am 21.01.2023 um 22:52 Uhr

@Musicvid Thanks but I must admit my head is going around in circles.

So it's not a framerate problem with that file. To my inexperienced mind the file info looks normal.

@MtSplashmore Post media info on one of your S9 files so we can compare them.

Musicvid schrieb am 21.01.2023 um 23:03 Uhr

So it's not a framerate problem with that file. To my inexperienced mind the file info looks normal.

Yes that is the impression I have. Should have mentioned it.

MtSplashmore schrieb am 21.01.2023 um 23:11 Uhr

Thank you both for helping me with this one, I really appreciate it! There always seems to be a bit of troubleshooting when I switch to new hardware haha :) Here's the media info for an S9 file...

General
Complete name                            : C:\Users\...
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42)
File size                                : 3.37 GiB
Duration                                 : 10 min 0 s
Overall bit rate                         : 48.3 Mb/s
Encoded date                             : UTC 2023-01-21 00:00:53
Tagged date                              : UTC 2023-01-21 00:00:53
com.android.version                      : 10

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L5.1
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 1 frame
Format settings, GOP                     : M=1, N=30
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 10 min 0 s
Bit rate                                 : 48.0 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Rotation                                 : 180°
Frame rate mode                          : Variable
Frame rate                               : 30.000 FPS
Minimum frame rate                       : 16.222 FPS
Maximum frame rate                       : 33.346 FPS
Real frame rate                          : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.193
Stream size                              : 3.35 GiB (99%)
Title                                    : VideoHandle
Language                                 : English
Encoded date                             : UTC 2023-01-21 00:00:53
Tagged date                              : UTC 2023-01-21 00:00:53
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
mdhd_Duration                            : 600056
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 10 min 0 s
Bit rate mode                            : Constant
Bit rate                                 : 256 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 18.3 MiB (1%)
Title                                    : SoundHandle
Language                                 : English
Encoded date                             : UTC 2023-01-21 00:00:53
Tagged date                              : UTC 2023-01-21 00:00:53

Musicvid schrieb am 21.01.2023 um 23:23 Uhr

Frame rate mode                          : Variable
Frame rate                               : 30.000 FPS
Minimum frame rate                       : 16.222 FPS
Maximum frame rate                       : 33.346 FPS
Real frame rate                          : 30.000 FPS

Yes, your S9 file is indeed variable frame rate. You "may" have a smoother experience by converting it in Shutter Encoder, or it may work fine for you in Vegas 20.

With your S22 footage, you might try changing your Vegas AVC decoder to "Enable Legacy AVC Decoding" in Options->Preferences->File I/O and see if that helps with your audio lead. Or, you may need to use Shutter Encoder or Handbrake first. Or, you can probably just ungroup and slip your audio track a little.

MtSplashmore schrieb am 22.01.2023 um 00:35 Uhr

With your S22 footage, you might try changing your Vegas AVC decoder to "Enable Legacy AVC Decoding" in Options->Preferences->File I/O and see if that helps with your audio lead.

That has definitely helped! The audio still leads, but only by 1 frame now, which is possibly a normal/undetectable amount?

Also, how does "Enable Legacy AVC Decoding" fix this issue? (I'm hoping to understand a bit more about the settings in Vegas Pro).

Thank you both :)

Musicvid schrieb am 22.01.2023 um 02:52 Uhr

All good questions.

  • Vegas has two AVC decoders, which decide sync delay, among other things. You are now using the older version called coumpoundplug.dll [corrected /]
  • Depending on your camera-to-subject distance, +/- 1 frame is usually not objectionable. As the distance from the camera increases, our ears "expect" to hear a delay, so a 1 frame lead may feel unnatural.
  • For instance: at 25 feet, measured at sea level and room temperature, the audio delay is 22 ms., or about one video frame. The ears can tolerate more delay than lead, so some encoders set it about 40 ms delay for everything. We tend to laugh when we hear foreign-audio dubbed movies in the +/- 500 ms range. 😏

Feel free to mark one of the responses as "The Solution,' if you wish.

EricLNZ schrieb am 22.01.2023 um 03:28 Uhr

@Musicvid If s04coumpoundplug.dll (I assume you mean S04compoundplug.dll) is the older AVC decoder what is the new one that VP is using?

MtSplashmore schrieb am 22.01.2023 um 06:22 Uhr

Depending on your camera-to-subject distance, +/- 1 frame is usually not objectionable. As the distance from the camera increases, our ears "expect" to hear a delay, so a 1 frame lead may feel unnatural.

Hmm, given this, I may manually adjust the audio position. If I'm trying to do this for 20 or so clips, I know how to ungroup the audio from the video in bulk, and how to move the audio in bulk... but is there an easy way to then regroup all the video and audio tracks again? Or will I have to group the video with the audio one by one? (Hopefully that makes sense!)

Musicvid schrieb am 22.01.2023 um 14:54 Uhr

If you regroup them, they will show an out of sync warning, which can be mildly annoying.

A better approach is to move them all at the track level. Ungroup all the audio events from the video, then select all audio events on a track and hit G. Then they will all move together; when you reach the right offset point, use the Lock Track function to keep them in their new place.

MtSplashmore schrieb am 23.01.2023 um 00:29 Uhr

If you regroup them, they will show an out of sync warning, which can be mildly annoying.

A better approach is to move them all at the track level. Ungroup all the audio events from the video, then select all audio events on a track and hit G. Then they will all move together; when you reach the right offset point, use the Lock Track function to keep them in their new place.

Thanks! Though I must be using the Lock Track function incorrectly, as I'm still getting an out-of-sync warning. But at least now they're in the right place :)

Musicvid schrieb am 23.01.2023 um 00:36 Uhr

Not sure if I got it right @EricLNZ I rarely need to change the default.

I think the default AVC decoder is your GPU, whatever that may be.

I'm sure @RogerS can set it straight.

RogerS schrieb am 23.01.2023 um 03:08 Uhr

The gist of it is right so names aren't so important but the new decoder is so4compound and legacy one is compoundplug. You can see the decoder in use in media properties.

For AVC the new decoder does use GPU decoding hardware.

Musicvid schrieb am 23.01.2023 um 03:25 Uhr

Thank you.

nikos_xrim schrieb am 18.10.2024 um 21:29 Uhr

"Enable Legacy AVC Decoding" in Options->Preferences->File I/O and see if that helps with your audio lead. Or, you may need to use Shutter Encoder or Handbrake first. Or, you can probably just ungroup and slip your audio track a little.

This worked out on Vegas Pro 22 as well. Thanks mate