Results 1 to 4 of 4
  1.    #1  
    I'm trying to use Palm PRE for watching TV recordings on my MythTV server.
    The way I'm trying to use is via MythWEB. Sofar I have been able to persuade mythtv to produce mp4 recordings and offer them to palm. To do this I use same way as is used for ipods.

    Necessary steps:

    1) tell mythweb to offer palm same pages as for ipod/iphone

    /usr/share/mythweb/includes/skin.php

    add WebOS at two places so lines look like this:

    elseif (preg_match('/(mobile\s+safari|ipod|iphone|WebOS)/i', $_SERVER['HTTP_USER_AGENT']))

    2) Add transcoding script (example bellow) so your recordings get transcoded. You can use any tutorial for ipod.

    /usr/local/bin/mythpalm

    Code:
    #!/bin/bash
    #MythPalm Script
    #Based on MyhIpod sript
    #Copyright 2007 Chris Lorenzo et al
    #This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
    #Additionally modified 2007 Doug Johnson
    #Modified for PRE by JSJSJS
    
    $if$ [ ! $# == $3$ ]; $then$
     $echo$ &$quot$;$Usage$: $$0$ $directory$ $file$ $title$&$quot$;
    $exit$
    $fi$
    
    #####################################################################
    # $Default$ $scale$ $used$ $by$ $float$ $functions$.
    
    $float_scale$=$2$
    
    
    #####################################################################
    # $Evaluate$ $a$ $floating$ $point$ $number$ $expression$.
    
    $function$ $float_eval$()
    {
        $local$ $stat$=$0$
        $local$ $result$=$0$.$0$
        $if$ [[ $# -$gt$ $0$ ]]; $then$
            $result$=$($echo$ &$quot$;$scale$=$$float_scale$; $*&$quot$; | $bc$ -$q$ $2$&$gt$;/$dev$/$null$)
            $stat$=$?
            $if$ [[ $$stat$ -$eq$ $0$  &$amp$;&$amp$;  -$z$ &$quot$;$$result$&$quot$; ]]; $then$ $stat$=$1$; $fi$
        $fi$
        $echo$ $$result$
        $return$ $$stat$
    }
    
    
    ####################################################################
    # $Evaluate$ $a$ $floating$ $point$ $number$ $conditional$ $expression$.
    
    $function$ $float_cond$()
    {
        $local$ $cond$=$0$
        $if$ [[ $# -$gt$ $0$ ]]; $then$
            $cond$=$($echo$ &$quot$;$*&$quot$; | $bc$ -$q$ $2$&$gt$;/$dev$/$null$)
            $if$ [[ -$z$ &$quot$;$$cond$&$quot$; ]]; $then$ $cond$=$0$; $fi$
            $if$ [[ &$quot$;$$cond$&$quot$; != $0$  &$amp$;&$amp$;  &$quot$;$$cond$&$quot$; != $1$ ]]; $then$ $cond$=$0$; $fi$
        $fi$
        $local$ $stat$=$(($cond$ == $0$))
        $return$ $$stat$
    }
    
    $directory$=&$quot$;$$1$&$quot$;;
    $file$=&$quot$;$$2$&$quot$;;
    $outfile$=${$file$/%&$quot$;$mpg$&$quot$;/&$quot$;$mp4$&$quot$;};
    $title$=&$quot$;$$3$&$quot$;;
    
    #$Get$ $the$ $video$ $information$
    # $ss$ $seeks$ $to$ $pos$ $300$ $s$ - $just$ $to$ $get$ $info$ $from$ $the$ $movie$ $and$ $not$ $from$ $garbage$ $at$ $the$ $begining$ $such$ $as$ $publicity$
    $video_info$=`$mplayer$ -$ao$ $null$ -$vo$ $null$ -$identify$ -$ss$ $300$ -$frames$ $50$ &$quot$;${$directory$}/${$file$}&$quot$;`
    #  $2$&$gt$;/$dev$/$null$
    #$echo$ &$quot$;$$video_info$&$quot$;
    
    #$Command$ $line$ $grep$ $sucks$, $but$ $we$ $make$ $due$...
    $aspect$=`$echo$ $$video_info$ | $egrep$ -$oe$ &$quot$;$Movie$-$Aspect$ $is$ [$0$-$9$:.]+&$quot$; | $egrep$ -$o$ &$quot$;[$0$-$9$:.]+&$quot$;`
    $aaspect$=`$echo$ $$video_info$ | $egrep$ -$oe$ &$quot$;$Movie$-$Aspect$ $is$ [$0$-$9$.]+&$quot$; | $tail$ -$1$ | $egrep$ -$o$ &$quot$;[$0$-$9$.]+&$quot$;`
    $framerate$=`$echo$ $$video_info$ | $egrep$ -$oe$ &$quot$;[$0$-$9$.]+ $fps$&$quot$; | $egrep$ -$o$ &$quot$;[$0$-$9$.]+&$quot$;`
    
    $echo$ &$quot$;$$aaspect$&$quot$;
    
    # $set$ $resolution$ $by$ $aspect$ $ratio$
    
    $float_scale$=$0$
    
    
    $if$ $float_cond$ &$quot$;$$aaspect$ &$lt$; $1$.$5$&$quot$;;
    $then$
    # $height$ $is$ $fixed$
     $height$=$320$;
     $width$=$($float_eval$ &$quot$;$$aaspect$ * $320$&$quot$;);
     $width$=${$width$/.*};
     $let$ &$quot$;$width$ &$gt$;&$gt$;= $1$&$quot$;
     $let$ &$quot$;$width$ &$lt$;&$lt$;= $1$&$quot$;
    $else$
    # $width$ $is$ $fixed$
     $width$=$480$;
     $height$=$($float_eval$ &$quot$;$480$ / $$aaspect$&$quot$;);
     $height$=${$height$/.*};
     $let$ &$quot$;$height$ &$gt$;&$gt$;= $1$&$quot$;
     $let$ &$quot$;$height$ &$lt$;&$lt$;= $1$&$quot$;
    $fi$
    
    $echo$ &$quot$;$h$ $$height$ $w$ $$width$&$quot$;
    
    $vbitrate$=$480k$
    $abitrate$=$128k$
    
    # $Figure$ $out$ $which$ $AAC$ $we$ $have$
    $AAC$=$($ffmpeg$ -$v$ $2$&$gt$;&$amp$;$1$|$sed$ &$quot$;$s$/--$enable$-/\$n$/$g$&$quot$;|$grep$ $aac$|$awk$ '{$print$ $$1$}')
    $if$ [ &$quot$;$x$${$AAC$}&$quot$; = &$quot$;$xlibfaac$&$quot$; ]
    $then$
     $ACODEC$=&$quot$;-$acodec$ $libfaac$&$quot$;
    $else$
     $ACODEC$=&$quot$;-$acodec$ $aac$&$quot$;
    $fi$
    
    # $Create$ $the$ $MP4$
    
    $ffmpeg$ -$y$ -$i$ &$quot$;${$directory$}/${$file$}&$quot$; $$ACODEC$ -$ab$ ${$abitrate$} -$ar$ $44100$ -$ac$ $2$ -$s$ ${$width$}$x$${$height$} -$vcodec$ $libx264$ -$b$ ${$vbitrate$} -$flags$ +$loop$ -$cmp$ +$chroma$ -$partitions$ +$parti4x4$+$partp8x8$+$partb8x8$ -$flags2$ +$mixed_refs$ -$subq$ $5$ -$trellis$ $1$ -$refs$ $5$ -$coder$ $0$ -$me_range$ $16$ -$g$ $250$ -$keyint_min$ $25$ -$sc_threshold$ $40$ -$i_qfactor$ $0$.$71$ -$maxrate$ $768k$ -$bufsize$ $2M$ -$rc_eq$ '$blurCplx$^($1$-$qComp$)' -$qcomp$ $0$.$6$ -$qmin$ $10$ -$qmax$ $51$ -$qdiff$ $4$ -$level$ $13$ -$metadata$ $title$=&$quot$;${$title$}&$quot$; &$quot$;${$directory$}/${$outfile$}&$quot$;
    3) Add transcoding job

    /usr/local/bin/mythpalm "%DIR%" "%FILE%" "%TITLE%"

    as user JOB and turn it on for all recordings

    4) add purge script into cron table
    Code:
    #!/usr/bin/perl
    #Checks the myth recording directory for .mp4 files that don't have a corresponding .mpg. If found, it deletes them.
    
    #Change below to your myth recordings directory
    $directory = "/storage/recordings";
    
    foreach $f (<$directory/*>) {
            if ( $f =~ /\.mp4$/ )
            {
                    $f =~ s/\.mp4$//;
                    if (!( -e $f )) { `rm -f $f.mp4`; };
            }
    }
    5) add following lines into /usr/share/mythweb/modules/tv/tmpl/iPod/detail.php

    Code:
        <?php
            if ($program->hasAlternativeFormat('mp4')) {
                $pre = str_replace("mpg","mp4",$program->filename);
                echo '<li class="small"><a href="/recordings/'.$pre.'">'.t('Watch on PRE').'</a>';
                }
        ?>
    bellow

    Code:
        <?php
            if ($program->hasAlternativeFormat('mp4'))
                echo '<li class="small"><a href="'.root_url.'pl/stream/'.$program->chanid.'/'.$program->recstartts.'.mp4">'.t('Watch on iPod/iPhone').'</a>';
        ?>
    6) expose recordings directly via web by

    ln -s /storage/recordings /var/www/html/recordings


    ---------------

    If this is done You will get "Wath on PRE" by the recording which invokes videoplayer.


    Hints and tests welcome...
    Last edited by zdar01; 05/22/2010 at 10:30 AM.
  2. #2  
    i have to tell you i haven't looked at MythTV in a LONG time but thanks for posting what info you have!! Hopefully there are a few people out there that can tinker with it.
  3. #3  
    Within the next couple weeks I plan to try and play with mythtv and my pre. Ill let you know if I get figure anything further out. Keep things posted zdar01.
  4.    #4  
    I have been forced to reinstall my mythtv server and at same time I have found few minutes to get it WORKING with Palm.

    Ufortunatelly it means that mythwe code must be updated as well as webeserver config.

    How to get it working?

    Use what is in first post (the howto is updated)

    After that it works... It is same procedure as for iPod/iPhone. The only difference is that for some reason Palm Pre does not line recordings exposed via perl script.
    Last edited by zdar01; 05/01/2010 at 03:02 PM.

Posting Permissions