Fixing mythvideo missing coverart and metadata

I’ve never managed to get mythvideo to find cover art and metadata for all of my videos, but I have discovered that a lot of it has to do with the naming of your video files. So I thought I would share some tips and tricks for getting metadata and cover art to work on mythvideo.

1. Understand the file naming conventions found here –> Originally I had all of my files named in this format:


I found that the metadata script used by mythtv didn’t use the date to help isolate the video and hence there were too many videos returned from and  mythvideo didn’t know which one to choose. By removing the brackets, I found that I fixed heaps of videos immediately, as the date helped to resolve multiple returned results.

eg. would return 9 possible results.

But would only return 1.

2. Use the correct spelling – I found quite a few videos with incorrect spelling. This cause the metadata not to be found.

Eg. should be

Also watch for words spelt differently in different countries.

eg. Dont.tell.mum.the.Babysitters.Dead.1991.mp4 should be

3. Numbers are not well liked. I had heaps and heaps of trouble trying to work out these sort of filenames. I think there is a limitation with the script used in mythvideo as site resolved these fine but not mythvideo.


I found the easiest way to deal with these file names was to put the number inside a set of single quotation marks ‘ ‘. So would get the following instead.


4. Punctuation can cause issues. I found some of my files names with punctuation can fail to find metadata. The simple fix is to remove the offending punctuation.

eg. Dirty.Dancing.-.Havana.Nights.2004.avi –> Dirty.Dancing.Havana.Nights.2004.avi


DVB-T Signal test on Linux

If you want to know if you are getting a good signal strength through your DVB tuner card, this is how to test it on linux. There is a guide here, but it’s not very descriptive. I have ubuntu, so it might be slightly different for other distributions. First of all you need to install the LinuxTV dvb-apps package if you haven’t got it already. Go here for further information, but on ubuntu install like this:

apt-get install dvb-apps

First of all you need to use dvb scan to create a channel.conf file to use with tzap. Without a channel file, tzap won’t know what to look for. On your linux system you should have a directory full of dvb channel information for your region – mine is under “/usr/share/dvb/dvb-t/”.  You will find the channel information is stored under your country code. Eg. for australia all the available channel files are under au*.

 ls -l /usr/share/dvb/dvb-t/au*
-rw-r--r-- 1 root root  364 Dec 27  2011 /usr/share/dvb/dvb-t/au-Adelaide
-rw-r--r-- 1 root root  371 Dec 27  2011 /usr/share/dvb/dvb-t/au-AdelaideFoothills
-rw-r--r-- 1 root root 1344 Dec 27  2011 /usr/share/dvb/dvb-t/au-Bendigo
-rw-r--r-- 1 root root  380 Dec 27  2011 /usr/share/dvb/dvb-t/au-Brisbane
-rw-r--r-- 1 root root  446 Dec 27  2011 /usr/share/dvb/dvb-t/au-Cairns
-rw-r--r-- 1 root root  360 Dec 27  2011 /usr/share/dvb/dvb-t/au-canberra
-rw-r--r-- 1 root root  363 Dec 27  2011 /usr/share/dvb/dvb-t/au-Canberra-Black-Mt
-rw-r--r-- 1 root root  451 Dec 27  2011 /usr/share/dvb/dvb-t/au-Coonabarabran
-rw-r--r-- 1 root root  324 Dec 27  2011 /usr/share/dvb/dvb-t/au-Darwin
-rw-r--r-- 1 root root  558 Dec 27  2011 /usr/share/dvb/dvb-t/au-Devonport
-rw-r--r-- 1 root root  442 Dec 27  2011 /usr/share/dvb/dvb-t/au-FraserCoast-Bundaberg
-rw-r--r-- 1 root root  777 Dec 27  2011 /usr/share/dvb/dvb-t/au-GoldCoast
-rw-r--r-- 1 root root  649 Dec 27  2011 /usr/share/dvb/dvb-t/au-Goulburn-Rocky_Hill
-rw-r--r-- 1 root root  458 Dec 27  2011 /usr/share/dvb/dvb-t/au-Hervey_Bay-Ghost_Hill
-rw-r--r-- 1 root root  390 Dec 27  2011 /usr/share/dvb/dvb-t/au-Hobart
-rw-r--r-- 1 root root  447 Dec 27  2011 /usr/share/dvb/dvb-t/au-Mackay
-rw-r--r-- 1 root root  382 Dec 27  2011 /usr/share/dvb/dvb-t/au-Melbourne
-rw-r--r-- 1 root root  371 Dec 27  2011 /usr/share/dvb/dvb-t/au-Melbourne-Upwey
-rw-r--r-- 1 root root  732 Dec 27  2011 /usr/share/dvb/dvb-t/au-MidNorthCoast
-rw-r--r-- 1 root root  354 Dec 27  2011 /usr/share/dvb/dvb-t/au-Newcastle
-rw-r--r-- 1 root root  374 Dec 27  2011 /usr/share/dvb/dvb-t/au-Perth
-rw-r--r-- 1 root root  375 Dec 27  2011 /usr/share/dvb/dvb-t/au-Perth_Roleystone
-rw-r--r-- 1 root root  289 Dec 27  2011 /usr/share/dvb/dvb-t/au-SpencerGulf
-rw-r--r-- 1 root root  402 Dec 27  2011 /usr/share/dvb/dvb-t/au-SunshineCoast
-rw-r--r-- 1 root root  633 Dec 27  2011 /usr/share/dvb/dvb-t/au-Sutherland
-rw-r--r-- 1 root root  414 Dec 27  2011 /usr/share/dvb/dvb-t/au-Sydney_Kings_Cross
-rw-r--r-- 1 root root  490 Dec 27  2011 /usr/share/dvb/dvb-t/au-Sydney_North_Shore
-rw-r--r-- 1 root root 1183 Dec 27  2011 /usr/share/dvb/dvb-t/au-Tamworth
-rw-r--r-- 1 root root  380 Dec 27  2011 /usr/share/dvb/dvb-t/au-Townsville
-rw-r--r-- 1 root root  133 Dec 27  2011 /usr/share/dvb/dvb-t/au-unknown
-rw-r--r-- 1 root root  383 Dec 27  2011 /usr/share/dvb/dvb-t/au-WaggaWagga
-rw-r--r-- 1 root root 1309 Dec 27  2011 /usr/share/dvb/dvb-t/au-Wollongong

