Project

General

Profile

Htsp » History » Version 105

Jaroslav Kysela, 2014-10-19 21:20

1 75 Adam Sutton
h1. Home Tv Streaming Protocol (HTSP) - Version 10
2 1 Andreas Smas
3
h2. General
4 58 sbi -
5
HTSP is a TCP based protocol primarily intended for streaming of live TV and related meta data such as channels, group of channels (called tags in HTSP) and electronic program guide (EPG) information.
6
7 61 Adam Sutton
The transmission and reception of a channel over HTSP is referred to as a subscription. A single HTSP session can handle as many concurrent subscriptions as the bandwidth and CPU permits.
8 1 Andreas Smas
9 61 Adam Sutton
The HTSP server in tvheadend has a payload-aware scheduler for prioritizing more important packets (such as I-frames) before less important ones (such as B-frames). This makes HTSP suitable for long-distance transmissions and/or paths with non-perfect delivery.
10 1 Andreas Smas
(It has been tested with a server in Stockholm and the client in Berlin).
11
12 17 Andreas Smas
For information about the HTSP wire format please read [[htsmsgbinary|HTSMSG binary format]]
13 1 Andreas Smas
14 61 Adam Sutton
If you're looking to develop a new client, there are several existing client implementations from which you might be able to gain knowledge:
15
16
* "XBMC":https://github.com/opdenkamp/xbmc/tree/master/xbmc/pvrclients/tvheadend
17
* "Showtime":https://github.com/andoma/showtime/tree/master/src/backend/htsp
18 65 John Törnblom
* "TVHGuide":https://github.com/john-tornblom/TVHGuide
19 69 Adam Sutton
* "PyHTSP":https://github.com/adamsutton/tvheadend/tree/master/lib/py/tvh/htsp.py (This is a demo client and is WIP, it has limited functionality).
20 1 Andreas Smas
21 22 Andreas Smas
----
22 18 Andreas Smas
23 84 Jaroslav Kysela
h2. Protocol Changes
24 83 Jaroslav Kysela
25 105 Jaroslav Kysela
h3. v14..v15
26
27
* extended channelAdd, channelUpdate server-to-client methods
28
** the channelIcon URL can be relative 'imagecache/%d'
29
* extended getChannel method
30
** the channelIcon URL can be relative 'imagecache/%d'
31
32 100 Jaroslav Kysela
h3. v13..v14
33
34
* added getChannel method
35
36 85 Jaroslav Kysela
h3. v12..v13
37
38
* added addAutorecEntry method
39
* added deleteAutorecEntry method
40 92 Jaroslav Kysela
* added autorecEntryAdd, autorecEntryUpdate, autorecEntryDelete server-to-client methods
41 85 Jaroslav Kysela
* extended channelAdd server-to-client method
42 87 Jaroslav Kysela
** added channelNumberMinor (for {major}.{minor} channel numbers)
43
* extended dvrEntryAdd and dvrEntryUpdate server-to-client methods
44 88 Jaroslav Kysela
** added eventId, autorecId, startExtra, stopExtra, retention, priority, contentType fields
45 97 Jaroslav Kysela
* extended addDvrEntry method
46
** added retention
47
* extended updateDvrEntry method
48
** added retention, priority
49
* extended epgQuery method
50
** added minduration, maxduration
51 85 Jaroslav Kysela
* added subscriptionGrace server-to-client method
52 97 Jaroslav Kysela
53 85 Jaroslav Kysela
54 83 Jaroslav Kysela
h3. v11..v12
55
56
* added subscriptionFilterStream method
57
* added getDvrCutpoints method
58
59
60
h3. v10..v11
61
62 86 Jaroslav Kysela
* added audio_type in the subscriptionStart server-to-client method
63 83 Jaroslav Kysela
* added getCodecs method
64
65 58 sbi -
h2. Communication
66
67
68 69 Adam Sutton
This communication is currently implemented by using htsmsg's. All strings are encoded as UTF-8.
69 1 Andreas Smas
70
There are two distinct ways for communication within HTSP.
71
72 28 Andreas Smas
Apart from this there is a number of messages that needs to be exchanged during login, see the login section below.
73
74 1 Andreas Smas
75 58 sbi -
h3. RPC communication
76
77
78 1 Andreas Smas
There is a normal RPC way of doing things. I.e. the client sends a request and the server responds with a reply. All the RPC methods are listed below as the 'Client to Server' methods. Apart from all message fields listed within each message type the client can add an additional field:
79 18 Andreas Smas
80 17 Andreas Smas
RPC request extra fields:
81 58 sbi -
<pre>
82 28 Andreas Smas
seq              int  optional   Sequence number. This field will be echoed back by the server in the reply.
83 1 Andreas Smas
username         str  optional   Username, in combination with 'digest' this can be used to raise the privileges
84
                                 for the session in combination with invocation of a method. 
85 28 Andreas Smas
digest           bin  optional   Used to raise privileges.
86 58 sbi -
</pre>
87 18 Andreas Smas
88 1 Andreas Smas
The followings field should be used by the client to match the reply with the request.
89
All replies are guaranteed to arrive in the same order as the requests.
90
Even so, probably the best way to implement the request-reply client is by taking advantage of the 'seq' field.
91
92
RPC reply extra fields:
93 58 sbi -
<pre>
94 18 Andreas Smas
seq              int  optional   Sequence number. Same as in the request.
95 19 Andreas Smas
error            str  optional   If present an error has occurred and the text describes the error.
96
noaccess         int  optional   If present and set to '1' the user is prohibited from invoking the method due to 
97 1 Andreas Smas
                                 access restrictions. 
