MuVi: Video-to-Music Generation with Semantic Alignment and Rhythmic Synchronization

Ruiqi Li, Siqi Zheng, Xize Cheng, Ziang Zhang, Shengpeng Ji, Zhou ZhaoSubmission to ICLR 2025 · Rejected

Here is a concise, engaging blog-style summary of the paper.

MuVi: Video-to-Music Generation with Semantic Alignment and Rhythmic Synchronization

TL;DR

MuVi is a non-autoregressive video-to-music generation framework that produces high-quality soundtracks tightly matched to video dynamics in both emotional tone and beat-level timing. By pairing a visual adaptor trained via rhythm-aware contrastive pre-training with a flow-matching music generator, MuVi delivers fine-grained audio-visual synchronization and controllable music generation via in-context learning.

What Problem Does This Paper Address?

Creating background music for video requires addressing two distinct challenges simultaneously:

  1. Semantic alignment: Ensuring the musical theme, instrumentation, and emotion adapt as scenes shift (e.g., transitioning from quiet slumber to chaotic action).
  2. Rhythmic synchronization: Matching musical beats to instantaneous visual motion (e.g., footsteps, hits, or character actions).

Most existing video-to-music (V2M) systems only capture global clip-level mood or restrict themselves to narrow domains like dance and figure skating. Traditional video-to-audio (V2A) contrastive learning schemes also fail here: music has higher temporal density and spectral complexity than environmental sounds, making standard cross-modal negative sampling prone to shortcuts (e.g., overfitting to timbre instead of rhythm).

Methods

MuVi adopts an encoder-decoder architecture operating at 10 frames per second (FPS):

  • Visual Adaptor & Spatial Compression: Using pre-trained visual encoders (such as VideoMAE V2 or CLIP), video frames are processed into patch features. The authors introduce a lightweight visual adaptor—utilizing 2D downsampling convolution followed by Gated Softmax Aggregation—which pools spatial patches into a single frame-level vector that focuses dynamically on motion-salient regions.
  • Rhythm-Aware Contrastive Pre-Training: Before training the generator, the adaptor is pre-trained against an AudioMAE encoder using a novel objective. To prevent the model from ignoring rhythmic alignment, the authors introduce two music-specific negative sampling strategies:
  • Temporal Shift: Shifting music by non-integer beat intervals (calculated using dynamic beat tracking) to break alignment while avoiding backbeat synchronization.
  • Random Replacement: Replacing a 20–40% temporal segment of the music with a cross-faded clip from another track or silence.
  • Flow-Matching Generator (DiT): Music is represented in the latent space of a 1D Variational Autoencoder (VAE) (downsampling Mel-spectrograms by $8\times$ temporally). A Diffusion Transformer (DiT) predicts velocity fields using Rectified Flow Matching (RFM). Visual features are injected via element-wise point-to-point addition directly into the latent stream to preserve temporal synchronization. HiFi-GAN serves as the vocoder.
  • In-Context Style Control: By applying partial denoising during training (keeping an initial 1–4 second music segment clean as a context prompt), the model learns in-context musical style conditioning.

Datasets

  • Unconditional Music Data: ~50K tracks from the MTG-Jamendo dataset combined with 33.7K web-sourced tracks (~5.3K hours total, ~1.4M randomly sampled clips between 4 and 30 seconds) used to train the 1D VAE, HiFi-GAN, and unconditional DiT.
  • Synchronized Video-Music Dataset: 1.6K long-form, curated videos (~280 hours) where music and visuals were originally co-composed or tightly choreographed (e.g., classic Walt Disney animations, Tom and Jerry, Charlie Chaplin films). Vocals were stripped using Ultimate Vocal Remover.

Key Insights and Ideas

  • Element-wise conditioning preserves temporal alignment: Autoregressive cross-attention often drifts over long sequences. Direct point-to-point residual addition of video features to DiT latent features enforces strict temporal lockstep.
  • Beats require non-trivial negatives: Standard contrastive learning between mismatched videos fails to teach models temporal rhythm because the model simply learns to distinguish instrumentation or genre. Explicitly shifting audio by off-beat offsets ($kn + b$) forces the representation to capture pulse and timing.
  • Unsupervised video features beat text-aligned features for motion: VideoMAE V2 with Softmax aggregation outperformed CLIP and CAVP in beat synchronization and semantic metrics, demonstrating that self-supervised temporal motion modeling is critical for rhythmic tasks.

Key Results

MuVi was evaluated on standard music metrics (FAD, KL, IS, FD), rhythmic metrics (Beats Coverage Score - BCS, Beats Hit Score - BHS), reference-free semantic similarity (SIM), and Mean Opinion Scores (MOS-Quality, MOS-Alignment):

  • Baseline Comparison: Compared to M2UGen, MuVi substantially improved rhythm and alignment metrics:
  • BHS (Beats Hit Score): 49.23% vs. 25.14% (M2UGen) and 45.19% (MuVi trained from scratch).
  • SIM: 19.18% vs. 1.41% (M2UGen).
  • MOS-Alignment (MOS-A): 4.15 ± 0.08 vs. 3.19 ± 0.14.
  • FAD: 4.28 vs. 5.12.
  • Ablations: Dropping contrastive pre-training caused SIM to drop from 19.18% to 8.42% and BHS to fall to 47.01%. Adding both temporal shifting and segment replacement was necessary to maximize beat hit rates.
  • In-Context Learning: Provided audio prompts successfully guided generated style, achieving an average CLAP score of 0.35 while retaining an acceptable MOS-A of 3.95.

Limitations and Future Work

  • No Direct Text Guidance: MuVi currently relies on visual input (or audio context) to dictate style; it cannot take arbitrary natural language prompts (e.g., "fast-paced synthwave") during inference. The authors identify text-steerable V2M as a primary future direction.
  • Dataset Scale: The synchronized video-music paired dataset is relatively modest (280 hours across 1.6K videos) due to the scarcity of high-precision rhythmically scored video data.

Summary updated

Abstract

Generating music that aligns with the visual content of a video has been a challenging task, as it requires a deep understanding of visual semantics and involves generating music whose melody, rhythm, and dynamics harmonize with the visual narratives. This paper presents MuVi, a novel framework that effectively addresses these challenges to enhance the cohesion and immersive experience of audio-visual content. MuVi analyzes video content through a specially designed visual adaptor to extract contextually and temporally relevant features. These features are used to generate music that not only matches the video’s mood and theme but also its rhythm and pacing. We also introduce a contrastive music-visual pre-training scheme to ensure synchronization, based on the periodicity nature of music phrases. In addition, we demonstrate that our flow-matching-based music generator has in-context learning ability, allowing us to control the style and genre of the generated music. Experimental results show that MuVi demonstrates superior performance in both audio quality and temporal synchronization. The generated music video samples are available at muvi-v2m.github.io.
BibTeX
@misc{li2024muvi,
  author = {Ruiqi Li and Siqi Zheng and Xize Cheng and Ziang Zhang and Shengpeng Ji and Zhou Zhao},
  title = {{MuVi: Video-to-Music Generation with Semantic Alignment and Rhythmic Synchronization}},
  year = {2024},
  eprint = {2410.12957},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.12957},
}

Loading related content...

Figure