Recording a song long before the camera ever rolls
Launch library · evergreen read

Unlike dialogue, which is usually filmed close to when it is spoken, a film song is typically composed and recorded well ahead of the actual shoot, sometimes months in advance. This gives the choreographer and cinematographer a finished piece of music to plan an entire sequence around, rather than working from a rough draft.
The recording session brings together the composer, lyricist, singer and a group of musicians or programmers, all working from a melody the composer has already mapped out in broad strokes. Lyrics are fitted to that melody with great care, since every syllable eventually has to match a visible mouth movement on screen.
Once the recording is finalised and approved, it is handed to the choreographer, who studies its structure closely before designing any steps at all. Only after the song exists as a finished piece of audio does the visual side of the number really begin to take shape in earnest.
This order, music first, image second, shapes the entire character of a film song, since the picture is always built to serve a melody that already exists rather than the other way round, a discipline that separates it from music simply added to finished footage later.