98 58 sbi -
</pre>
99 1 Andreas Smas
100 18 Andreas Smas
101 58 sbi -
h3. Streaming communication
102
103
104 19 Andreas Smas
For streaming of live TV and various related messages the server will continuously push data to the client.
105 1 Andreas Smas
These messages are referred to as asynchronous messages and always have the 'method' field set and never have the 'seq' field set.
106
Also, the client can enable an additional asyncMetadata mode and by doing so it will be notified by the server when meta data changes. (EPG updates, creation of channels and tags, etc). 
107
108 34 Andreas Smas
109 58 sbi -
h3. Authentication
110
111
112 29 Andreas Smas
In Tvheadend, each method has an associated access restriction. Currently there is only one restriction (Streaming). However, this may change in the future.
113 1 Andreas Smas
114
Privileges for these restrictions may be granted in two ways: Username + Password and/or Source IP address.
115
Therefore it is possible to gain permissions to the system without entering a username and password.
116
While this is really useful it also complicates the authentication schema a bit.
117
Upon connect the initial privileges will be raised based on the source address.
118
119
Before any username / password based authentication has taken place the client must have
120 34 Andreas Smas
obtained a challenge (which stays fixed for the session). This is done via the 'hello' method.
121 1 Andreas Smas
122
In principle it's possible to use two different authentication idioms with HTSP.
123
Depending on how your application works one or another may be more suitable.
124
While they do not really differ from a protocol point of view it's worth mentioning a bit about them here:
125
126
127 58 sbi -
h3. Initial login authentication
128
129
130 1 Andreas Smas
The client performs all of its authentication using the 'login' method.
131
132
It may choose to send:
133 58 sbi -
* Username and password: Privileges will be raised based on these credentials.
134
* Username only: Privileges will be based on just the source address. The username will be used for various logging purposes.
135
* Nothing: Privileges will be based on just the source address.
136 1 Andreas Smas
137
If no privileges are granted after the login message has been received by the server (i.e. both network and username + password based)
138
the server will reply with 'noaccess' set to 1. A client that only employs initial login should honor this flag and ask the
139
user for a username + password and retry by using the 'authenticate' method. I.e. it should not send the 'login' method again.
140
141
142 58 sbi -
h3. On-demand authentication
143
144
145 1 Andreas Smas
The client performs all of its authentication when it needs to.
146
147
When using this method, the client will check every RPC reply for the 'noaccess' field.
148
If it set to 1 it whould ask the user for username + password and retry the request but also
149 58 sbi -
add 'username' and 'digest' to the original message. (See _RPC request extra fields_ above)
150 1 Andreas Smas
151
Typically it would not send a username or digest during login.
152 29 Andreas Smas
153
----
154 34 Andreas Smas
155 66 Adam Sutton
h2. Client to Server (RPC) methods
156 34 Andreas Smas
157
h3. hello
158 58 sbi -
159
Used to identify the client toward the server and to get the session challenge used to
160 1 Andreas Smas
hash passwords into digests. The client can request a different version of the HTSP
161 66 Adam Sutton
protocol with this method. If no 'hello' message is sent the server assumes latest version
162 1 Andreas Smas
is to be used.
163 34 Andreas Smas
164 66 Adam Sutton
Client/Server should select lowest common version, if this is not possible connection should be terminated.
165 1 Andreas Smas
166
Request message fields:
167
<pre>
168 66 Adam Sutton
htspversion        u32   required   Client preferred HTSP version.
169
clientname         str   required   Client software name.
170
clientversion      str   required   Client software version.
171 58 sbi -
</pre>
172 1 Andreas Smas
173
Reply message fields:
174 34 Andreas Smas
<pre>
175 66 Adam Sutton
htspversion        u32   required   The server supports all versions of the protocol up to and including this number.
176
servername         str   required   Server software name.
177
serverversion      str   required   Server software version.
178
servercapability   str[] required   Server capabilities (Added in version 6)
179 1 Andreas Smas
challenge          bin   required   32 bytes randomized data used to generate authentication digests
180 73 Adam Sutton
webroot            str   optional   Server HTTP webroot (Added in version 8)
181
                                    Note: any access to TVH webserver should include this at start of URL path
