HMT File Format

From hummy.tv Wiki
Revision as of 18:31, 28 January 2015 by Prpr (talk | contribs) (Punctuation and readability tweaks.)
Jump to: navigation, search

See also update notes below

Offset	Size				Content
------  -----   ----------------------------------  Header Block, Size 0x1004 (4100) bytes ---------------------------------------------
0x0000	2 byte	0x1701			Constant.
0x0000	126 byte			All Nulls.Constant
0x0080	string	254 byte max		Recording file path e.g. "/media/sda1/My Video/" (not needed when creating hmt)
0x017F	string	256 byte max		Recording  date-extended file name e.g. "The One Show_21010816_1817"
0x0280	4 byte	0x11223344		Recording start time (Epoch format)
0x0284	4 byte	0x11223344		Recording end   time (Epoch format)
0x0288	4 byte	0x00000000
0x028C	1 byte	0x02			Recording 00=zero length, 02=valid, 03=scrambled, 04=failed
0x028D	1 byte	0x00			Flags byte.
	bit 2	00000100		'Locked' flag. 1 = Locked.
	bit 3	00001000		'New' flag.    0 = New.		
0x028E	1 byte	0x00			Flags byte.
	bit 0	00000001		On-Disk Encrypted flag. 1 = Encrypted. 0 = Decrypted
	bit 1	00000010		Thumbnail exists flag. 1 = Yes. 0 =  No
0x0290  1 byte  00           		Failed recording code, 05=loss of signal
0x0294	4 bytes	0x44332211		Played time in seconds (used by resume). 0x00 if unplayed or played to end.
0x0298	1 byte	0x00			Bookmark count
0x029A	string	48 chars max.		Program name for Media List.
0x031C	4 bytes				Start of bookmark table. Maximum 32  x 4 byte entries (seconds from start). 
0x03DC	1 byte	0x00			Flags byte.
	bit 1	00000010		'Encrypted' flag. 1 = Encrypted. Used to determine if decryption on copy to USB is allowed.
	bit 2	00000100		'Copy Allowed' flag. 1 = copy allowed. (If zero, Number of allowed copies is in offset 0x431)
0x03E0	2 byte	0xFF00			'Guide' flag for Media List.0xFF00 = Guide off. 0x0101 = Guide on.
0x03E2	1 byte	0x15			String header (only if guide is on).
0x03E5	string	74 chars max.		Guide text for Media list.(only if guide is on).
0x0431	1 byte	0x00			Number of copies allowed when Unlimited Copies' flag is zero in 0x3DC
0x0434	2 byte	0x22110
0x0458	4 byte	0x44332211		Channel number.
0x045C	1 byte	0x15			String header.
0x045D	string	42 chars max.		Channel name.
0x0488	2 byte	0x2211			Service ID (SID).
0x048A	2 byte  0x2211			Transport Stream ID (TSID).
0X048C	2 byte	0x2211			Originating Network ID (ONID).
0x048E	2 byte	0x2211			Program Map Table (PMT) PID.
0x0490	2 bytes	0x2211			Video PID.
0x0493	1 byte	0x20			Constant.
0x0494	2 bytes	0x2211			Video PID.
0x0498	1 byte	0x11			Video Type MPEG2=0x01,  H264=0x02.
0x049C	2 bytes 0x2211			Audio PID.
0x04A0	1 byte	0x00			Audio Type MPEG=0x01 AC3=0x03 AAC=0x07.
0x04A5	1 byte	0x20			Constant.
0x04AD	1 byte	0x20			Constant
0x04B8	1 byte	0x01			Constant??
0x04BC	1 byte	0x00			Video type flag for Media list. 0x01 = SD. 0x02 = HD.		
0x04C0	1 byte	0x01			Constant ??
0x04C4	1 byte	0xFF			Constant ??
0x04F8	4 byte	0x44332211		Program scheduled start date & time (Epoch format).
0x04FC	4 bytes	0x44332211		Program scheduled duration (seconds).
0x0514	1 byte	0x00			Program genre code (see table).
0x0516 	3 bytes	0x106937		String header.
0x0519  string	48 byte max.		Program Name for Guide & iPlate.
0x0616 	3 bytes	0x106937		String header.
0x0619  string 252 byte max.		Program synposis text for Media list.
0x0716	2 bytes				EPG data - Event ID
0x073A	1 byte  0x00			'AC3' Flag. 0x00 = MPEG. 0x01=AC3.	
0x073B	2 bytes 0xFF00			'Guide' flag for iPlate. 0xFF00 = Guide off. 0x0101 = Guide on.
0x073D	4 bytes 0x656E6700		Null terminated string 'eng'
0x0741	1 byte 0x15			String header (only if guide is on).
0x0742	string	74 chars max.		Guide text for iPlate (only if guide is on).
0x0798	128 byte			Data block. Purpose unknown. Contains data block common to all HMT files.
----------------------------------------------------------------------------------------------------------------------------------

