Revision 35 as of 2009-03-19 15:57:52

Clear message

This page has been updated for information on the latest version, for information on past versions please see MythExport_old

If you are using MythExport from the Mythbuntu Testing PPA, please add a comment to the following bugs before upgrading to the latest version, this will help get these fixes pushed into Intrepid:

New Features in 2.0

  • Web interface for setup, file maintenance, user jobs, "On The Go" functionality.
  • Main script is now a Daemon.
  • Added mythexport_addjob script (used to add export jobs to the queue).
  • Added "On The Go" functionality.
  • Added file maintenance functionality.

Introduction

MythExport is a Perl daemon that can be used with MythTV to export recordings into a format playable on portable devices such as iPod Video, iPod Touch, PSP, and other devices. Besides converting your recordings, this script also grabs data from the MythTV MySQL database and injects it as iTunes data into the exported video so that it will show up correctly on your iPod. MythExport may also be used to take your recordings "On The Go" and provides a RSS feed to all exported recordings.

Installation

To install this latest version in Jaunty add the following to your /etc/apt/sources.list:

deb http://ppa.launchpad.net/mythbuntu-testing/ubuntu jaunty main
deb-src http://ppa.launchpad.net/mythbuntu-testing/ubuntu jaunty main

To install this latest version in Intrepid add the following to your /etc/apt/sources.list:

deb http://ppa.launchpad.net/mythbuntu-testing/ubuntu intrepid main
deb-src http://ppa.launchpad.net/mythbuntu-testing/ubuntu intrepid main

Then add the GPG Key

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C3862D78

Install MythExport and AtomicParsley:

sudo apt-get update
sudo apt-get install mythexport atomicparsley

Configuration

Everything in MythExport is now configurable from the web interface. Hit http://localhost/mythexport (substitute localhost if you are accessing it from elsewhere in your network).

Compatability

Device

Encoding

Max Resolution

iPod Video

mpeg4/xvid

320x240

iPod Nano

mpeg4/xvid

320x240

iPod Touch

mpeg4/xvid/h264

480x320(Display) 640x480(TV Out)

iPod Classic

mpeg4/xvid/h264

320x240(Display) 640x480(TV Out)

iPhone

mpeg4/xvid/h264

480x320(Display) 640x480(TV Out)

PSP

mpeg4/xvid

480 x 272*

Zune

mpeg4/xvid/h264

480x320*

Archos

mpeg4/xvid/h264

480x320*

none

none

not needed (this symlinks to the original recording)

Additional Devices

Email john.baab@gmail.com with a working ffmpeg line

* Verification Still Needed

Daemon Controls

john@grimlock:~$ sudo /etc/init.d/mythexport
Usage: /etc/init.d/mythexport {start|stop|restart|force-reload|status}

Detailed Page Descriptions

MythExport Setup

Here you will setup your device configurations. On the first page you Choose a device, on the second page you fill in the options you would like to use. These are the same options that the original script used.

You may also edit an existing configuration from this section.

System Setup

Here you will setup the location where your exported files live and where the RSS feed looks for files.

User Jobs

Here you will setup user jobs, this page will enable a user job if it is not currently enabled.

* Note this page overrides the user job of your choice, be careful not to destroy something you care about.

RSS Feed

Here you can view all your rss feeds. This page includes a deep link to the current feed you are viewing.

On the Go

Here you can export recordings to take On the Go. There are two available options: 1. Lightweight - Will export the recordings with the configuration of your choice and create an XML file that can be used within a web browser for easy recording browsing. 2. Full - Will copy recordings and create a sql dump of all relevant data for the resulting recordings. The user will then need to use MythImport to import these recordings into their On the Go backend.

* The XML CSS is still very bland and ugly, this should be fancied up soon.

File Maintenance

Here you can view exported recordings on your system and delete them immediately, this will delete the files and any MythExport database entries associated with the files.

Job Queue

Here you can view the current MythExport job queue.

Configuration Files

Configuration files are now kept in the following places:

This config contains configuration options used to export recordings. Note the ffmpegArgs, the web interface will generate this and the daemon will use it when exporting, this is done as an effort to allow the users an option to easily tweak the resulting ffmpeg lines which was not easy in the past. You may modify this to fit your needs, but remember the web interface will overwrite it if you ever choose to modify the configuration.

I have tried to add comments describing what each option in the config is used for. It is noticeable that many options have their own setting and also occur in the ffmpeg arguments, the web interface will read these options and overwrite the ffmpeg arguments when editing a configuration. You do not want to add the comments to your config, this may cause the web interface to error.

/etc/mythtv/mythexport_settings.cfg

; Config::Simple 4.59
; Thu Feb 26 16:19:26 2009

[ipod] # Configuration name
removeCommercials= # Bit for removing commercials using cut points, 1 for yes 0 or empty for no.
codec=mpeg4 # Export codec
sizeY=240 # Y resolution size
sizeX=320 # X resolution size
aspect=4:3 # Aspect ratio, normally 4:3 or 16:9
videoBR=600kb # Video bitrate in kb or b
threads= # Enable multi threading, sets thread=auto.  1 for yes 0 or empty for no.
device=ipod # Export device
podcastName= # Podcast Name
deletePeriod=30 # Delete period in days
audioBR=192kb # Audio bitrate in kb or b
audioChannels= # Audio channels, empty and this is not used, any integer and this will be the number of channels used.  This may help with recordings that export without any sound, forcing this to 2 seems to help.
ffmpegArgs=-y -acodec libfaac -ab 192kb -vcodec mpeg4 -b 600kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x240 -aspect 4:3 # ffmpeg arguments, these are generated by the web interface using all the options in this config, you may change these to fit your needs
deinterlace= # Enable deinterlacing, 1 for enabled 0 or empty for disabled

This config contains the directory where exports live:

/etc/mythtv/mythexport.cfg

dir=/mythtv/ipod

Exporting a Recording

Execute your user job in MythTv:

Media Library -> Watch Recordings

user_job_4.png

user_job_5.png

You can check that your job has run in the Info Center (Information Center -> System Status -> Job Queue):

user_job_7.png

The User Job can be configured to run on recordings after they are created (Post Recording Processing Menu on the Recording Options screen):

user_job_8.png

You may also run user jobs easily from MythWeb.

Troubleshooting

MythExport now logs everything to /var/log/mythtv/mythexport.log If you are having issues see the log for relevant information. By default, debugging info is not logged. To enable it, edit /etc/init.d/mythexport and add "debug" to the ARGS variable. Then sudo /etc/init.d/mythexport restart

If you get an error about config.xml missing, this can normally be found in the home directory of the user who runs your MythTV Fronend, and can be fixed by creating a symlink in mythtv's home directory (because that is the user who runs the daemon). By default most of these symlinks should exist if you are running Jaunty or using the weekly builds, if you run into problems it is always a safe bet to make sure the config.xml exists in the following places:

** These are especially important when using the RSS feature or running as a user job **
/home/%your_user_account%/.mythtv
/root/.mythtv
/home/mythtv/.mythtv


CategoryDocumentation