182 1 Andreas Smas
</pre>
183
184 70 Adam Sutton
Note: possible values for servercapability[]:
185
<pre>
186
cwc                Descrambling available
187
v4l                Analogue TV available
188
linuxdvb           Linux DVB API available
189 1 Andreas Smas
imagecache         Image caching available
190 73 Adam Sutton
timeshift          Timeshifting available (Added in version 9).
191 70 Adam Sutton
</pre>
192
193 58 sbi -
h3. authenticate
194 1 Andreas Smas
195
This can be used to issue authentication without doing anything else.
196
If no privileges are gained it will return with 'noaccess' set to 1.
197
198 33 Andreas Smas
Request message fields:
199 1 Andreas Smas
<pre>
200 66 Adam Sutton
None   
201 33 Andreas Smas
</pre>
202 58 sbi -
203
Reply message fields:
204
<pre>
205 66 Adam Sutton
noaccess           u32   optional   If set to 1, no privileges were granted.
206 33 Andreas Smas
</pre>
207 1 Andreas Smas
208
----
209
210 66 Adam Sutton
h3. getDiskSpace (Added in version 3)
211 58 sbi -
212 66 Adam Sutton
Return diskspace status from Tvheadend's PVR storage
213 1 Andreas Smas
214 66 Adam Sutton
Request message fields:
215
<pre>
216
None
217
</pre>
218 1 Andreas Smas
219 66 Adam Sutton
Reply message fields:
220
<pre>
221
freediskspace      s64   required   Bytes available.
222
totaldiskspace     s64   required   Total capacity.
223
</pre>
224 1 Andreas Smas
225 66 Adam Sutton
h3. getSysTime (Added in version 3)
226 1 Andreas Smas
227 66 Adam Sutton
Return system time on the server.
228
229 1 Andreas Smas
Request message fields:
230
<pre>
231
None
232
</pre>
233
234
Reply message fields:
235 58 sbi -
<pre>
236 66 Adam Sutton
time               s64  required   UNIX time.
237
timezone           s32  required   Minutes west of GMT.
238 1 Andreas Smas
</pre>
239 23 Andreas Smas
240 1 Andreas Smas
----
241
242 66 Adam Sutton
h3. enableAsyncMetadata
243 1 Andreas Smas
244 66 Adam Sutton
When this is enabled the client will get continuous updates from the server about added, update or deleted channels, tags, dvr and epg entries.
245 1 Andreas Smas
246 66 Adam Sutton
An interactive application that presents the user with information about these things should probably enable this and the implement the various server to client methods.
247 1 Andreas Smas
248
Request message fields:
249
<pre>
250 66 Adam Sutton
epg                u32   optional   Set to 1, to include EPG data in async, implied by epgMaxTime (Added in version 6).
251
lastUpdate         s64   optional   Only provide metadata that has changed since this time (Added in version 6).
252
epgMaxTime         s64   optional   Maximum time to return EPG data up to (Added in version 6)
253
language           str   optional   RFC 2616 compatible language list (Added in version 6)
254 1 Andreas Smas
</pre>
255
256
Reply message fields:
257
<pre>
258 66 Adam Sutton
None
259 1 Andreas Smas
</pre>
260
261 66 Adam Sutton
Once the reply as been sent the initial data set will be provided, and then updates will arrive asynchronously after that. The initial data dump is sent using the following messages:
262 1 Andreas Smas
263 66 Adam Sutton
<pre>
264
tagAdd                   optional
265
channelAdd               optional
266
tagUpdate                optional
267
dvrEntryAdd              optional
268
eventAdd                 optional   (Added in version 6)
269
initialSyncComplete      required
270
</pre>
271 1 Andreas Smas
272 66 Adam Sutton
----
273 1 Andreas Smas
274 101 Jaroslav Kysela
h3. getChannel (Added in version 14)
275
276
Request information about the given channel.
277
278
Request message fields:
279
<pre>
280
channelId          u32   required   Channel ID.
281
</pre>
282
283
Reply message fields:
284
<pre>
285
see channelAdd
286
</pre>
287
288
----
289
290 66 Adam Sutton
h3. getEvent
291 1 Andreas Smas
292 66 Adam Sutton
Request information about the given event. An event typically corresponds to a program on a channel.
293 1 Andreas Smas
294 66 Adam Sutton
The language field in the request allows preference for languages to be requested for the various string fields.
295
296 1 Andreas Smas
Request message fields:
297 45 mdd -
<pre>
298 66 Adam Sutton
eventId            u32   required   Event ID.
299
language           str   optional   RFC 2616 compatible language list (Added in version 6)
300 1 Andreas Smas
</pre>
301
302
Reply message fields:
303
<pre>
304 66 Adam Sutton
see eventAdd
305 1 Andreas Smas
</pre>
306
307 66 Adam Sutton
h3. getEvents (Added in version 4)
308 1 Andreas Smas
309 66 Adam Sutton
Request information about a set of events. If no options are specified the entire EPG database will be returned.
310 57 sbi -
311 58 sbi -
Request message fields:
312 1 Andreas Smas
<pre>
313 66 Adam Sutton
eventId            u32   optional   Event ID to begin from (Optional since version 6)
314
channelId          u32   optional   Channel ID to get data for (Added in version 6)
315
numFollowing       u32   optional   Number of events to add (Optional since version 6)
316
maxTime            u64   optional   Maximum time to return data up to (Added in version 6)
317
language           str   optional   RFC 2616 compatible language list (Added in version 6)
318 1 Andreas Smas
</pre>
319
320
Reply message fields:
321
<pre>
322 66 Adam Sutton
events             msg[] required   List of events, using response message fields from eventAdd
323 1 Andreas Smas
</pre>
324 45 mdd -
325 66 Adam Sutton
h3. epgQuery (Added in version 4)
326 1 Andreas Smas
327 66 Adam Sutton
Query the EPG (event titles) and optionally restrict to channel/tag/content type.
328 1 Andreas Smas
329 66 Adam Sutton
Request message fields:
330
<pre>
331
query              str   required  Title regular expression to search for
332
channelId          u32   optional  [[ChannelId]] to restrict search to
333
tagId              u32   optional  [[TagId]] to restrict search to
334
contentType        u32   optional  DVB content type to restrict search to
335 98 Jaroslav Kysela
minduration        u32   optional  Minimal duration in seconds (Added in version 13)
336
maxduration        u32   optional  Maximal duration in seconds (Added in version 13)
337 66 Adam Sutton
language           str   optional  RFC 2616 compatible language list for title (Added in version 6)
338
full               u32   optional  Output full event list rather than just IDs
339
</pre>
340 1 Andreas Smas
341 66 Adam Sutton
Reply message fields:
342 1 Andreas Smas
343 66 Adam Sutton
if full == 1
344
<pre>
345
events             msg[] optional   List of events, using response message fields from eventAdd
346
</pre>
347
else
348
<pre>
349
eventIds           u32[] optional  List of eventIds that match the query
350
</pre>
351 1 Andreas Smas
352 66 Adam Sutton
h3. getEpgObject
353
354
Get detailed EPG Object info.
355
356 58 sbi -
Request message fields:
357 1 Andreas Smas
<pre>
358 66 Adam Sutton
id                 u32   required  Object ID
359
type               u32   optional  Object type
360 1 Andreas Smas
</pre>
361 58 sbi -
362 1 Andreas Smas
Reply message fields:
363 66 Adam Sutton
364 1 Andreas Smas
<pre>
365 66 Adam Sutton
TODO
366 1 Andreas Smas
</pre>
367
368 58 sbi -
----
369 1 Andreas Smas
370 66 Adam Sutton
h3. addDvrEntry (Added in version 4)
371 1 Andreas Smas
372 66 Adam Sutton
Create a new DVR entry. Either eventId or channelId, start and stop must be specified.
373 1 Andreas Smas
374
Request message fields:
375
<pre>
376 66 Adam Sutton
eventId            u32   optional   Event ID (Optional since version 5).
377
channelId          u32   optional   Channel ID (Added in version 5)
378
start              s64   optional   Time to start recording (Added in version 5)
379
stop               s64   optional   Time to stop recording (Added in version 5)
380 96 Jaroslav Kysela
retention          u32   optional   Retention time in days (Added in version 13)
381 66 Adam Sutton
creator            str   optional   Name of the event creator (Added in version 5)
382
priority           u32   optional   Recording priority (Added in version 5)
383
startExtra         s64   optional   Pre-recording buffer in minutes (Added in version 5)
384
stopExtra          s64   optional   Post-recording buffer in minutes (Added in version 5)
385
title              str   optional   Recording title, if no eventId (Added in version 6)
386
description        str   optional   Recording description, if no eventId (Added in version 5)
387
configName         str   optional   DVR configuration name
388 40 Andreas Smas
</pre>
389 1 Andreas Smas
390
Reply message fields:
391
<pre>
392 66 Adam Sutton
success            u32   required   1 if entry was added, 0 otherwise
393
id                 u32   optional   ID of created DVR entry
394
error              str   optional   English clear text of error message
395 1 Andreas Smas
</pre>
396
397 66 Adam Sutton
h3. updateDvrEntry (Added in version 5)
398 1 Andreas Smas
399 66 Adam Sutton
Update an existing DVR entry.
400 1 Andreas Smas
401
Request message fields:
402
<pre>
403 66 Adam Sutton
id                 u32   required   DVR Entry ID
404
start              s64   optional   New start time
405
stop               s64   optional   New stop time
406
title              str   optional   New entry title
407
description        str   optional   New entry description (Added in version 6)
408
startExtra         s64   optional   New pre-record buffer (Added in version 6)
409
stopExtra          s64   optional   New post-record buffer (Added in version 6)
410
configName         str   optional   New DVR configuration name
411 99 Jaroslav Kysela
retention          u32   optional   Retention in days (Added in version 13)
412
priority           u32   optional   Recording priority (Added in version 13)
413 1 Andreas Smas
</pre>
414
415
Reply message fields:
416
<pre>
417 66 Adam Sutton
success            u32   required   1 if update as successful, otherwise 0
418
error              str   optional   Error message if update failed
419 40 Andreas Smas
</pre>
420
421 66 Adam Sutton
h3. cancelDvrEntry (Added in version 5)
422 1 Andreas Smas
423 66 Adam Sutton
Cancel an existing recording, but don't remove the entry from the database.
424 1 Andreas Smas
425 66 Adam Sutton
Request message fields:
426
<pre>
427
id                 u32   required   dvrEnryId to delete
428
</pre>
429 1 Andreas Smas
430 66 Adam Sutton
Reply message fields:
431
<pre>
432
success            int   required   1 if entry was cancelled
433
error              str   optional   Error message if cancellation failed
434
</pre>
435 1 Andreas Smas
436 66 Adam Sutton
h3. deleteDvrEntry (Added in version 4)
437
438
Delete an existing DVR entry from the database.
439
440
Request message fields:
441 1 Andreas Smas
<pre>
442 66 Adam Sutton
id                 u32   required   DVR Entry ID
443 1 Andreas Smas
</pre>
444
445 11 Andreas Smas
Reply message fields:
446 1 Andreas Smas
<pre>
447 66 Adam Sutton
success            u32   required   1 if entry was removed
448
error              str   optional   Error message if the delete fails
449 1 Andreas Smas
</pre>
450
451 103 Jaroslav Kysela
h3. getDvrCutpoints (Added in version 12)
452
453
Get DVR cutpoints.
454
455
Request message fields:
456
<pre>
457
id                 u32   required   DVR Entry ID
458
</pre>
459
460
Reply message fields:
461
<pre>
462
cutpoints          msg[] optional   List of cutpoint entries, if a file is found and has some valid data.
463
</pre>
464
465
Cutpoint fields:
466
<pre>
467
start              u32   required   Cut start time in ms.
468
end                u32   required   Cut end time in ms.
469
type               u32   required   Action type: 
470
                                      0=Cut, 1=Mute, 2=Scene, 
