Difference between revisions of "Channel icons"

From MythTV Official Wiki
Jump to: navigation, search
(Add note about script bug and give example command)
(Typo + OSX note.)
(39 intermediate revisions by 15 users not shown)
Line 1: Line 1:
One of the best sources of channel icons is http://www.lyngsat-logo.com/ . There, you can browse the available icons and choose those appropriate for your system.  However, doing so can be a lot of work (requiring many page hits and a lot of time).
+
=Channel Icon Download System=
 +
As of 0.21, MythTV includes a channel icon download system in ''mythtv-setup'' which will attempt to automatically download icons for channels in your database from services.mythtv.org. If it cannot find an icon it will present you with a list of options, and the ability to define your own search parameters.
  
An easier approach is to use [[Channel_icons.pl | channel_icons.pl]] a new feature in the post-0.20-SVN trunk of MythTV to quickly look up the information.  Doing so requires the MythTV Perl bindings (which can be compiled/installed by passing the "--with-bindings=perl" argument to the MythTV configure script). However, the script requires Perl bindings from SVN trunk. So, if you're using 0.20-fixes, please see [http://mythtv.org/docs/mythtv-HOWTO-9.html#ss9.5 the MythTV HOWTO].
+
To configure icon downloading in mythtv-setup:
 +
* run "mythtv-setup"
 +
* select "Channel Editor"
 +
* click on "Icon Download"
 +
* select either "Download all icons.." or "Rescan for missing icons.." or "Download icon for <selected channel>"
  
If you have the appropriate MythTV Perl bindings, checkout the required scripts with:
 
  
<pre>
+
==Universal Location==
svn co http://svn.mythtv.org/svn/trunk/mythtv/contrib/master_iconmap
+
Starting with version 0.27, a single location for channel icons is used.
</pre>
+
It's usually in the ''.mythtv/channels'' directory of the user
 +
that runs ''mythbackend''. Typically, ''mythtv''. The location is defined
 +
