21 Aug 2020 - The wiki is undergoing a major cleanup. If you arrived here from a search engine and cannot find the page, please use the wiki search instead (top right corner of page)
More info can be found on the forum

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

From Official Kodi Wiki
Jump to: navigation, search
(Steps)
 
(25 intermediate revisions by 3 users not shown)
Line 1: Line 1:
:'''''not to be confused with [[music videos]]'''''
+
{{outdated}}
  
<section begin="intro" />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, clever trick with XBMC's [[karaoke]] feature (thanks leechguy!) has given one possible way to do this to hold us over, as described on this page.<section end="intro" />
+
 
 +
{{warning|'''Commencing from v16, the karaoke feature in Kodi has been removed.'''}}
 +
 
 +
 
 +
{{notice|This is basically a hacky workaround and not a "normal" feature.}}
 +
 
 +
<section begin="intro" />Due to the nature of {{kodi}}, 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 the [[Archive:Karaoke]] feature has given one possible way to do this to hold us over, as described on this page.<section end="intro" />
  
 
;Why would I want to do this?
 
;Why would I want to do this?
 +
* Choosing a default background video for [[Archive: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
 
* Christmas music while showing a video of a log fireplace
* um.. that's the only one I can think of...
 
  
 
== Steps ==
 
== Steps ==
=== Enable kareoke ===
+
{{how-to
Go to {{highlight|bordered=yes|'''XBMC -> Settings -> Music -> Karaoke -> enable karaoke support.'''}}
+
| Step1-title= Enable [[Archive:Karaoke]] support
 +
| Step1= Go to {{highlight|bordered=yes|'''{{kodi}}-> Settings -> Music -> Karaoke -> enable karaoke support.'''}}
 +
| Step2-title= Prepare a background video
 +
| Step2= To make it easy to figure out the file path to your video, go ahead and copy the video to your [[Userdata|userdata folder]]. Note the name of the video for the next step, as you will need to note this in the <code><defaultbackground></code> section of your advancedsettings.xml file.
 +
| Step3-title= Prepare your advancedsettings.xml file
 +
| Step3= Create a plan text document called [[advancedsettings.xml]] and save it to your [[Userdata|userdata folder]]. Copy and paste the following into your advancedsettings.xml file:
  
=== Prepare a background video ===
+
'''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.'''
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 <code><defaultbackground></code> section of your advancedsettings.xml file.
 
  
=== Prepare your advancedsettings.xml file ===
+
<syntaxhighlight lang=xml enclose="div">
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.'''
 
 
 
<syntaxhighlight lang="xml" enclose="div">
 
 
<advancedsettings>
 
<advancedsettings>
<karaoke>
+
  <karaoke>
  <!-- Music-lyrics delay for CDG format lyrics in SECONDS. Floating number, may be negative. -->
+
    <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. -->
  <syncdelaycdg>0.0</syncdelaycdg>
+
   </karaoke>
  <!-- Music-lyrics delay for LRC format lyrics in 1/10 seconds. Floating number, may be negative. -->
 
  <syncdelaylrc>0.0</syncdelaylrc>
 
  <!-- If set to true, when the songs are added to the library, XBMC will automatically replace the song genre by "Karaoke"
 
    if the song has associated lyrics. Default is false. -->
 
  <alwaysreplacegenre>true</alwaysreplacegenre>
 
  <!-- If set to true, when the music-lyrics delay was modified while playing using subtitle delay buttons, the delay value
 
    for this song will be stored, and restored when the song is played next time. Default is true. -->
 
  <storedelay>true</storedelay>
 
  <!-- When karaoke songs are added to the library during scans, an autoincrement number is automatically assigned
 
to each song, starting from the value specified below. Default starts from 1. -->
 
  <autoassignstartfrom>1</autoassignstartfrom>
 
  <!-- If set to true (default), the background for CDG songs is always empty (plain color) no matter what setting is set in
 
    defaultbackground below. When setting this to false, then one can see through the background and see the video or
 
    visualization.-->
 
  <nocdgbackground>true</nocdgbackground>
 
  <!-- 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://masterprofile/karaokevideobg.avi"/>
 
  <!-- If non-zero, specifies the time in seconds left before the end of the current song when a window will pop up informing you
 
    about the next played song. The window does not pop up if there is no next song, or it is not a karaoke song -->
 
  <nextsongpopuptime>0.0</nextsongpopuptime>
 
</karaoke>
 
 
</advancedsettings>
 
</advancedsettings>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Be sure to restart XBMC if it is running, so that it loads the new advancedsettings.xml file.
+
{{note|Be sure to restart {{kodi}}if it is running, so that it loads the new advancedsettings.xml file.}}
  
=== Create dummy lyrics files ===
+
| Step4-title= 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.
+
| Step4= In order to use the karaoke feature in {{kodi}}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 {{kodi}}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 <code>.lrc</code> file extension. For example, <code>whatever.mp3</code> would have <code>whatever.lrc</code> in the same folder. The file needs to be more than 0bytes, so you might need to put some spaces in there.  
 
These files can be simple plain text files that are named after the song file, but with the <code>.lrc</code> file extension. For example, <code>whatever.mp3</code> would have <code>whatever.lrc</code> in the same folder. The file needs to be more than 0bytes, so you might need to put some spaces in there.  
Line 58: Line 43:
 
;Linux users
 
;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: <pre>for f in *.mp3; do echo "$f.lrc" | echo " " >> "`sed -e 's/.mp3//g'`"; done</pre>
 
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: <pre>for f in *.mp3; do echo "$f.lrc" | echo " " >> "`sed -e 's/.mp3//g'`"; done</pre>
 +
| Step5-title= Add songs into the music library
 +
| Step5= Now you just need to scan the music into the library. If you haven't done this before, see '''[[adding music to the library]]'''. The short version: {{kodi}}-> Music -> Files -> select the folder that contains the music you want to add and bring up the context menu ({{keypress|c}} on a keyboard or {{button|Guide}} on a remote) and select "Scan items to library".
  
=== Add songs into XBMC's music library ===
+
The songs with lyric files will automatically be seen as karaoke songs.
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 songs with lyric files will automatically be seen as karaoke songs.
+
| Step6-title= Play songs and enjoy
 
+
| Step6= When you play any of the songs with the dummy lyric file, the video will play in the background.
=== Play songs and enjoy ===
+
}}
When you play any of the songs with the dummy lyric file the video will play in the background.
 
  
[[Category:How-to]]
+
== Notes ==
[[Category:Advanced topics]]
+
<references />
 +
* 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.

Latest revision as of 08:53, 12 July 2020

Time.png THIS PAGE IS OUTDATED:

This page or section has not been updated in a long time, no longer applies, refers to features that have been replaced/removed, and/or may not be reliable.

This page is only kept for historical reasons, or in case someone wants to try updating it.


Stop hand.png Commencing from v16, the karaoke feature in Kodi has been removed.


Emblem-important-yellow.png NOTICE:
This is basically a hacky workaround and not a "normal" feature.

Due to the nature of Kodi, 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 the Archive: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 Archive: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 Archive:Karaoke support
Go to Kodi-> 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 Kodiif 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 Kodithere must be lyric files along side the music files. Since we don't actually need to see the lyrics, and we're just tricking Kodiinto 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 the music library
Now you just need to scan the music into the library. If you haven't done this before, see adding music to the library. The short version: Kodi-> 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.