471
                                      3=Commercial break.
472
</pre>
473
474 102 Jaroslav Kysela
---
475
476 91 Jaroslav Kysela
h3. addAutorecEntry (Added in version 13)
477
478
Create a new Autorec DVR entry. Title must be specified.
479
480
Request message fields:
481
<pre>
482
title              str   required   Title for the recordings.
483
configName         str   optional   DVR Configuration Name / UUID.
484
channelId          u32   optional   Channel ID.
485
minDuration        u32   optional   Minimal duration in seconds (0 = Any).
486
maxDuration        u32   optional   Maximal duration in seconds (0 = Any).
487
daysOfWeek         u32   optional   Bitmask - Days of week (0x01 = Monday, 0x40 = Sunday, 0x7f = Whole Week, 0 = Not set).
488
priority           u32   optional   Priority (0 = Important, 1 = High, 2 = Normal, 3 = Low, 4 = Unimportant, 5 = Not set).
489
approxTime         u32   optional   Minutes from midnight (up to 24*60).
490
startExtra         s64   optional   Extra start minutes (pre-time).
491
stopExtra          s64   optional   Extra stop minutes (post-time).
492
comment            str   optional   User Comment.
493
</pre>
494 83 Jaroslav Kysela
495
Reply message fields:
496
<pre>
497
success            u32   required   1 if entry was added, 0 otherwise
498
id                 str   optional   ID (string!) of created autorec DVR entry
499
error              str   optional   English clear text of error message
500
</pre>
501
502
h3. deleteAutorecEntry (Added in version 13)
503
504
Delete an existing autorec DVR entry from the database.
505
506
Request message fields:
507
<pre>
508
id                 str   required   Autorec DVR Entry ID (string!)
509
</pre>
510
511
Reply message fields:
512
<pre>
513
success            u32   required   1 if entry was removed
514
error              str   optional   Error message if the delete fails
515
</pre>
516
517 1 Andreas Smas
----
518
519 66 Adam Sutton
h3. getTicket (Added in version 5)
520 1 Andreas Smas
521 66 Adam Sutton
Get a ticket to allow access to a channel or recording via HTTP
522 1 Andreas Smas
523 66 Adam Sutton
Request message fields:
524 1 Andreas Smas
<pre>
525 66 Adam Sutton
channelId          u32  optional   Channel to gain access for
526
dvrId              u32  optional   DVR file to gain access for
527 1 Andreas Smas
</pre>
528
529
Reply message fields:
530
<pre>
531 66 Adam Sutton
path               str  required   The full path for access URL (no scheme, host or port)
532
ticket             str  required   The ticket to pass in the URL query string
533 1 Andreas Smas
</pre>
534
535 66 Adam Sutton
h3. subscribe
536 1 Andreas Smas
537 66 Adam Sutton
Request subscription to the given channel. 
538 1 Andreas Smas
539 66 Adam Sutton
Request message fields:
540
<pre>
541
channelId          u32   required   ID for channel. 
542
subscriptionId     u32   required   Subscription ID. Selected by client. This value is not interpreted by the server in any form. 
543
                                    The value is used from now on in all messages related to the subscription.
544 1 Andreas Smas
weight             u32   optional   Weighting of this subscription (same as recording priority).
545 73 Adam Sutton
90khz              u32   optional   Request PTS/DTS in default 90kHz timebase, default is 1MHz (Added in version 7)
546
normts             u32   optional   Request PTS/DTS normalisation (Added in version 7)
547
                                    Note: this will mean missing timestamps are added, first packet should be ~0 and will always be an i-frame.
548
                                    Note: this is implied if timeshiftPeriod is enabled
