Category:Myth Protocol

From MythTV Official Wiki
(Redirected from Myth Protocol)
Jump to: navigation, search

Warning.png Warning: The Myth Protocol is designed for internal use only, for third party applications we strongly recommend using the Services API instead which uses HTTP and a choice of JSON or XML serialised data, with support for SOAP, WSDL etc

Basic Guide

There is guide started, which describes how to use the Myth Protocol for watching Live TV.

List of proto bumps

Version Release Token Changeset Description
1 [3021]


2 [3078]
3 [3112]


4 [3308]
5 [3503]


6 [3589]
7 [3617]
8 [3621]
9 [3838]


10 [3966]
11 [3973]
12 [3988]
13 [4122]
14 [4508]
15 0.18 [5833]


16 [6284]


17 [6482]


18 [6865]


19 [7427]


20 [7739]


21 [7826]


22 [7883]


23 [8553]


24 [8617]
25 [8628]
26 0.19 [8754]


27 [8973] Unification of the ChannelBase class???


28 [9524] Backend portion of Channel Editing patch.


29 [9592] Increments protocol to deal with new FileTransfer params


30 0.20 [9968] Adds recorder keyed picture attribute adjustments


Version Release Token Changeset Description
31 0.20 [11278] Add parentid to the proginfo StringLists.
32 [12151] Introduction of StorageGroups


33 [12904] Changes the format of the original airdate field in the ProgramInfo stringlist
34 [13230] Sends the start channel as additional parameter in SpawnLiveTV


35 [13952] Replaces the current hdtv, stereo and closecaptioned flags with videoproperties, audioproperties and subtitletype vars
36 [14483]


37 [15437]


38 [15550]


39 0.21 [15701] Revert [15549], because the scheduler (starting with [15566]) now uses its own temporary copy of the record table during the BUSQ.


40 0.21 [16090] Patch from #4583, along with corresponding fixes in mythweb and the perl bindings. Switches QUERY_PIXMAP_LASTMODIFIED to send a unix timestamp instead of a localized string that would be affected by LANG settings.


41 [18419] Adds the production year to the programinfo sent via the protocol.
42 [18574]


43 [19417] (warning: huge changeset) Associated with the merging of the mythtv-vid branch to trunk.


and possibly GetChainWithRecording.  
44 [19978] Adds Videos storage group


45 [20523] Add channel grouping feature


46 [21156] Adds ability to delete remote files


47 [21298] Adds filesystem block size to the FileSystemInfo structure


48 [21445] When ANN returns "ERROR", it is now followed by the reason for the error
49 [22164] Adds new pixmap query to speed up preview generation

Add a RemoteFile::Exists(QString &url) method for checking for the existence of a remote file.

50 0.22 [22170] Adds a hostname lookup to aid use of Storage Groups in MythVideo


51 [22892] Adds a remote hash function for files based of that used by OpenSubtitles.


52 [22932]
53 [22955]
54 [22976]


55 [22992]


56 0.23 [23028] Added system events,


23056 0.23.1 [25364]


57 [24694]

object changes. From 47 fields down to 41 - filesize as a long, removed duplicate, shareable, previouslyshown, commfree, hasairdate, added year.

58 [25351]


59 [25858]


Adds support for ISOs over remote file access.


60 [26101]

Alters FileTransfer to accept timeout instead of number of retries

Version Release Token Changeset Description
61 [26106]



62 78B5631E [26280]


63 0.24 3875641D [26518]


64 8675309J [27308]


65 D2BB94C2 [v0.25pre-1362-ge965e4b]




66 0C0FFEE0 [v0.25pre-2052-g1508085]

[v0.25pre-2053-gc7de5d7] [v0.25pre-2054-g64d448a] [v0.25pre-2072-g8456ea2]













67 0G0G0G0 [v0.25pre-2563-ga41e965]

object changes. From 41 fields up to 44 - adds 'season', 'episode', and 'inetref', and is a significant reordering


68 90094EAD [v0.25pre-2666-ga17e689]


69 63835135 [v0.25pre-2682-gfb34130]


70 53153836 [v0.25pre-2682-g1da9d23]


71 05e82186 [v0.25pre-4068-g3281cdd] Add livetvorder to InputInfo in



72 0.25 D78EFD6F [v0.25pre-4068-g7a94153]


73 D7FE8D6F [v0.26-pre-15-gcbb8eb1e]


74 SingingPotato [] No changes. The protocol changes were factored out before commit, but not the protocol version update.
75 0.26 SweetRock [v0.26-pre-1f8c590210] Update DB times to UTC.
76 0.27 FireWilde [v0.27-pre2-72-gd4dcff3]

object changes. Inserts syndicatedepisodenumber at position 5, and adds partnumber and parttotal to the end.

77 WindMark [v0.27-pre2-485-g49dbed5]

FILL_DURATION_MAP sub-command added, similar to FILL_POSITION_MAP.

