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 mythnuv2mkv.sh 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 mythnuv2mkv.sh bash script. You will first need to get it here –> http://www.mythtv.org/wiki/Mythnuv2mkv
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 mythnuv2mkv.sh 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 mythnuv2mkv.sh 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/mythnuv2mp4.sh --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.