[mythtv] $1,000 offer for a Myth front-end socket control

Chris Pinkham cpinkham at bc2va.org
Thu Dec 29 14:39:51 EST 2005

> On Sun, 25 Dec 2005, michael.anderson at plutohome.com wrote:
> > Yes, this task is completed.  Chris finished the code, we sent him the 
> > money, and his code works great.  I think he's committing it to the main 
> > Myth branch.
> Chris, is this commited yet? Sounds like cool functionality.  :)

I'll probably wait until after 0.19 is released before I put this into SVN
unless Isaac gives the go-ahead.  The patch I did for Pluto was based off
of the 0-18-fixes branch so I need to make a few changes to get it
merged into the HEAD.

Basically it provides a socket interface to control mythfrontend which
can be used with telnet or any other automated application that can open a
connection and send a command.  The feature defaults to Off and must be
turned on via the setup page in mythfrontend.  The port to listen on is
also configurable, but defaults to 6545 to keep it in line with the other
ports Myth uses.

Current functionality is general purpose, but was based on the needs of
the project Pluto needed accomplished.

Here's a description of what has been implemented.

If you telnet to the port, you are prompted with the following:

    MythFrontend Network Control
    Type 'help' for usage information

There are 4 main commands implemented currently: jump, key, play, and query.
Typing 'help <COMMAND>' gives you help on that specific command.

The jump command supports jumping to the following supported jumppoints
within Myth:

    Channel Recording Priorities
    Live TV
    Main Menu
    Manage Recordings / Fix Conflicts
    Manual Record Scheduling
    Play DVD
    Play music
    Previously Recorded
    Program Finder
    Program Guide
    Program Recording Priorities
    Rip CD
    Select music playlists
    Status Screen
    TV Recording Deletion
    TV Recording Playback
    Video Browser
    Video Gallery
    Video Listings
    Video Manager

The key command allows simulating the following keystrokes:


The play command supports the following subcommands, most of which
are valid only during playback except for the 'play program'
subcommand which is valid from the Watch Recordings and Delete
Recordings screens:

    play channel up       - Change channel Up
    play channel down     - Change channel Down
    play channel NUMBER   - Change to a specific channel number
    play program CHANID yyyy-mm-ddThh:mm:ss
                          - Play program with chanid & starttime
    play program CHANID yyyy-mm-ddThh:mm:ss resume
                          - Resume program with chanid & starttime
    play seek beginning   - Seek to the beginning of the recording
    play seek forward     - Skip forward in the video
    play seek backward    - Skip backwards in the video
    play seek HH:MM:SS    - Seek to a specific position
    play speed pause      - Pause playback
    play speed normal     - Playback at normal speed
    play speed 1x         - Playback at normal speed
    play speed -1x        - Playback at normal speed in reverse
    play speed 1/16x      - Playback at 1/16x speed
    play speed 1/8x       - Playback at 1/8x speed
    play speed 1/4x       - Playback at 1/4x speed
    play speed 1/2x       - Playback at 1/2x speed
    play speed 2x         - Playback at 2x speed
    play speed 4x         - Playback at 4x speed
    play speed 8x         - Playback at 8x speed
    play speed 16x        - Playback at 16x speed
    play stop             - Stop playback

The query command currently only supports one subcommand which
is used to query the current 'location' within Myth.  The
'query location' command returns things like the following:

    etc. for screens

    and things like this:

    Playback LiveTV 35:03 of 35:21 1x 31
    Playback Recorded 0:00:23 of 1:02:21 1x 1031 2005-10-17T22:00:00

    when playing a recording or LiveTV.

So, with the current implemention, you can telnet to a port, instruct
mythfrontend to change to the Watch Recordings screen (jump playbackbox),
and start playing a recording (play program 1031 2005-10-17T22:00:00).
Then during playback, you can pause, change speeds, seek around, and
stop playback.  You can query the current screen and jump to other
locations including the main menu.

I think it might be nice to extend this functionality in the future to
allow things like querying the list of recorded programs, deleting
recordings, and other commands that would make managing a myth system
remotely easier.  It also might be possible to allow simple 'http'
commands to allow controlling this via a web browser.  A
'query recordings html' version of a 'query recordings' command
could return html code to draw a page with links something like

/me makes a note to save this email for the eventual commit log. :)

Chris Pinkham

More information about the mythtv-dev mailing list