Jump to content


Latest Posts

Credit Card Fraud
Forum: The Ettamogah Pub
Last Reply: logifuse (May 22 2013 01:06 AM)
Live TV on the Xbox One
Forum: Media Center & Technology News
Last Reply: logifuse (May 21 2013 11:22 PM)
Xbox One and TV
Forum: Media Center Articles & Guides
Last Reply: logifuse (May 21 2013 04:56 PM)
Dynamic DNS service
Forum: The Ettamogah Pub
Last Reply: Duffy (May 21 2013 05:55 AM)

Recent Topics


Photo
- - - - -

MythTV Recordings: Download To Your iPhone/iPod via WiFi


  • Please log in to reply
11 replies to this topic

#1 rileyp

rileyp

    MC Journeyman

  • Members
  • PipPipPipPipPip
  • 523 posts

Posted 13 June 2011 - 07:15 AM

Mythtv Recordings Downloaded onto your Iphone/Ipod touch
Ive been playing with this for while and have come up with a sure fire easy way of getting any mythtv recording you want downloaded onto your ipod touch or iphone in nice easy way without jail breaking and without plugging into your desktop pc
This is how
On your mythbackend (Dependancies mythweb and handbrake cli)
1 Install handbrake cli
Add the ppa from here https://edge.launchp...dbrake-releases
For Lucid its this
deb http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu lucid main 
deb-src http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu lucid main
then update
sudo apt-get update
and then install...
I used synaptic and selected handbrake-cli

2 Create a script called iphone.sh
sudo nano /usr/bin/iphone.sh
#!/bin/sh
# MythTV user job to transcode a video to mp4 suitable for a phone
FILE=$1
TITLE=$2
OUTDIR="~/iphone"  # make sure you get rid of the ~ and use the full path
nice /usr/bin/HandBrakeCLI -i $FILE -o "$OUTDIR$TITLE.MP4" --preset="iPhone & iPod Touch"
save and exit

3 Make it executable
sudo chmod a=rx /usr/bin/iphone.sh

4 Create a user job in mythtv-setup>general called Iphone
Pop this in as the command
/usr/bin/iphone.sh "%DIR%/%FILE%" "%TITLE%-%SUBTITLE%"

Make sure the box is ticked to allow the Iphone user job.
5 Create an output dir to store the transcoded for iphone mp4 files
mkdir ~/iphone
6 Add a symlink in the /var/www/ folder of your backend
sudo ln -s /home/yourusername/iphone /var/www/iphone
8 Go to dir
cd ~/iphone