549
queueDepth         u32   optional   Change the default packet queue lengths, default 500000 bytes (Added in version 7)
550
                                    Note: I-frame depth is 3*queueDepth, P-frame is 2*queueDepth and B-frame is queueDepth
551
timeshiftPeriod    u32   optional   The number of seconds to keep in the timeshift buffer (Added in version 9)
552
                                    Note: this may be bounded by server configuration settings
553 11 Andreas Smas
</pre>
554 66 Adam Sutton
555 1 Andreas Smas
Reply message fields:
556
<pre>
557 73 Adam Sutton
90khz              u32   optional   Indicates 90khz timestamps will be used
558
normts             u32   optional   Indicates timestamps will be normalised (and fixed)
559
timeshiftPeriod    u32   optional   The actual timeshiftPeriod to be used
560 66 Adam Sutton
</pre>
561 1 Andreas Smas
562 66 Adam Sutton
h3. unsubscribe
563
564
Stop a subscription.
565
566
Request message fields:
567 1 Andreas Smas
<pre>
568 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
569 58 sbi -
</pre>
570
571 11 Andreas Smas
Reply message fields:
572 1 Andreas Smas
<pre>
573 66 Adam Sutton
None
574 58 sbi -
</pre>
575 11 Andreas Smas
576 66 Adam Sutton
h3. subscriptionChangeWeight (Added in version 5)
577 1 Andreas Smas
578 66 Adam Sutton
Change the weight of an existing subscription
579 1 Andreas Smas
580 66 Adam Sutton
Request message fields:
581
<pre>
582
subscriptionId     u32   required   Subscription ID.
583
weight             u32   optional   The new subscription weight.
584 1 Andreas Smas
</pre>
585
586
Reply message fields:
587
<pre>
588 69 Adam Sutton
None
589 1 Andreas Smas
</pre>
590
591 73 Adam Sutton
h3. subscriptionSkip (Added in version 9)
592
593
Skip a timeshift enabled subscription. The response will be asynchronous subscriptionSkip().
594
595
Request message fields:
596
<pre>
597
subscriptionId     u32   required   Subscription ID.
598
absolute           u32   optional   The skip request is absolute
599
time               u64   optional   Specify skip using time (units are as for PTS)
600
size               u64   optional   Specify skip using size (Not currently used)
601
</pre>
602
603
Reply message fields:
604
<pre>
605
None
606
</pre>
607
608
h3. subscriptionSeek (Added in version 9)
609
610
Synonym for subscriptionSkip
611
612
h3. subscriptionSpeed (Added in version 9)
613
614
Set the playback speed for the subscription. The response will be asynchronous subscriptionSpeed().
615
616
Request message fields:
617
<pre>
618
subscriptionId     u32   required   Subscription ID.
619
speed              u32   required   Specify speed (0=pause, 100=1x fwd, -100=1x backward)
620
</pre>
621
622
Reply message fields:
623
<pre>
624
None
625
</pre>
626
627
h3. subscriptionLive (Added in version 9)
628
629
Return a timeshifted session to live. Reply will be asynchronous subscriptionSkip().
630
631
Request message fields:
632
<pre>
633
subscriptionId     u32   required   Subscription ID.
634
</pre>
635
636
Reply message fields:
637
<pre>
638
None
639 82 Jaroslav Kysela
</pre>
640 1 Andreas Smas
641 83 Jaroslav Kysela
h3. subscriptionFilterStream (Added in version 12)
642 1 Andreas Smas
643 83 Jaroslav Kysela
Enable or disable specified streams by index.
644
645
Request message fields:
646
<pre>
647
subscriptionId     u32        required   Subscription ID.
648
enable             list[u32]  optional   Enable stream indexes
649
disable            list[u32]  optional   Disable (filter out) stream indexes
650
</pre>
651
652
Reply message fields:
653
<pre>
654
None
655
</pre>
656
657
h3. getCodecs (Added in version 11, Removed in version 16)
658
659 82 Jaroslav Kysela
Return a list of encoders (codecs).
660
661 1 Andreas Smas
Reply message fields:
662 82 Jaroslav Kysela
<pre>
663 83 Jaroslav Kysela
encoders           list[str]  optional   Supported encoders
664 82 Jaroslav Kysela
</pre>
665
666 70 Adam Sutton
h3. fileOpen (Added in version 8)
667 69 Adam Sutton
668
Open a file within the Tvheadend file system. This is now the preferred method (in place of HTTP) for accessing recordings.
669
670
Accessing recordings via HTSP will overcome the limitations of standard HTTP streaming which cannot handle both skipping and growing files (i.e. in-progress recordings) at the same time.
671
672 1 Andreas Smas
Request message fields:
673 69 Adam Sutton
<pre>
674 70 Adam Sutton
file               str   required   File path to open
675 1 Andreas Smas
</pre>
676
677 70 Adam Sutton
Valid file paths:
678
<pre>
679
/dvrfile/ID        will open the file associated with DVR entry ID
680 74 Adam Sutton
/imagecache/ID     will open the file associated with imagecache entry ID (Note: only works for HTSPv10+)
681 70 Adam Sutton
</pre>
682
683 69 Adam Sutton
Reply message fields:
684
<pre>
685
id                 u32   required   The file handle used for further file operations
686
size               u64   optional   The size of the file in bytes
687 1 Andreas Smas
mtime              u64   optional   The last time the file was modified
688 69 Adam Sutton
</pre>
689
690 70 Adam Sutton
h3. fileRead (Added in version 8)
691 69 Adam Sutton
692 1 Andreas Smas
Read data from a file.
693
694 69 Adam Sutton
Request message fields:
695
<pre>
696
id                 u32   required   The file handle used for further file operations
697 70 Adam Sutton
size               u64   required   The amount of data to read
698
offset             u64   optional   Offset into the file to read (default is current position)
699 69 Adam Sutton
</pre>
700 1 Andreas Smas
701 69 Adam Sutton
Reply message fields:
702
<pre>
703
data               bin   required   The data read from the file (size may be less than requested)
704
</pre>
705
706 70 Adam Sutton
h3. fileClose (Added in version 8)
707 69 Adam Sutton
708
Close an opened file.
709
710
Request message fields:
711
<pre>
712 1 Andreas Smas
id                 u32   required   The file handle to be closed
713 69 Adam Sutton
</pre>
714
715
Reply message fields:
716
<pre>
717
None
718
</pre>
719 70 Adam Sutton
720 69 Adam Sutton
h3. fileStat (Added in version 8)
721
722
Get status of a file.
723
724
Request message fields:
725
<pre>
726
id                 u32   required   The file handle to be stat'd
727 1 Andreas Smas
</pre>
728
729
Reply message fields:
730
<pre>
731
size               u64   optional   The size of the file in bytes
732
mtime              u64   optional   The last time the file was modified
733
</pre>
734 70 Adam Sutton
735
h3. fileSeek (Added in version 8)
736
737
Seek to position in a file.
738
739
Request message fields:
740
<pre>
741
id                 u32   required   The file handle to be stat'd
742
offset             u64   required   The position to seek in the file
743
whence             str   required   Where to seek relative to (default=SEEK_SET)
744
</pre>
745
746
Note: valid values for whence
747
<pre>
748
SEEK_SET           Seek relative to start of file
749
SEEK_CUR           Seek relative to current position in file
750 72 Adam Sutton
SEEK_END           Seek relative (backwards) to end of file
751 70 Adam Sutton
</pre>
752
753
Reply message fields:
754
<pre>
755
offset             u64   optional   The new absolute position within the file
756
</pre>
757 66 Adam Sutton
758 1 Andreas Smas
h1. Server to Client methods
759
760
----
761
762
h3. channelAdd
763
764
A new channel has been created on the server.
765
766
Message fields:
767
<pre>
768
channelId          u32   required   ID of channel.
769 66 Adam Sutton
channelNumber      u32   required   Channel number, 0 means unconfigured.
770 90 Jaroslav Kysela
channelNumberMinor u32   optional   Minor channel number (Added in version 13).
771 1 Andreas Smas
channelName        str   required   Name of channel.
772 70 Adam Sutton
channelIcon        str   optional   URL to an icon representative for the channel
773
                                    (For v8+ clients this could be a relative /imagecache/ID URL
774 73 Adam Sutton
                                     intended to be fed to fileOpen() or HTTP server)