So if I was in the Wollongong region I would type the following to get my channels.conf file created.

$ scan /usr/share/dvb/dvb-t/au-Wollongong > channels.conf

It should go off and scan your regions channels for you. You should see something like this:

 scanning /usr/share/dvb/dvb-t/au-Wollongong
 using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
 initial transponder 697500000 1 3 9 3 1 1 0
 initial transponder 655500000 1 3 9 3 1 1 0
 initial transponder 613500000 1 3 9 3 1 1 0
 initial transponder 634500000 1 3 9 3 1 1 0
 initial transponder 711625000 1 2 9 3 1 2 0
 initial transponder 690500000 1 3 9 3 1 1 0
 initial transponder 599500000 1 3 9 3 1 1 0
 initial transponder 585500000 1 3 9 3 1 1 0
 initial transponder 592500000 1 3 9 3 1 1 0
 initial transponder 676500000 1 2 9 3 1 2 0
 0x0000 0x02a1: pmt_pid 0x0000 ABC -- ABC1 (running)
 0x0000 0x02a2: pmt_pid 0x0000 ABC -- ABC2 / ABC4 (running)
 0x0000 0x02a0: pmt_pid 0x0000 ABC -- ABC News 24 (running)
 0x0000 0x02a3: pmt_pid 0x0000 ABC -- ABC1 (running)
 0x0000 0x02a6: pmt_pid 0x0000 ABC -- ABC Dig Music (running)
 0x0000 0x02a7: pmt_pid 0x0000 ABC -- ABC Jazz (running)
 0x0000 0x02a4: pmt_pid 0x0000 ABC -- ABC3 (running)
 Network Name 'ABC NSW'
 WARNING: filter timeout pid 0x0011
 scan /usr/share/dvb/dvb-t/au-Wollongong > channels.confWARNING: filter timeout pid 0x0010
 Network Name 'MH Illawarra'
 0x0000 0x0001: pmt_pid 0x0000 WIN Television -- WIN Illawarra (running)
 0x0000 0x000a: pmt_pid 0x0000 WIN Television -- GEM Illawarra (running)
 0x0000 0x000f: pmt_pid 0x0000 WIN Television -- GOLD (running)
 0x0000 0x0002: pmt_pid 0x0000 WIN Television -- GO! Illawarra (running)
 0x0000 0x0809: pmt_pid 0x0180 SC Media -- SC10 Wollongong (running)
 0x0000 0x0829: pmt_pid 0x0776 SC Media -- ONE Wollongong (running)
 0x0000 0x0849: pmt_pid 0x0780 SC Media -- ELEVEN (running)
 Network Name 'SCA'
 0x0000 0x0351: pmt_pid 0x0401 SBS -- SBS ONE (running)
 0x0000 0x0355: pmt_pid 0x0400 SBS -- SBS HD (running)
 0x0000 0x0352: pmt_pid 0x0402 SBS -- SBS TWO (running)