in the built-in ChannelIcons Storage Group (it's not necessary to create
 +
a ChannelIcons Storage Group. ( Note this is not normally visible in the Storage group Setup menu of mythtv-setup, it is a system storage group and hence remains hidden).
  
Doing so will create a directory called "master_iconmap" underneath the current directory.  The master_iconmap directory contains a file called "channel_icons.pl", which can be used to retrieve channel icon information.  See http://www.gossamer-threads.com/lists/mythtv/commits/255099#255099 and "./master_iconmap/channel_icons.pl --usage" for more information.
+
Note that users that set MYTHCONFDIR before starting MythTV programs
 +
override the HOME directory of the user running the backend.
  
There is currently (as of 10/08/2007) a bug in either the channel_icon.pl script or the Myth.pm file.
+
Run ''mythtv-setup'' as the same user that runs ''mythbackend'' and
 +
get a new set of channel icons. They'll be stored
 +
in the directory above.
  
[http://svn.mythtv.org/trac/ticket/4047 MythTV Ticket #4047]
+
A [[Services API]] endpoint (''<backend>:6544/Guide/GetChannelIcon?ChanId=<chanid>'') works with this
 +
feature. In fact, mythfrontend, mythweb and WebFrontend all use this to retrieve icons making this
 +
the prefect troubleshooting tool. If it doesn't work, no icons will display. [it is possible that some stale
 +
cached icons exist, but the endpoint must work for new icons.]
  
Currently, the easiest work around is to edit the channel_icon.pl script and rename the one call to "load_channels" to "_load_channels".  
+
If icons are not displayed when using the above API it is possible to verify if an icon file exists by integrating the Database directly using the following command. Note this shows all visible channel entries within the Database.  
  
=== Example ===
+
<code><pre>
 +
mysql -u mythtv -p mythconverg -e "SELECT channum,chanid,icon FROM channel WHERE visible ORDER BY channum+0;"
  
An example to get all icons installed on a brand new system would be:
+
(chanid is a generated ID number for the channel that happens when it is scanned into the database)
 +
</pre></code>
  
./channel_icons.pl --find-missing --rescan --icon-dir /path/to/store/icons
+
Symlinks added for prior MythTV versions, duplicate ''channels'' directories and
 +
any ''ChannelIcons'' [[Storage Groups]] and their contents can be removed. If linking is
 +
used be sure that both user ''mythtv'' and the frontend user
 +
have write permission on the directory! Some programs/apps create additional versions of the
 +
icons with different sizes , e.g. for ''cbs.jpg'', ''cbs.jpg.0x57.png'' may be created.
  
=International Channel Logos=
+
A Note of Caution: Some Myth distributions run ''mythtv-setup'' as the frontend user created on installation, where as the backend is frequently run as ''mythtv'', even if the frontend and backend are on same machine. This requires a symlink (ln -s /home/myuser/.mythtv/channels /home/mythtv/.mythtv/channels) or copy files. Once fixed the icons will automatically appear on mythweb and other frontends as describe above.
[http://www.mythtv.org/wiki/index.php/Netherlands#Channel_logos Netherlands]
+
 
 +
OSX all-in-one installations should put their icons here: ''/opt/dvr/var/mythtvuser/.mythtv/channels'.
 +
 
 +
== Pre 0.27 Instructions==
 +
By default the icon will be downloaded to the ''/home/<user>/.mythtv/channels'' directory. This is not very friendly when you have multiple frontends and wish them all to share the icons. One method to get around this is to use a symlink for this directory that directs to a network located directory that all your frontends have access to, say ''/var/mythtv/channels'' for example.
 +
 
 +
Before downloading the icons, do the following, or similar as per your distribution:
 +
 
 +
<code><pre>
 +
rm ~/.mythtv/channels -rf
 +
sudo mkdir /var/mythtv/channels
 +
sudo chown <user>:<group> /var/mythtv/channels
 +
ln -s /var/mythtv/channels ~/.mythtv/channels
 +
</pre></code>
 +
 
 +
You will want to run
 +
<code><pre>
 +
rm ~/.mythtv/channels -rf
 +
ln -s /var/mythtv/channels ~/.mythtv/channels
 +
</pre></code>
 +
for all the users that can run MythTV as well.
 +
 
 +
=Channel Icon Sources=
 +
One of the best sources of channel icons is http://www.lyngsat-logo.com/ .  There, you can browse the available icons and choose those appropriate for your system.  However, doing so can be a lot of work (requiring many page hits and a lot of time).  Once downloaded you should put the resulting JPEG files into ''.mythtv/channels/'' for the user running the front-end.  To add them to a channel you will need to run ''mythtv-setup'' and go to the channel editor and specify the icon file name for each channel.
 +
 
 +
Another source of channel icons is http://www.iconharmony.com/ which is targeted for icons for the harmony remote.  Some of the available icons are more stylized than the official icon (the person running the site is a graphic artist).  As with the previous source, finding an appropriate icon can be a lot of work.
 +
 
 +
==International Channel Logos==
 +
* [https://ash.ms/projects/channels Australia]
 +
* [http://www.documentjes.nl/linux/mythtv/icons/ Netherlands]
 +
 
 +
[[Category:HOWTO]]

Revision as of 17:47, 1 May 2017

Channel Icon Download System

As of 0.21, MythTV includes a channel icon download system in mythtv-setup which will attempt to automatically download icons for channels in your database from services.mythtv.org. If it cannot find an icon it will present you with a list of options, and the ability to define your own search parameters.

To configure icon downloading in mythtv-setup:

  • run "mythtv-setup"
  • select "Channel Editor"
  • click on "Icon Download"
  • select either "Download all icons.." or "Rescan for missing icons.." or "Download icon for <selected channel>"


Universal Location

Starting with version 0.27, a single location for channel icons is used. It's usually in the .mythtv/channels directory of the user that runs mythbackend. Typically, mythtv. The location is defined in the built-in ChannelIcons Storage Group (it's not necessary to create a ChannelIcons Storage Group. ( Note this is not normally visible in the Storage group Setup menu of mythtv-setup, it is a system storage group and hence remains hidden).

Note that users that set MYTHCONFDIR before starting MythTV programs override the HOME directory of the user running the backend.

Run mythtv-setup as the same user that runs mythbackend and get a new set of channel icons. They'll be stored in the directory above.

A Services API endpoint (<backend>:6544/Guide/GetChannelIcon?ChanId=<chanid>) works with this feature. In fact, mythfrontend, mythweb and WebFrontend all use this to retrieve icons making this the prefect troubleshooting tool. If it doesn't work, no icons will display. [it is possible that some stale cached icons exist, but the endpoint must work for new icons.]

If icons are not displayed when using the above API it is possible to verify if an icon file exists by integrating the Database directly using the following command. Note this shows all visible channel entries within the Database.

mysql -u mythtv -p mythconverg -e "SELECT channum,chanid,icon FROM channel WHERE visible ORDER BY channum+0;"

(chanid is a generated ID number for the channel that happens when it is scanned into the database)

Symlinks added for prior MythTV versions, duplicate channels directories and any ChannelIcons Storage Groups and their contents can be removed. If linking is used be sure that both user mythtv and the frontend user have write permission on the directory! Some programs/apps create additional versions of the icons with different sizes , e.g. for cbs.jpg, cbs.jpg.0x57.png may be created.

A Note of Caution: Some Myth distributions run mythtv-setup as the frontend user created on installation, where as the backend is frequently run as mythtv, even if the frontend and backend are on same machine. This requires a symlink (ln -s /home/myuser/.mythtv/channels /home/mythtv/.mythtv/channels) or copy files. Once fixed the icons will automatically appear on mythweb and other frontends as describe above.

OSX all-in-one installations should put their icons here: /opt/dvr/var/mythtvuser/.mythtv/channels'.

Pre 0.27 Instructions

By default the icon will be downloaded to the /home/<user>/.mythtv/channels directory. This is not very friendly when you have multiple frontends and wish them all to share the icons. One method to get around this is to use a symlink for this directory that directs to a network located directory that all your frontends have access to, say /var/mythtv/channels for example.

Before downloading the icons, do the following, or similar as per your distribution:

rm ~/.mythtv/channels -rf
sudo mkdir /var/mythtv/channels
sudo chown <user>:<group> /var/mythtv/channels
ln -s /var/mythtv/channels ~/.mythtv/channels

You will want to run

rm ~/.mythtv/channels -rf
ln -s /var/mythtv/channels ~/.mythtv/channels

for all the users that can run MythTV as well.

Channel Icon Sources

One of the best sources of channel icons is http://www.lyngsat-logo.com/ . There, you can browse the available icons and choose those appropriate for your system. However, doing so can be a lot of work (requiring many page hits and a lot of time). Once downloaded you should put the resulting JPEG files into .mythtv/channels/ for the user running the front-end. To add them to a channel you will need to run mythtv-setup and go to the channel editor and specify the icon file name for each channel.

Another source of channel icons is http://www.iconharmony.com/ which is targeted for icons for the harmony remote. Some of the available icons are more stylized than the official icon (the person running the site is a graphic artist). As with the previous source, finding an appropriate icon can be a lot of work.

International Channel Logos