775 104 Jaroslav Kysela
                                    (For v15+ clients this could be a relative imagecache/ID URL
776
                                     intended to be fed to fileOpen() or HTTP server)
777 66 Adam Sutton
eventId            u32   optional   ID of the current event on this channel.
778
nextEventId        u32   optional   ID of the next event on the channel.
779
tags               u32[] optional   Tags this channel is mapped to.
780
services           msg[] optional   List of available services (Added in version 5)
781 13 Andreas Smas
</pre>
782 1 Andreas Smas
783 66 Adam Sutton
Service fields:
784 1 Andreas Smas
<pre>
785 66 Adam Sutton
name               str   required   Service name
786
type               str   required   Service type
787
caid               u32   optional   Encryption CA ID
788
caname             str   optional   Encryption CA name
789 11 Andreas Smas
</pre>
790 1 Andreas Smas
791 66 Adam Sutton
h3. channelUpdate
792 11 Andreas Smas
793 66 Adam Sutton
Same as channelAdd, but all fields (except channelId) are optional.
794
795 58 sbi -
h3. channelDelete
796 1 Andreas Smas
797
A channel has been deleted on the server.
798 58 sbi -
799
Message fields:
800 1 Andreas Smas
<pre>
801 66 Adam Sutton
channelId          u32   required   ID of channel.
802 1 Andreas Smas
</pre>
803
804
----
805
806
h3. tagAdd
807 11 Andreas Smas
808 1 Andreas Smas
A new tag has been created on the server.
809
810
Message fields:
811
<pre>
812 66 Adam Sutton
tagId              u32   required   ID of tag.
813
tagName            str   required   Name of tag.
814
tagIcon            str   optional   URL to an icon representative for the channel.
815
tagTitledIcon      u32   optional   Icon includes a title
816
members            u32[] optional   Channel IDs of those that belong to the tag
817 1 Andreas Smas
</pre>
818 11 Andreas Smas
819 39 elupus -
h3. tagUpdate
820 58 sbi -
821 66 Adam Sutton
Same as tagAdd, but all fields (except tagId) are optional.
822 11 Andreas Smas
823
h3. tagDelete
824 1 Andreas Smas
825 58 sbi -
A tag has been deleted from the server.
826 1 Andreas Smas
827
Message fields:
828
<pre>
829 66 Adam Sutton
tagId              u32   required   ID of tag.
830 58 sbi -
</pre>
831
832 12 Andreas Smas
----
833 1 Andreas Smas
834 66 Adam Sutton
h3. dvrEntryAdd (Added in version 4)
835 58 sbi -
836 1 Andreas Smas
A new recording has been created on the server.
837 58 sbi -
838 1 Andreas Smas
Message fields:
839 2 Andreas Smas
<pre>
840 66 Adam Sutton
id                 u32   required   ID of dvrEntry.
841
channel            u32   required   Channel of dvrEntry.
842
start              s64   required   Time of when this entry was scheduled to start recording.
843
stop               s64   required   Time of when this entry was scheduled to stop recording.
844 89 Jaroslav Kysela
startExtra         s64   required   Extra start time (pre-time) in minutes (Added in version 13).
845
stopExtra          s64   required   Extra stop time (post-time) in minutes (Added in version 13).
846
retention          s64   required   DVR Entry retention time in days.
847
priority           u32   required   Priority (0 = Important, 1 = High, 2 = Normal, 3 = Low, 4 = Unimportant, 5 = Not set) (Added in version 13).
848
eventId            u32   optional   Associated EPG Event ID (Added in version 13).
849
autorecId          u32   optional   Associated Autorec ID (Added in version 13).
850
contentType        u32   optional   Content Type (like in the DVB standard) (Added in version 13).
851 66 Adam Sutton
title              str   optional   Title of recording
852
summary            str   optional   Short description of the recording (Added in version 6).
853
description        str   optional   Long description of the recording.
854
state              str   required   Recording state
855
error              str   optional   Plain english error description (e.g. "Aborted by user").
856 48 mdd -
</pre>
857 1 Andreas Smas
858 66 Adam Sutton
TODO: recording states
859 48 mdd -
860
h3. dvrEntryUpdate
861
862 66 Adam Sutton
Message fields:
863
<pre>
864
Same as dvrEntryAdd, but all fields (except id) are optional.
865
</pre>
866 51 elupus -
867 66 Adam Sutton
h3. dvrEntryDelete (Added in version 4)
868 58 sbi -
869 66 Adam Sutton
A recording has been deleted from the server.
870 58 sbi -
871 48 mdd -
Message fields:
872
<pre>
873 66 Adam Sutton
id                 u32   required   ID of recording to delete.
874 1 Andreas Smas
</pre>
875 48 mdd -
876 58 sbi -
----
877 48 mdd -
878 95 Jaroslav Kysela
h3. autorecEntryAdd (Added in version 13)
879
880
A new autorec recording has been created on the server.
881
882
Message fields:
883
<pre>
884
id                 str   required   ID (string!) of dvrAutorecEntry.
885
enabled            u32   required   If autorec entry is enabled (activated).
886
minDuration        u32   required   Minimal duration in seconds (0 = Any).
887
maxDuration        u32   required   Maximal duration in seconds (0 = Any).
888
retention          u32   required   Retention time (in days).
889
daysOfWeek         u32   required   Bitmask - Days of week (0x01 = Monday, 0x40 = Sunday, 0x7f = Whole Week, 0 = Not set).
890
priority           u32   required   Priority (0 = Important, 1 = High, 2 = Normal, 3 = Low, 4 = Unimportant, 5 = Not set).
891
approxTime         u32   required   Minutes from midnight (up to 24*60).
892
startExtra         s64   required   Extra start minutes (pre-time).
893
stopExtra          s64   required   Extra stop minutes (post-time).
894
title              str   optional   Title.
895
channel            u32   optional   Channel ID.
896
</pre>
897
898
h3. autorecEntryUpdate (Added in version 13)
899
900
Message fields:
901
<pre>
902
Same as autorecEntryUpdate but all fields (except id) are optional.
903
</pre>
904
905
h3. autorecEntryDelete (Added in version 13)
906
907
Message fields:
908
<pre>
909
id                 str   required   Autorec Entry ID (string!)
910
</pre>
911
912
----
913
914 66 Adam Sutton
h3. eventAdd (Added in version 6)
915 48 mdd -
916 66 Adam Sutton
Message fields:
917
<pre>
918
eventId            u32   required   Event ID
919
channelId          u32   required   The channel this event is related to.
920
start              u64   required   Start time of event, UNIX time.
921
stop               u64   required   Ending time of event, UNIX time.
922
title              str   optional   Title of event.
923
summary            str   optional   Short description of the event (Added in version 6).
924
description        str   optional   Long description of the event.
925
serieslinkId       u32   optional   Series Link ID (Added in version 6).
926
episodeId          u32   optional   Episode ID (Added in version 6).
927
seasonId           u32   optional   Season ID (Added in version 6).
928
brandId            u32   optional   Brand ID (Added in version 6).
929
contentType        u32   optional   DVB content code (Added in version 4, Modified in version 6*).
930
ageRating          u32   optional   Minimum age rating (Added in version 6).
931
starRating         u32   optional   Star rating (1-5) (Added in version 6).
932
firstAired         s64   optional   Original broadcast time, UNIX time (Added in version 6).
933
seasonNumber       u32   optional   Season number (Added in version 6).
934
seasonCount        u32   optional   Show season count (Added in version 6).
935
episodeNumber      u32   optional   Episode number (Added in version 6).
936
episodeCount       u32   optional   Season episode count (Added in version 6).
937
partNumber         u32   optional   Multi-part episode part number (Added in version 6).
938
partCount          u32   optional   Multi-part episode part count (Added in version 6).
939
episodeOnscreen    str   optional   Textual representation of episode number (Added in version 6).
940
image              str   optional   URL to a still capture from the episode (Added in version 6).
941
dvrId              u32   optional   ID of a recording (Added in version 5).
942
nextEventId        u32   optional   ID of next event on the same channel.
943
</pre>
944 48 mdd -
945 66 Adam Sutton
* *contentType previously had the major DVB category in the bottom 4 bits, 
946
  however in v6 this has been changed to properly match DVB, so top 4 bits
