Mark the same attack twice

In the picture, mark the first frame where the note reaches its key. In the audio, mark the start of the attack. The highest waveform peak may occur later.

Official PianoMira example with animated hands, a keyboard and falling notes.
Official PianoMira example with animated hands, a keyboard and falling notes.

Convert two frames at 30 fps

Each frame spans about 33.3 ms. An attack two frames after the picture is roughly 67 ms late. Move the audio earlier in a copy and test a second attack.

Compare the two cases
30 fpsOne frame is about 33.3 ms; two span 66.7 ms
60 fpsOne frame is about 16.7 ms; two span 33.3 ms

Compare the start and end

A constant difference suggests a fixed offset. A difference that grows calls for a duration check before any frame-by-frame corrections.

Give offsets a sign before touching the timeline

Log the first depressed-key frame and the start of the corresponding audio attack. Subtract picture time from audio time. A positive result means late sound. If the picture lands at 10.000 s and the audio at 10.067 s, try moving the audio about 67 ms earlier.

A hand begins travelling before the sound. Matching its first movement to the waveform would mislabel natural preparation as lag. If you use the falling note’s arrival as your reference, use exactly that boundary for every measurement.

Separate playback latency from an error in the file

Step through the exported file in the editor, then play the same MP4 normally. If frames and waveform align but wireless headphones sound late, compare built-in speakers or a wired path. Compensating for a particular headset in the file can make the audio early everywhere else.

Offsets of +2, +2 and +2 frames near the beginning, middle and end suggest a fixed delay. A sequence of 0, +2, +4 calls for a duration check with the start anchored. For an ambiguous sub-frame difference, measure another clear attack before moving a whole performance.

Can I treat 29.97 fps as 30?

They give similar estimates over a few frames, but use the actual project and material rate when writing a correction. A variable-frame-rate source cannot always be timed precisely from frame number divided by a nominal rate. Read the timestamps of the attacks you are comparing.

References