9 Do a test run from a terminal to create a ipod compatible file (just select a myth recording)
/usr/bin/iphone.sh mythrecordingsdir/recordingname test
and wait for it to transcode.
10 Look through the text output in the terminal screen to ensure it all looks good and save it if you think you need to.
11 Open your test file with vlc to ensure it works which it should
12 Open safari on iphone to yourmythbackendserversipaddress/iphone
13 Select the test file and play live.
14 Open the app store on your iphone/ipod and install Hian Zin Jong Downloads Lite Download Manager (its free) (Better Download Manager suggestions would be taken on board gracefully as this is the first I found and it worked...

Thats it for the install

Now to use and enjoy

1 In mythtv in the recordings gui select a recording by pressing m select job options select begin iphone (eg Before you go to bed)
2 Your file will be ready to download when its ready pending your user job settings on your back end.
3 Open Download Manager lite on the ipod/iphone and go to yourmythbackendserversip/iphone While eating breakfast
4 Select file by touching and holding and select download and download it shall :D
5 Watch file when you good and ready by opening Download Manger Lite and selecting the recording.On train plane eating lunch etc


If someone know a much better way please let me know or if someone wants to pretty up the web page with artwork deleting on server etc that would be good too if they know how and want to share the love
cheers and enjoy


credit to bb_145 for the handbrake cli/mythtv integration http://ubuntuforums....d.php?t=1464306

Edited by rileyp, 13 June 2011 - 04:33 PM.


#2 rileyp

rileyp

    MC Journeyman

  • Members
  • PipPipPipPipPip
  • 523 posts

Posted 13 June 2011 - 09:16 AM

Just looking into cydia and ssh and thinking it may be possible to place new files onto the Ipod touch/Iphone automatically .....
rileyp

#3 drewdin

drewdin

    MC Apprentice

  • Members
  • Pip
  • 16 posts

Posted 26 April 2012 - 09:27 AM

I plan on trying this tonight, ill let you know how it turns out!

#4 drewdin

drewdin

    MC Apprentice

  • Members
  • Pip
  • 16 posts

Posted 27 April 2012 - 05:46 PM

I have a question about step six, would the path you have listed be to the output directory and not the home directory? I just want to make sure, as i am not familiar with a symlink. Thanks!

So i used the output path just to get going, the trance went awesome but i do have some errors. The name of the file came out as:

OUTDIRtest.MP4

and the file was put into the recording directory, thats where i was when i ran the cli:

/usr/bin/iphone.sh /media/mythtv/recordings/file.mpg test

Any Suggestions? Thanks again

**UPDATE: I fat fingered the iphone.sh file, and put %OUTDIR and not %$OUTDIR. I havent tested it yet but im sure that what was wrong.

Edited by drewdin, 27 April 2012 - 10:28 PM.


#5 rileyp

rileyp

    MC Journeyman

  • Members
  • PipPipPipPipPip
  • 523 posts

Posted 27 April 2012 - 08:22 PM

I have a question about step six, would the path you have listed be to the output directory and not the home directory? I just want to make sure, as i am not familiar with a symlink. Thanks!

So i used the output path just to get going, the trance went awesome but i do have some errors. The name of the file came out as:

OUTDIRtest.MP4

and the file was put into the recording directory, thats where i was when i ran the cli:

/usr/bin/iphone.sh /media/mythtv/recordings/file.mpg test

Any Suggestions? Thanks again

6 Add a symlink in the /var/www/ folder of your backend
sudo ln -s /home/yourusername/iphone /var/www/iphone
A symlink is a method of putting the contents of a dir into a special dir without actually copying any files. So we want all the contents of the output dir (containing the transcoded recordings) to appear in the /var/www/iphone folder so that when you open a browser and look at the your servers ip/iphone folder you see the recordings.
So my symlink makes all the contents of the output directory in my case it was /home/dad/iphone appear in the /var//www/iphone symlink dir

you can test by doing this ln -s ~/Downloads ~/Public/haha
now open your ~/public folder and see there is a new dir called haha with an arrow on it open it and it will contain all the contents of your ~/Downloads folder
to remove rm -rf ~/Public/haha

Does this help?

Edited by rileyp, 27 April 2012 - 08:29 PM.


#6 drewdin

drewdin

    MC Apprentice

  • Members
  • Pip
  • 16 posts

Posted 27 April 2012 - 10:26 PM

it does, thanks!

#7 drewdin

drewdin

    MC Apprentice

  • Members
  • Pip
  • 16 posts

Posted 29 April 2012 - 04:55 PM

I had to modify this line in step two to get it working, a simple change.

OUTDIR="~/iphone"  # make sure you get rid of the ~ and use the full path

to

OUTDIR="~/iphone/"  # make sure you get rid of the ~ and use the full path

Edited by drewdin, 29 April 2012 - 05:05 PM.


#8 rileyp

rileyp

    MC Journeyman

  • Members
  • PipPipPipPipPip
  • 523 posts

Posted 29 April 2012 - 08:36 PM

Your supposed to change it to the full path as when the program is executed by mythv mythtv is not your username so it will be looking for a different dir ie ~/iphone for mythtv is /home/mythtv/iphone/which probably does not even exist.
For my user name ~/iphone/ means /home/dad/iphone/ and for root it means /home/root/iphone/ the # comment is there to remind you to change to the full path and get rid of the ~
You should change it to the full path.
Does this make any sense?
I did miss a / :o
I dont think that that it will work for you unless you put in the full path.
cheers rileyp

Edited by rileyp, 30 April 2012 - 12:11 AM.


#9 drewdin

drewdin

    MC Apprentice

  • Members
  • Pip
  • 16 posts

Posted 29 April 2012 - 09:52 PM

@rileyp Thanks, i did change the file to use the full path but i did not put the "/" at the end of the path name. I just showed using your example. I noticed that it was wrong when i went through the log file and i noticed it said it tried to move the file iphonetext.mp4.

#10 rileyp

rileyp

    MC Journeyman

  • Members
  • PipPipPipPipPip
  • 523 posts

Posted 30 April 2012 - 12:11 AM

So its working now?

#11 drewdin

drewdin

    MC Apprentice

  • Members
  • Pip
  • 16 posts

Posted 30 April 2012 - 12:44 PM

it is working but i think i have something in mythtv setup incorrectly. Right when a show is done it trys to run the user job but i dont remember setting it this way. I did enable user jobs but i do not have selected to run after a recording has finished.

Also, for some reason, the recording transcodes but only does 5 minutes.

**UPDATE:
I was on the handbrake forums and it is a known bug that they stop encoding at 5min, I was told i need to update my version 0.9.6 to the daily build to fix the bug.

Edited by drewdin, 30 April 2012 - 06:26 PM.


#12 rileyp

rileyp

    MC Journeyman

  • Members
  • PipPipPipPipPip
  • 523 posts

Posted 01 May 2012 - 03:06 AM

In the back end you need to set user jobs to only run at certain times of the day if you want this not to happen straight away.
Good to see you have it working
cheers rileyp

Edited by rileyp, 01 May 2012 - 03:07 AM.