0x1000	4 byte	0x44332211		Number of EPG Blocks following

------  -----   ---------------------------------- EPG Header List Block, Size 8188 bytes (starts at 0x1004) ---------------------

0x0000	32 byte	blocks			Copy of 32 byte header from EPG blocks following. One entry for each EPG block.
0x0020
0x0040					Next EPG block header (if any)
				
------  -----   ---------------------------------- EPG Block type 02, Size 704 bytes,including 32 byte header (starts at 0x3000)--
++++++ Start of 32 byte header +++++++++
0x0000	4 byte	0x02000000	
0x0004	4 byte	0x00000000		Time in seconds from start of recording to change the iPlate info to this EPG block
0x0008	4 byte	0x00300000		12288. Byte Offset to start to EPG block (increments by 704 for each EPG entry.
0x000C	4 byte	0xA0020000
0x0010 16 byte				Unused
++++++ End of 32 byte header ++++++++++
0x0020	4 byte	0x44332211		Program scheduled start date & time (Epoch format).
0x0024	4 bytes	0x44332211		Program scheduled duration (seconds).
0x0028	1 byte	0x04
0x003C	1 byte	0x11			Program genre code. (see table)
0x003E	3 byte	0X106937		String Header.
0x0041	string				Program name for EPG.
0x013E	3 byte	0X106937		String Header.
0x0141	string	252 byte max.		Program synposis text for iPlate.
0x0262	1 byte	0x11			Flag
0x0263	2 byte	0xFF00			Guide flag. 0xFF00 = Guide off. 0x0101 = Guide on.
0X0265  string	0x656E67		"eng".  Language for guide text.
0x0268	1 byte	0x00			Null terminator for string.
0x0269	3 byte 0x106937			String header (only if guide is on).
0x026A	string 74 chars max.		Guide text for iPlate (only if guide is on).
0x02BC	4 byte	0xC0320000		12288 + 704. Byte offset to start of next EPG block.


Genre Code Table
----------------
0x00 = Unclassified
0x10 = Movie
0x20 = News and Factual
0x30 = Entertainment
0x40 = Sport
0x50 = Childrens
0x60 = Entertainment
0x70 = News and Factual
0x80 = News and Factual
0x90 = Education
0xA0 = Lifestyle
0xF0 = Drama

File analysis by raydon

Notes by escat :-

  • The file name field has moved from offset 017F to 0180. Both variants may be found depending on the age of the recording. Although the Humax software doesn't appear to use this field, other CF packages may do so. For example, af123 has already modified the hmt utility to accommodate this change. However, the Nicesplice package still appears to create hmt files with the old format, even when the original recording had the new format.
  • af123 also informs me that offset 073D is used to hold the character 'E' for recordings that have been stripped of their EPG frames. (Maybe it's my choice of programmes, but I've almost never seen an hmt file containing the reported 'eng' characters!)