Difference between revisions of "Archive:HOW-TO:Play music with background video"

From Official Kodi Wiki
Jump to: navigation, search
(Steps)
Line 18: Line 18:
 
| Step3= Create a plan text document called [[advancedsettings.xml]] and save it to your [[userdata folder]]. Copy and paste the following into your advancedsettings.xml file:
 
| Step3= Create a plan text document called [[advancedsettings.xml]] and save it to your [[userdata folder]]. Copy and paste the following into your advancedsettings.xml file:
  
'''Where it says <code><defaultbackground></code>, be sure to replace the file name with the name of your actual background video from the previous step.'''
+
'''Where it says <code>karaokevideobg.avi</code>, be sure to replace the file name with the name of your actual background video from the previous step.'''
  
 
<syntaxhighlight lang="xml" enclose="div">
 
<syntaxhighlight lang="xml" enclose="div">
 
<advancedsettings>
 
<advancedsettings>
 
   <karaoke>
 
   <karaoke>
     <defaultbackground type="video" path="special://masterprofile/karaokevideobg.avi" /> <!-- Sets default background mode. Type could be "none", "vis" for visualisation, "image" or "video". For image/video types the "path" parameter should specify the image or video file to play. -->
+
     <defaultbackground type="video" path="special://profile/karaokevideobg.avi" /> <!-- Sets default background mode. Type could be "none", "vis" for visualisation, "image" or "video". For image/video types the "path" parameter should specify the image or video file to play. -->
 
   </karaoke>
 
   </karaoke>
 
</advancedsettings>
 
</advancedsettings>

Revision as of 19:05, 27 November 2013

not to be confused with music videos

Due to the nature of XBMC, there currently isn't an easy way in the interface to play a muted video and have a different music file play at on top of that. However, a clever trick with XBMC's karaoke feature has given one possible way to do this to hold us over, as described on this page.

Why would I want to do this?
  • Choosing a default background video for karaoke, which is what this feature was originally added for.
  • An alternative to music visualizations
  • Waterfalls? Waterfalls.
  • Christmas music while showing a video of a log fireplace

1 Steps

1 Enable karaoke support
Go to XBMC -> Settings -> Music -> Karaoke -> enable karaoke support.
2 Prepare a background video
To make it easy to figure out the file path to your video, go ahead and copy the video to your userdata folder. Note the name of the video for the next step, as you will need to note this in the <defaultbackground> section of your advancedsettings.xml file.
3 Prepare your advancedsettings.xml file
Create a plan text document called advancedsettings.xml and save it to your userdata folder. Copy and paste the following into your advancedsettings.xml file:

Where it says karaokevideobg.avi, be sure to replace the file name with the name of your actual background video from the previous step.

<advancedsettings>
  <karaoke>
    <defaultbackground type="video" path="special://profile/karaokevideobg.avi" /> <!-- Sets default background mode. Type could be "none", "vis" for visualisation, "image" or "video". For image/video types the "path" parameter should specify the image or video file to play. -->
  </karaoke>
</advancedsettings>

Note: Be sure to restart XBMC if it is running, so that it loads the new advancedsettings.xml file.

4 Create dummy lyrics files
In order to use the karaoke feature in XBMC there must be lyric files along side the music files. Since we don't actually need to see the lyrics, and we're just tricking XBMC into using the karaoke feature, we can just make dummy files instead.

These files can be simple plain text files that are named after the song file, but with the .lrc file extension. For example, whatever.mp3 would have whatever.lrc in the same folder. The file needs to be more than 0bytes, so you might need to put some spaces in there.

Linux users
If you are running linux and don't want to manually create these files, you can use the following command in the terminal to generate dummy lrc files for all songs in your current directory:
for f in *.mp3; do echo "$f.lrc" | echo " " >> "`sed -e 's/.mp3//g'`"; done
5 Add songs into XBMC's music library
Now you just need to scan the music into XBMC's library. If you haven't done this before, see adding music to the library. The short version: XBMC -> Music -> Files -> select the folder that contains the music you want to add and bring up the context menu (c on a keyboard or Guide on a remote) and select "Scan items to library".

The songs with lyric files will automatically be seen as karaoke songs.

6 Play songs and enjoy
When you play any of the songs with the dummy lyric file, the video will play in the background.


2 Notes

  • The video will restart each time a new song is played, so it won't be "seamless".
  • Thanks to leechguy from the xbmc.org forums for the original how-to.