947
  as major category and bottom 4 bits has sub-category. Clients requesting
948
  v5 or lower will get the old output.
949 48 mdd -
950 66 Adam Sutton
h3. eventUpdate (Added in version 6)
951 35 Andreas Smas
952 58 sbi -
Message fields:
953
<pre>
954 66 Adam Sutton
Same as eventAdd but all fields (except eventId) are optional.
955 35 Andreas Smas
</pre>
956 58 sbi -
957 77 John Törnblom
h3. eventDelete (Added in version 6)
958 35 Andreas Smas
959 66 Adam Sutton
Message fields:
960
<pre>
961
eventId            u32   required   Event ID
962
</pre>
963 14 Andreas Smas
964 66 Adam Sutton
---
965 14 Andreas Smas
966 66 Adam Sutton
h3. initialSyncCompleted (Added in version 2)
967 14 Andreas Smas
968 66 Adam Sutton
Sent after all the initial metadata has been sent when session has been set to async mode.
969 38 Andreas Smas
970
Message fields:
971 14 Andreas Smas
<pre>
972
</pre>
973
974
----
975
976
h3. subscriptionStart
977 53 Andreas Smas
978 66 Adam Sutton
Asynchronous message output when a new subscription is successfully started.
979 14 Andreas Smas
980
Message fields:
981 1 Andreas Smas
<pre>
982 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
983
streams            msg[] required   Array of messages with stream information
984
sourceinfo         msg   optional   Source information.
985
</pre>
986 37 Andreas Smas
987 66 Adam Sutton
Stream message fields:
988
<pre>
989
index              u32   required   Index for this stream
990
type               str   required   Type of stream
991 80 Jaroslav Kysela
meta               bin   optional   Codec metadata (private data) (Added in version 17)
992 66 Adam Sutton
language           str   optional   Language for stream
993
Video components only:
994
width              u32   optional   Width of video in pixels
995
height             u32   optional   Height of video in pixels
996 68 Andreas Smas
aspect_num         u32   optional   Aspect ratio numerator (Added in version 5) *Can be incorrect and should not be relied upon*
997
aspect_den         u32   optional   Aspect ratio denonminator (Added in version 5) *Can be incorrect and should not be relied upon*
998 66 Adam Sutton
Audio components only:
999 76 Dave Chapman
audio_type         u32   optional   Audio type - 0=Normal; 1=Clean effects; 2=Hearing impaired; 3=Visually impaired commentary; 4-255=Reserved (Added in version 11)
1000 66 Adam Sutton
channels           u32   optional   Number of audio channels (Added in version 5)
1001
rate               u32   optional   Audio bitrate (Added in version 5)
1002
Subtitle components only:
1003
composition_id     u32   optional   ??? (Added in version 5)
1004
ancillary_id       u32   optional   ??? (Added in version 5)
1005
</pre>
1006 2 Andreas Smas
1007 66 Adam Sutton
Sourceinfo message fields:
1008
<pre>
1009
adapter            str   optional   Adapter name
1010
mux                str   optional   Transponder name
1011
network            str   optional   Network name
1012
provider           str   optional   ???
1013
service            str   optional   Service name
1014
</pre>
1015 15 Andreas Smas
1016 66 Adam Sutton
Video Stream types:
1017 1 Andreas Smas
<pre>
1018 79 Jaroslav Kysela
MPEG2VIDEO                    MPEG2 video, meta field is present (configuration blocks)
1019
H264                          H264 video, meta field is present (configuration blocks)
1020
HEVC                          HEVC video, meta field is present (configuration blocks)
1021 66 Adam Sutton
</pre>
1022 15 Andreas Smas
1023 1 Andreas Smas
Audio Stream types:
1024
<pre>
1025 66 Adam Sutton
MPEG2AUDIO                    MPEG2 audio (MP2)
1026
AC3                           AC3 audio
1027 79 Jaroslav Kysela
AAC                           ADTS framed AAC (one AAC packet per ADTS frame), meta field is present (MPEG4 config)
1028 66 Adam Sutton
EAC3                          Enhanced AC3 audio
1029 79 Jaroslav Kysela
VORBIS                        Vorbis audio, meta field is present with the main vorbis header
1030 16 Andreas Smas
</pre>
1031
1032 66 Adam Sutton
Subtitle Stream types:
1033
<pre>
1034
TELETEXT                      ???
1035
DVBSUB                        ???
1036
</pre>
1037 55 Lars Op den Kamp -
1038
h3. subscriptionStop
1039
1040 66 Adam Sutton
A subscription has been stopped.
1041 55 Lars Op den Kamp -
1042
Message fields:
1043
<pre>
1044 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
1045 1 Andreas Smas
status             str   optional   Error message if subscription stopped unexpectedly.
1046
</pre>
1047
1048 73 Adam Sutton
h3. subscriptionSkip (Added version 9)
1049
1050
A subscription has been skipped.
1051
1052
Message fields:
1053
<pre>
1054
subscriptionId     u32   required   Subscription ID.
1055
error              u32   optional   The last skip command caused an error.
1056
absolute           u32   optional   Indicates the output is absolute (Note: should always be 1 at the moment)
1057
time               u64   optional   The time the subscription has skipped to.
1058
size               u64   optional   The position in the file we've skipped to (Note: not currently used).
1059
</pre>
1060
1061
h3. subscriptionSpeed (Added version 9)
1062
1063
A subscription's playback speed has changed.
1064
1065
This can happen even without a speed request, should playback reach either end of the buffer.
1066
1067
Message fields:
1068
<pre>
1069
subscriptionId     u32   required   Subscription ID.
1070
speed              u32   required   The new speed of the subscription
1071
</pre>
1072
1073 55 Lars Op den Kamp -
h3. subscriptionStatus
1074
1075 66 Adam Sutton
Subscription status update.
1076 58 sbi -
1077
Message fields:
1078
<pre>
1079 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
1080
status             str   optional   English clear text of error status. Absence of this field means that the status is OK. 
1081 16 Andreas Smas
</pre>
1082 58 sbi -
1083 16 Andreas Smas
h3. queueStatus
1084
1085 1 Andreas Smas
The queueStatus message is sent every second during normal data delivery.
1086 60 John Törnblom
1087
The transmit scheduler have different drop thresholds for different frame types.
1088 66 Adam Sutton
1089 1 Andreas Smas
If congestion occurs it will favor dropping B-frames before P-frames before I-frames.
1090
All audio is recognized as I-frames. 
1091 58 sbi -
1092 1 Andreas Smas
Message fields:
1093
<pre>
1094 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
1095
packets            u32   required   Number of data packets in queue.
1096
bytes              u32   required   Number of bytes in queue.
1097
delay              u32   optional   Estimated delay of queue (in µs).
1098 1 Andreas Smas
Bdrops             u32   required   Number of B-frames dropped
1099 66 Adam Sutton
Pdrops             u32   required   Number of P-frames dropped
1100
Idrops             u32   required   Number of I-frames dropped
1101 73 Adam Sutton
delay              s64   required   Delta between first and last DTS (Added in version 9)
1102 1 Andreas Smas
</pre>
1103
1104
h3. signalStatus
1105
1106
The signalStatus message is sent every second during normal data delivery.
1107
1108
The optional fields may not have been implemented or may not be supported by the active adapter.
1109
1110
Message fields:
1111
<pre>
1112 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
1113
feStatus           str   required   Frontend status.
1114
feSNR              u32   optional   Signal to noise ratio.
1115 1 Andreas Smas
feSignal           u32   optional   Signal status percentage.
1116
feBER              u32   optional   Bit error rate.
1117
feUNC              u32   optional   Uncorrected blocks.
1118 73 Adam Sutton
</pre>
1119
1120
h3. timeshiftStatus
1121
1122
Provide status every second about the timeshift buffer.
1123
1124
Message fields:
1125
<pre>
1126
subscriptionId     u32   required   Subscription ID.
1127
full               u32   required   Indicates whether the buffer is full
1128
shift              s64   required   Current position relative to live
1129
start              s64   optional   PTS of the first frame in the buffer
1130
end                s64   optional   PTS of the last frame in the buffer
1131 1 Andreas Smas
</pre>
1132
1133
h3. muxpkt
1134
1135
Streaming data.
1136
1137
Message fields:
1138
<pre>
1139 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
1140
frametype          u32   required   Type of frame as ASCII value: 'I', 'P', 'B'
1141
stream             u32   required   Stream index. Corresponds to the streams reported in the subscriptionStart message.
1142
dts                s64   optional   Decode Time Stamp in µs.
1143
pts                s64   optional   Presentation Time Stamp in µs.
1144
duration           u32   required   Duration of frame in µs.
1145
payload            bin   required   Actual frame data.
1146 1 Andreas Smas
</pre>
1147 81 Jaroslav Kysela
1148
Note: From protocol version 17, the H264 payload does not contain the H264 configuration blocks (they are only in the meta field - see start message).