78 0.28 IceBurns [v0.28-pre-384-ge8bfd99]

Add support for loading season, episode and total episodes into ProgramInfo

79 BasaltGiant [v0.28-pre-501-g3af71b4]

Bump protocol version again so that we don't lose catType when serialising data

80 TaDah! [8aefe1bc] [2f1a5350] [b257f3c86] [d9217461] [d0185093] [e6c8a786] [e350c8fb] [b9d40e40] [efafb148]










Version Release Token Changeset Description
81 MultiRecDos [cd866684]



Added chanid to InputInfo and replaced TunedInputInfo with InputInfo.

82 IdIdO [e8a99d45]

Added recordedid.

START_RECORDING now returns recordedid and recstartts in addition to recstatus.

83 BreakingGlass [1dab190795]


84 CanaryCoalmine [b220116f]

Modified ADD and DELETE but not UPDATE




85 BluePool [a4f65ce1]

Added 'ANN Frontend' option.

86 (ノಠ益ಠ)ノ彡┻━┻ [bcd7d65e]

Added inputname and bookmarkupdate.

87 (ノಠ益ಠ)ノ彡┻━┻ (No entiendo!) [d2736963] [189a7be2]








88 XmasGift [a2676c2d] [20603add]




89 BuzzKill [1f8c275b] [b5594ccb]


Added reclimit to InputInfo.

90 BuzzCut [3e782bae]


Added reccount to InputInfo.

91 BuzzOff [0cd367d7]


Removed reclimit and reccount from InputInfo.

Legend: - = removed command, + = added command, * = changed command

Packet Data Format

(This information is from reading the code and packet sniffing. Do not take this information as a specification, as the developers may not have intended some of the following behavior)

A MythTV protocol packet contains two fields, the size and the payload. The first field is the size, encoded as an 8 byte, UTF8 decimal string padded with spaces. If you are sending a 20 byte payload, the first 8 bytes should be the characters "20" followed by 6 spaces. The second field is the payload, an arbitrary length UTF8 string made up of a list of one or more strings seperated by a the delimeter "[]:[]". Commands are sent to port 6543.

Event Handling

When announcing ones self to the backend, the client can specify that it wants to receive update events. These events follow the same packet data format as outlined above and are sent asynchronously. These events will be identified as a backend message, and care must be taken to properly handle these when querying information from the backend.

Backend Commands

(This information is from reading the code and packet sniffing. Do not take this information as a specification, as the developers may not have intended some of the following behavior)

Backend commands are sent using the above packet format. The first string in the payload is the command, possibly with whitespace separated arguments. There may also be other arguments in successive strings in the list, separated by the delimiter "[]:[]". The two types of arguments are not interchangeable, each command may require specific whitespace separated arguments as well as specific list arguments.

Whitespace is spaces, tabs, carriage returns, linefeeds, etc. Multiple whitespace characters are treated as a single whitespace.

In general, commands and arguments are case sensitive.

When testing your code with the protocol, be warned that all commands except MYTH_PROTO_VERSION, ANN, and DONE will silently fail until a successful ANN command has been received by the backend. This includes non-existent commands.

For a list of all Myth protocol commands, see the Command List.

Some example MythTV protocol exchanges, taken from a packet sniffing capture of a 0.19 frontend to backend exchange:

Frontend sends Backend responds with
23      ANN Playback sycamore 0
2       OK
4       2048
63      QUERY_FILETRANSFER 32[]:[]SEEK[]:[]0[]:[]0[]:[]0[]:[]0[]:[]2048
7       0[]:[]0

Third Party Code that implements the Myth Protocol

  • MythtvJ is a high-level Java client library. It currently supports the version 40 of the protocol. Currently streaming a file from the backend, reading the EPG and tuning a recorder is supported. Last updated for protocol version 40 (0.21).
  • ruby-mythtv is a basic set of Ruby bindings providing a connected backend socket. Last updated for protocol 56 (0.23).
  • telnetting_mythtv is a very basic C# library. Last updated for protocol version 40 (0.21).
  • libmythtv-java is a suite of libraries used to communicate with the entire MythTV ecosystem from Java. The latest released version (0.1) supports protocol versions 63 (0.24) through 70 (git master as of 2012/01/13).
  • jMythAPI is a a java library to query and control a MythTV backend and MythTV database. Its supports all protocol versions from 01 to 77 (0.27).

Third Party Code that implements the Myth Protocol ... badly

These implementations support an unknown protocol version, and repeatedly guess at what version the backend wants to use, in order to force a connection without actually maintaining the code. This should be considered very dangerous behavior, and should not be used to connect to any production backend.

  • libcmyth from mvpmc is a lightweight C client library which is also used by XBMC. It features livetv with epg, watching recordings and managing recordings.
  • GMyth is a library based on the Glib/GObject APIs. It is used in MobileMythtv, GMythStream and others.


This category has only the following subcategory.


Pages in category "Myth Protocol"

The following 2 pages are in this category, out of 2 total.