{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/video-background-music-generation-with","title":"Video Background Music Generation with Controllable Music Transformer","arxiv_id":"2111.08380","date":"2021-11-16","proceeding":null,"authors":["Shangzhe Di","Zeren Jiang","Si Liu","Zhaokai Wang","Leyan Zhu","Zexin He","Hongming Liu","Shuicheng Yan"],"abstract":"In this work, we address the task of video background music generation. Some previous works achieve effective music generation but are unable to generate melodious music tailored to a particular video, and none of them considers the video-music rhythmic consistency. To generate the background music that matches the given video, we first establish the rhythmic relations between video and background music. In particular, we connect timing, motion speed, and motion saliency from video with beat, simu-note density, and simu-note strength from music, respectively. We then propose CMT, a Controllable Music Transformer that enables local control of the aforementioned rhythmic features and global control of the music genre and instruments. Objective and subjective evaluations show that the generated background music has achieved satisfactory compatibility with the input videos, and at the same time, impressive music quality. Code and models are available at https://github.com/wzk1015/video-bgm-generation.","url_abs":"https://arxiv.org/abs/2111.08380v1","url_pdf":"https://arxiv.org/pdf/2111.08380v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"video-background-music-generation-with","repo_url":"https://github.com/wzk1015/video-bgm-generation","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2111.08380","atlas_url":"https://app.syntology.ai/?focus=2111.08380","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2111.08380"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wzk1015/video-bgm-generation","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":7},"by_repo_kind":{"official":{"samples":7,"ran":7,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"c29417ebd3678088","entry":"cal_matchness","repo":"wzk1015/video-bgm-generation","repo_kind":"official","path":"src/match.py","file_url":"https://github.com/wzk1015/video-bgm-generation/blob/HEAD/src/match.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c29417ebd3678088"}},{"code_sha256_prefix":"8f4c0fe611a5fe75","entry":"nucleus","repo":"wzk1015/video-bgm-generation","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/wzk1015/video-bgm-generation/blob/HEAD/src/model.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8f4c0fe611a5fe75"}},{"code_sha256_prefix":"24207c3c9d70fcf8","entry":"resize_video","repo":"wzk1015/video-bgm-generation","repo_kind":"official","path":"src/video2npz/resize_video.py","file_url":"https://github.com/wzk1015/video-bgm-generation/blob/HEAD/src/video2npz/resize_video.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"24207c3c9d70fcf8"}},{"code_sha256_prefix":"7628e5077aee38fb","entry":"softmax_with_temperature","repo":"wzk1015/video-bgm-generation","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/wzk1015/video-bgm-generation/blob/HEAD/src/model.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7628e5077aee38fb"}},{"code_sha256_prefix":"166d227c4c912a25","entry":"softmax_with_temperature","repo":"wzk1015/video-bgm-generation","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/wzk1015/video-bgm-generation/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"166d227c4c912a25"}},{"code_sha256_prefix":"74555f5d0871cdec","entry":"weighted_sampling","repo":"wzk1015/video-bgm-generation","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/wzk1015/video-bgm-generation/blob/HEAD/src/model.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"74555f5d0871cdec"}},{"code_sha256_prefix":"a826b4cfbc9c2170","entry":"weighted_sampling","repo":"wzk1015/video-bgm-generation","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/wzk1015/video-bgm-generation/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a826b4cfbc9c2170"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}