Etc.. etc…. it might take several minutes to run, but in the end you should have the channels.conf we need to run our signal tests with. If you look inside of channels.conf you should see something like this:

 cat channels.conf

Now all you need to do is use the script available here written by José Oliver Segura. This script is quite good, as it calculates the signal strenght for us and make sense of all those number tzap produces. You can download a copy of the script here also. You may need to modify the $channelsConf variable to point to wherever you have saved your channels.conf file. Run is like this:

$ perl testsignal > results.txt &

It will now go off and test your channel’s and save the results in results.txt. I had quite a few channels, so it took me some considerable time to run this script. If you want to watch the progress, then just tail the results.txt file.

$ tail -f results.txt

You should see something like this:

Tunning channel ABC News 24 (226500000)
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
tuning to 697500000 Hz
video pid 0x0204, audio pid 0x0000
status 01 | signal 8480 | snr 0000 | ber 00000000 | unc 00000c78 |
status 01 | signal 9bf8 | snr 0000 | ber 00000000 | unc 00000c78 |
status 1f | signal 4ac0 | snr acac | ber 00000000 | unc 00000c78 | FE_HAS_LOCK (Ignoring to let tuner/decoder settle.(2)
status 1f | signal 4ac0 | snr acac | ber 00000000 | unc 00000c78 | FE_HAS_LOCK (Ignoring to let tuner/decoder settle.(1)
Signal: 29%     BER 0   UNC 3192
Signal: 29%     BER 0   UNC 3192
Signal: 29%     BER 0   UNC 3192
Signal: 29%     BER 1693        UNC 3192
Signal: 29%     BER 1693        UNC 3192
Signal: 29%     BER 1693        UNC 3192
Signal: 29%     BER 1693        UNC 3192
Signal: 29%     BER 1693        UNC 3192
Signal: 29%     BER 1490        UNC 3192
Signal: 29%     BER 1490        UNC 3192

More than 7 days mythtv Australian EPG data with Shepherd

One thing that I have found useful on mythtv is to have more than 7 days of guide data on mythtv. I always find more station advertise new shows during ad breaks at least 2 weeks before hand, so I find trying to get 14 days data into my guide much more helpful than just the standard 7 days.

First of all, this only works if you are using the shepherd scripts for your guide data.

All you need to do is to go to the directory where shepherd is install (usually ~/.shepherd) and type the following:

~/.shepherd/shepherd --component-set shepherd:days=14

You should get something like this:

shepherd v1.7.1 (linux)
Reading configuration file: /home/mythtv/.shepherd/shepherd.conf
Reading channels file: /home/mythtv/.shepherd/channels.conf
Set default options for shepherd to: --days=14

This will enable shepherd to get 14 days of data from now on. The next time shepherd runs (within 24 hours) 14 days of guide data should appear for channels that have it available. I have found that some channels don’t have 14 days of data available – so it obviously will not work for these channels. If you want something other than 14 days, just change 14 in the command to whatever you like.

Turn mythtv recordings into mp4 files

This piece is a work in progress, but I figured I should publish it slowly as I continue to add to it, as it might help people, even though it is not quite working yet. I’ve had it working in the past, but it’s not quite working on my setup yet.

I’ve spent a lot of time playing around with mythtv recordings to try and keep them for later viewing in a format that is transferable to other devices, players etc. I have found x264 encoding in an mp4 container to work quite well – especially for transferring to my ipad or iphone for viewing.

In this guide I re-encode my mythtv nuv files into mp4 x264 files and save them into my videos for viewing through mythvideo. I use the script which I have found to be the best script available for doing the re-encoding – though if you know of a better script, feel free to point it out.

1. Configure mythnuv2mkv script on your system 

Setup a custom job utilising the bash script. You will first need to get it here –>

I suggest you place it somewhere on your system where all users can access. I’ve put mine in /usr/local/bin/
Make sure you chmod 755 to ensure it is executable.

2. Install dependencies for the mythnuv2mkv script to work

Install the dependencies required for it to work. I suggest installing all of the mp4 and mkv dependencies.

$ sudo apt-get install mplayer mencoder wget imagemagick x264 faac faad gpac vorbis-tools mkvtoolnix

3. Customise the script to your liking

There a quite a few options to consider for the mythnuv2mkv script. The options are stored in a seperate file named mythnuv2mkv.cfg which resides in the same directory/folder as the script. Here is a copy of what I have to help you.

4. Setup a user job on mythtv.

You will need to setup a user job in order to call the script from mythtv. The easiest way is to use mythweb to do this. I have a previous post on this here — Adding a mythtv job using mythweb

Using this guide, make the following changes to these variables and save them .

 JobAllowUserJob1 = 1
 UserJob1 = /usr/local/bin/ --jobid=%JOBID% --quality=med --copydir=/media/videos/newly.exported --chanid=%CHANID% --starttime=%STARTTIME%
 UserJobDesc1 = Convert to mp4

Restart mythtv-backend in order to enact the changes. Remember that if you do this, you can cause programs that are being recorded to be interrupted. I suggest that if you have anything recording that you wait until nothing important is recording before restarting mythtv-backend.

5. Test the user job.

Now that you have the script and user job added to mythtv, you just need to find a recording and test it.

Adding a mythtv job using mythweb

Here are some simple instructions on how to setup a job within mythtv using the mythweb plugin. The mythtv site has some information on user jobs, but not very descriptive on how to setup through mythweb.

  1. Go to your mythtweb web page – wherever that may be (e.g.
  2. Click on the settings icon
  3. Choose the setting for mythtv – you should now have a list of settings similar to this. Make sure you have the “Edit settings for: -All Hosts-” is selected.

4. Within the table you should find 3 fields that you need to change in order to get a job configured. These are :

  • JobAllowUserJob1 – this needs to be set to 1 for on (as opposed to 0 for off)
  • UserJobDesc1 – this is a simple description for the job. Whatever you want to make it.
  • UserJob1 – this is the command you want to run itself (e.g. /usr/local/bin/ –jobid=%JOBID% –quality=med –copydir=/media/videos/newly.exported –chanid=%CHANID% –starttime=%STARTTIME)

You can essentially run whatever script you like as a user job. Go to this page on the mythtv site for a description on the job arguments. The example I have used is from my previous blog on setting up the mythnuv2mkv script which is quite useful for exporting TV recordings for later use. Click here for more information.

5. Now once you make the changes you want, make sure you press the “Save” button at the bottom of the form to commit the changes.

6. In order to use the new job, you will need to restart mythtv.

$ /etc/init.d/mythtv-backend restart
$ service mythtv-backend restart

The job should now be ready to go. All you need to do is highlight the TV recording you want to run the job on press the menu button on your remote and you should see under the job options section your job description. Select it and it should run. Under system status you can view the job status.

I hope that helps.

Install Digital Now Quad Card on mythbuntu 10.10 64-bit

I found the Digital Now Quad Tuner card worked great in my mythtv server and was well worth the $199 AUD price tag. In fact, it’s probably the best tuner I have ever used with mythtv. However I did have to do a few things to get it to work, as it doesn’t work straight out of the box – at least on mythbuntu 10.10 64-bit with kernel 2.6.35-28. It doesn’t work on 11.04 on kernel 2.6.38-8. I googled around and put together the following to get it to work.

First of all you need to install all sorts of packages that are needed to compile the drivers. I’m not sure whether you need all of these, but if you install these you should be okay.

I did everything below as root.

apt-get install fakeroot build-essential
apt-get install crash kexec-tools makedumpfile kernel-wedge
apt-get install git-core libncurses5 libncurses5-dev
apt-get install libelf-dev libdw-dev asciidoc binutils-dev

do uname -a to get the current kernel version you are using.

root@clumix:~# uname -a
Linux clumix 2.6.35-28-generic #49-Ubuntu SMP Tue Mar 1 14:39:03 UTC 2011 x86_64 GNU/Linux

now install the headers for that version. Example:

apt-get install linux-headers-2.6.35-28-generic


unzip the package by running this


You should then have a directory called “Linux4Quad” – change to this directory

cd Linux4Quad

Untar the tar-bzip file in this directory.

tar jxvf digitalnow-quad.tar.bz2

You should now have a directory called “digitalnow-quad” – change to this directory.

cd digitalnow-quad

And now there is yet another tar-bzip file to uncompress. Don’t run the script as it won’t work.

tar jxvf v4l_dvb_digitalnow.tar.bz2

Now you need to modify the “.version” file under the “v4l” directory to match your kernel version.


Now you need to compile the software and this will take time to complete depending on your PC specs. I found on a quad core machine it took about 10 minutes. Run this from the “digitalnow-quad” directory.


Once this completes successfully you need to run this to install:

make install

then reboot the machine.

I found that for some reason my MCE remote stopped working. I suspect the mceusb module was being loaded incorrectly due to the installation of a custom v4linux drivers (or something silly). So I edited /etc/modprobe.d/blacklist.conf

and add

blacklist mceusb

rebooted again and all worked fine.

Note: you may find that if you update you kernel that you will need to recompile and reinstall these drivers in order for the card to work again.

restart mythfrontend using your remote control and irexec

mythfrontend sometimes freezes on me. So I configured a button on my remote control to enable me to kill mythfrontend and restart it. This is really useful especially if you don’t have a keyboard and mouse plugged into your machine all the time or if you just want to make it all wife friendly. Here’s how I did it on my Fedora Core 12 mythtv frontend.

First of all – I’m assuming you already have your remote control working under lircd.

Second of all I used this guide to get me started –>

But I found it didn’t quite work for me, so I modified it a little.

First I created the script similar to the guide above in my mythtv user local bin directory (in my case /home/mythtv/bin/) and called it

# script to restart mythfrontend
for x in `ps -C mythfrontend | grep -v PID` end; do
test $x != 'mythfrontend' && continue
if [ $RUNNING = 1 ]; then
`killall mythfrontend`
`mythfrontend &`

Next I created an entry in my .lircrc file to run irexec. irexec is used to run programs when a particular button is pressed on your remote – in my case I wanted the Power button on my remote to run the script above when pressed – this is defined in the .lircrc file and in my case it is stored under /home/mythtv/.lircrc – yours might be somewhere esle depending on your setup. Go here to read more about irexec –>

prog = irexec
remote = mceusb
button = Power
config = /home/mythtv/bin/ &

Now you need to setup your session to run up irexec when you log in or the server starts up. This is done whilst logged into the user you run mythfrontend as. In my case I have gnome installed so I just go to “System” –> “Perferences” –> “Startup Applications” on the gnome display. You should get something like this (mine is a little cut-off):

Startup Application Perferences

Press “Add” and fill in the name as “irexec” or anything you want really; command as “/usr/local/bin/irexec -d /home/mythtv/.lircrc”; put in a comment if you like or not; then press “Add”. This should now startup irexec when your session starts up.

I suggest you now give your machine a reboot and test it – you might want to check whether your mythbackend is recording anything before you reboot otherwise you will interrupt your recordings. Also if you haven’t already, your might find it easier to setup Fedora to auto login at startup – I’ve written a guide here.

Once rebooted you should be able to press the power button on your remote once to kill mythfrontend and again to start it back up again. That’s it. I welcome comments, feedback and suggestions to make this better or easier.

DViCO FusionHDTV DVB-T Dual Express setup on Linux (Fedora 10)

I purchased a DVICO FusionHDTV DVB-T Dual Express recently and I had quite a hard time getting it to work on Fedora Core 10 (FC10). I did get it to work so I thought I would share what I did. It works well on mythtv.

Step 1) Download v4l-dvb version that works!

hg clone

Step 2) Compile and install the v4l-dvb software (you should be root)

cd v4l-dvb
make install

Step 3) Download and install the firmware.

