Offloading MythTV Transcoding to another computer

Print Friendly, PDF & Email

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
id_rsa  id_rsa.pub

 

5) vi id_rsa.pub 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 id_rsa.pub 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:

 

/home/mythtv/bin

 

12) create the following file :  $vi ~/bin/forward-transcode.sh for mythtv@mythbackend

 

#!/bin/bash
ssh mythtv@10.10.10.108  “/home/mythtv/bin/mythtv-transcode-xbox.sh ${1} ${2// /_} $3 $4”

 

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

 

/home/mythtv/bin

 

14) create the following file: $ vi ~/bin/ mythtv-transcode-xbox.sh 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).

 

#!/bin/sh
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/forward-transcode.sh “%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/Troubleshooting:

 

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

 

Testing mythtv-transcode-xbox.sh:

$ ./mythtv-transcode-xbox.sh 1265_20120218093000.mpg Test3.avi

 

Testing forward-trasncode.sh

$ ./forward-transcode.sh 1265_20120218093000.mpg Test4.avi

 

Comments are closed.