Offloading MythTV Transcoding to another computer

In this example, I’m going to use the mythtv@mythbackend account to access mythtv@superfast to transcode recordings on the superfast computer.  In this example, I will be pulling the video files from an SMB share on the mythbackend and saving them to a folder that is mounted on my data server.

Source: \\mythbackend\recordings mounted as /mnt/recordings

Destination: \\data\data mounted as /mnt/data


(For more info on auto mounting, check out this article: Automount smb share with….


1) Create ‘mythtv’ account on a super fast computer with a super strong password.


2) Log into the myth backend as ‘mythtv’ user (In my case, that is what mythbackend runs as).


3) run ssh-keygen and press enter for everything, including the passphrase.


4) ls .ssh to verify you have the following files:


$ ls .ssh


5) vi and copy the contents.


6) ssh to superfast computer with new account.


7) mkdir .ssh


8) vi .ssh/authorized_keys (this will create a new file)


9) Paste what you copied from the file on mythbackend.


10) save the file and log out.  Now, you should be able to ‘ssh superfast’ and it log in without a password.  Test and log back out.


11) Now, to setup the scripts.  create a bin folder for mythtv@mythbackend:




12) create the following file :  $vi ~/bin/ for mythtv@mythbackend


ssh mythtv@  “/home/mythtv/bin/ ${1} ${2// /_} $3 $4”


13)  Ssh mythtv@superfast and create a bin folder for mythtv@superfast:




14) create the following file: $ vi ~/bin/ for mythtv@superfast.  In my case, I am doing all this to transcode HD to SD so that my XBMC (running on an original Xbox) can play back shows recorded with the HD Homerun).


mencoder /mnt/recordings/$1 -oac mp3lame -xvidencopts bitrate=300 -vf scale=320:240 -ovc xvid -o /mnt/data/MythTV/$2


15) Setup MythTV to run the scripts after each show is recorded.

– Stop the mythtv-backend

– Launch mythtv-setup

– General, next a bunch of times till you get to the “Job Queue (Backend Specific)” Screen.

– Check the “Allow User Job #1 jobs” and hit next till you get to the “Job Queue (Job Commands)” Screen.

– Enter a description for “User Job #1 Description.

– Enter the following for the “User Job #1 Command” :


/home/mythtv/bin/ “%FILE%” “%DIR%/%TITLE% – %PROGSTART%.avi”


16) Final step.  Using the web interface, go into your “Recording Schedules”, select a show, check the box next to the description you entered, and save it.


Now, after the show has completed recording, mythbackend should run the User Job #1 command and you should be all set.




Testing mencoder command:

$ mencoder /mnt/recordings/1265_20120218093000.mpg -oac mp3lame -xvidencopts bitrate=300 -vf scale=320:240 -ovc xvid -o /mnt/data/MythTV/Test2.avi



$ ./ 1265_20120218093000.mpg Test3.avi



$ ./ 1265_20120218093000.mpg Test4.avi