VMAS: Video-to-Music Generation via Semantic Alignment in Web Music Videos

Yan-Bo Lin, Yu Tian, Linjie Yang, Gedas Bertasius, Heng Wang

TL;DR

VMAS (Video-to-Music Alignment Scheme) is a novel generative framework that creates realistic background music directly from video inputs by learning from large-scale web videos. By combining a high-level semantic contrastive objective with a low-level video-beat alignment mechanism, VMAS ensures the generated music matches both the overarching genre of the video and its frame-by-frame motion dynamics.

What Problem Does This Paper Address?

Automatic background music generation for video is highly sought after by content creators, yet existing methods fall short in two major ways:

  1. Reliance on Symbolic Data: Most prior approaches train on symbolic music formats like MIDI. MIDI data is scarce, lacks genre diversity, and completely misses the subtle nuances of real audio, such as timbre variations, instrument expressiveness, and articulation.
  2. Poor Temporal Alignment: Existing waveform-based models often struggle to synchronize musical beats with visual events (e.g., a dancer's movement or a sudden scene cut), leading to music that feels disconnected from the video.

While some recent models leverage web videos to learn from raw audio, they are typically constrained by small-scale, narrow-domain datasets (like purely dancing videos) that generalize poorly to arbitrary video content. VMAS tackles these limitations by scaling up the training data and introducing a dual-scale alignment strategy.

Methods

The VMAS framework consists of three primary components: an efficient video encoder, an autoregressive music decoder, and a dual-scale semantic alignment scheme.

Figure 1. Our Video-to-Music Generation Framework. Our video-to-music generation framework consists of three main components: 1) an efficient video encoder for capturing fine-grained temporal cues from many densely sampled video frames, 2) an autoregressive music decoder for generating output audio tokens, and 3) a novel video-music alignment scheme that integrates a contrastive training objective and a novel video-beat alignment scheme, ensuring that the generated music exhibits high-level and low-level alignment with the video content.

1. Efficient Video Encoder

To capture fine-grained temporal cues, the model needs to look at many frames. However, standard video backbones (like Hiera or CLIP) are computationally prohibitive when densely sampled. The authors modified the Hiera architecture by drastically increasing the spatial downsampling rates in the early layers while preserving the temporal dimension. This allows VMAS to process 96 frames per 10-second clip (compared to the standard 16) at a lower computational cost (GFLOPs) than the baseline models.

2. Autoregressive Music Decoder

Continuous audio is converted into discrete tokens using EnCodec, a neural audio codec. A standard Transformer decoder then predicts these audio tokens autoregressively, conditioned on the visual features extracted by the video encoder via cross-attention layers.

3. Semantic Video-Music Alignment

To ensure the music actually fits the video, VMAS uses two complementary objectives:

  • Global Video-Music Contrastive Loss: This aligns high-level semantics. It projects the averaged video features and predicted music embeddings into a shared space, forcing the model to understand macro-level concepts like genre, mood, and style.
  • Video-Beat Alignment Scheme: This handles low-level synchronization. The model uses an off-the-shelf onset detection algorithm to find audio beats and calculates optical flow magnitudes to identify "video beats" (moments of high motion or scene cuts). It then computes an overlapping mask to dynamically weight the cross-entropy loss, punishing the model if it misses a beat during a high-action visual event.
Figure 2. Video-Beat Alignment Scheme. Our proposed alignment scheme allows us to detect moments in the video where music beats align with low-level visual cues such as dynamic human motions or scene transitions. We use Onset Detection [3] and Optical Flow to identify such aligned video-beat moments. This information is then used to supervise our video-music generation model such that it would produce music aligned with low-level dynamic visual content.

Datasets