There is a small script included that you can use to get the firmware. It is under v4l-dvb/linux/Documentation/video4linux/

If you take a quick look inside of this script it should explain how to use it. Here are the instructions from the script.

# In order to use, you need to:
#	1) Download the windows driver with something like:
#		wget
#	2) Extract the file hcw85bda.sys from the zip into the current dir:
#		unzip -j Driver85/hcw85bda.sys
#	3) run the script:
#		./
#	4) copy the generated file:
#		cp xc3028-v27.fw /lib/firmware

Step 4) Reboot. This should complete everything you need to do.

Step 5) Check dmesg log to see if it works. You should see something like this:

cx23885 driver version 0.0.1 loaded
cx23885 0000:03:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
CORE cx23885[0]: subsystem: 18ac:db78, board: DViCO FusionHDTV DVB-T Dual Express [card=11,autodetected]
cx23885_dvb_register() allocating 1 frontend(s)
cx23885[0]: cx23885 based dvb card
DVB: registering new adapter (cx23885[0])
DVB: registering adapter 0 frontend 0 (Zarlink ZL10353 DVB-T)...
cx23885_dvb_register() allocating 1 frontend(s)
cx23885[0]: cx23885 based dvb card
DVB: registering new adapter (cx23885[0])
DVB: registering adapter 1 frontend 0 (Zarlink ZL10353 DVB-T)...

Your done!