The authors introduce DISCO-MV, a massive dataset curated specifically for video-to-background-music generation:

  • Scale: 2.28 million video-music samples spanning roughly 47,000 hours (derived from DISCO-10M and YouTube-8M). This is 2000× larger than prior symbolic datasets like SymMV.
  • Data Cleaning: Web videos are notoriously noisy. The authors automatically filtered out videos with low visual variance (intra-frame similarity > 0.7) to eliminate static "single-image" videos.
  • Vocal Removal: They applied Demucs to strip out vocals from 95% of the tracks, ensuring the model explicitly learns to generate instrumental background accompaniments.

For evaluation, the authors benchmarked on both the DISCO-MV test set and the public MusicCaps dataset.

Key Insights and Ideas

  • Compute Redistribution for Video: The modified video encoder proves that for audio-visual alignment, temporal resolution matters more than spatial resolution. Sacrificing spatial detail early on allows the model to ingest 6× more frames, capturing the exact moment an action occurs without blowing up the compute budget.
  • The Power of Soft Loss Weighting: Instead of forcing hard constraints on beat generation, using the overlapping video-music beats as importance weights ($P_{av}$) in the loss function gently guides the autoregressive model to naturally "drop the beat" during high-motion frames.
  • Dataset Quality > Dataset Size: The ablation studies showed that training on the raw, unfiltered DISCO-10M dataset yielded poor results. Cleaning the dataset by removing static videos and vocals was vital to unlocking high-fidelity generation.

Key Results

VMAS significantly outperforms existing symbolic and waveform-based baselines across multiple metrics, including Fréchet Audio Distance (FAD), KL Divergence (KL), and Music-Video Alignment (MV Align).

  • Quantitative Performance (MusicCaps): VMAS achieved an FAD score of 4.07, outperforming the state-of-the-art waveform model V2Meow (4.62) and the popular VidMusicGen (6.91).
  • Efficiency: The custom video encoder achieved these top-tier results using only 130.7 GFLOPs, compared to standard Hiera (140.2 GFLOPs) and CLIP (281.6 GFLOPs), despite processing far more frames.
  • Human Evaluation: In blind A/B testing with 200 human subjects, VMAS was preferred over 70% of the time for overall music quality and over 67% of the time for visual synchronization against competing methods.

Limitations and Future Work

While VMAS excels at generating visually synchronized instrumental tracks, the authors note a few areas for expansion:

  • User Control: Currently, the model is purely video-conditioned. The authors plan to explore a joint video-and-text-to-music architecture so users can guide the generation process using text prompts (e.g., "generate a lo-fi track for this skateboarding video").
  • Broader Applications: The underlying alignment and encoding mechanisms could easily be extended to adjacent tasks like video-music style transfer, smart video editing, and cross-modal video-music retrieval.

Summary updated

Abstract

We present a framework for learning to generate background music from video inputs. Unlike existing works that rely on symbolic musical annotations, which are limited in quantity and diversity, our method leverages large-scale web videos accompanied by background music. This enables our model to learn to generate realistic and diverse music. To accomplish this goal, we develop a generative video-music Transformer with a novel semantic video-music alignment scheme. Our model uses a joint autoregressive and contrastive learning objective, which encourages the generation of music aligned with high-level video content. We also introduce a novel video-beat alignment scheme to match the generated music beats with the low-level motions in the video. Lastly, to capture fine-grained visual cues in a video needed for realistic background music generation, we introduce a new temporal video encoder architecture, allowing us to efficiently process videos consisting of many densely sampled frames. We train our framework on our newly curated DISCO-MV dataset, consisting of 2.2M video-music samples, which is orders of magnitude larger than any prior datasets used for video music generation. Our method outperforms existing approaches on the DISCO-MV and MusicCaps datasets according to various music generation evaluation metrics, including human evaluation. Results are available at https://genjib.github.io/project_page/VMAs/index.html
BibTeX
@inproceedings{lin2025vmas,
  author = {Yan-Bo Lin and Yu Tian and Linjie Yang and Gedas Bertasius and Heng Wang},
  title = {{VMAS: Video-to-Music Generation via Semantic Alignment in Web Music Videos}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2025},
  doi = {10.1109/wacv61041.2025.00120},
}
Figure