This file is raw output from pdftotext and may not be ideal for distribution. If you are a maintainer for Hackipedia, please sit down when you have time and clean this text version up. Source PDF: /mnt/main/jmc-storage/docs/SCTE/ANSI SCTE 030 Digital Program Insertion Splicing API (2009).pdf Like all conversions the text below should be fully readable as UTF-8 unicode text. --------------------------------------------------------------- ENGINEERING COMMITTEE Digital Video Subcommittee AMERICAN NATIONAL STANDARD ANSI/SCTE 30 2009 Digital Program Insertion Splicing API NOTICE The Society of Cable Telecommunications Engineers (SCTE) Standards are intended to serve the public interest by providing specifications, test methods and procedures that promote uniformity of product, interchangeability and ultimately the long term reliability of broadband communications facilities. These documents shall not in any way preclude any member or non-member of SCTE from manufacturing or selling products not conforming to such documents, nor shall the existence of such standards preclude their voluntary use by those other than SCTE members, whether used domestically or internationally. SCTE assumes no obligations or liability whatsoever to any party who may adopt the Standards. Such adopting party assumes all risks associated with adoption of these Standards, and accepts full responsibility for any damage and/or claims arising from the adoption of such Standards. Attention is called to the possibility that implementation of this standard may require the use of subject matter covered by patent rights. By publication of this standard, no position is taken with respect to the existence or validity of any patent rights in connection therewith. SCTE shall not be responsible for identifying patents for which a license may be required or for conducting inquiries into the legal validity or scope of those patents that are brought to its attention. Patent holders who believe that they hold patents which are essential to the implementation of this standard have been requested to provide information about those patents and any related licensing terms and conditions. Any such declarations made before or after publication of this document are available on the SCTE web site at http://www.scte.org. All Rights Reserved © Society of Cable Telecommunications Engineers, Inc. 2009 140 Philips Road Exton, PA 19341 i Table of Contents 1. SCOPE .................................................................................................................................................................... 1 2. REFERENCES .......................................................................................................................................................... 1 2.1. Normative references .................................................................................................................................... 1 2.1.1. Normative reference list .......................................................................................................................................... 1 2.1.2. Normative reference acquisition ............................................................................................................................. 2 2.2. Informative references .................................................................................................................................. 2 2.2.1. Informative document list ....................................................................................................................................... 2 2.2.2. Informative reference acquisition ........................................................................................................................... 2 2.3. Bibliography ................................................................................................................................................. 2 2.3.1. Bibliography document list ..................................................................................................................................... 2 2.3.2. Bibliography acquisition ......................................................................................................................................... 3 3. COMPLIANCE NOTATION ........................................................................................................................................ 3 4. DEFINITIONS .......................................................................................................................................................... 3 5. ABBREVIATIONS .................................................................................................................................................... 4 6. INTRODUCTION ...................................................................................................................................................... 5 6.1. System Block Diagram .................................................................................................................................. 5 6.2. Arbitration Priorities .................................................................................................................................... 7 6.3. Abnormal Terminations ................................................................................................................................ 9 6.4. Splicing Requirements .................................................................................................................................. 9 6.5. Communication ........................................................................................................................................... 10 7. API SYNTAX ........................................................................................................................................................ 10 7.1. Splicing_API_Message Syntax .................................................................................................................... 10 7.2. Conventions and Requirements ................................................................................................................... 13 7.3. Initialization ................................................................................................................................................ 13 7.3.1. Init_Request Message ........................................................................................................................................... 14 7.3.2. Init_Response Message ......................................................................................................................................... 14 7.4. Embedded Cueing Messages....................................................................................................................... 15 7.4.1. Cue_Request Message .......................................................................................................................................... 15 7.5. Splice Messages .......................................................................................................................................... 16 7.5.1. Splice_Request Message ....................................................................................................................................... 16 7.5.2. Splice_Response Message .................................................................................................................................... 18 7.5.3. SpliceComplete_Response Message ..................................................................................................................... 19 7.6. Alive Messages ............................................................................................................................................ 20 7.6.1. Alive_Request Message ........................................................................................................................................ 20 7.6.2. Alive_Response Message...................................................................................................................................... 21 7.7. Extended Data Messages ............................................................................................................................ 22 7.7.1. ExtendedData_Request Message .......................................................................................................................... 22 7.7.2. ExtendedData_Response Message ........................................................................................................................ 22 7.8. Abort Messages ........................................................................................................................................... 23 7.9. Abort_Request Message .............................................................................................................................. 23 7.10. Abort_Response Message ......................................................................................................................... 24 7.11. TearDownFeed_Request Message ............................................................................................................ 24 7.12. TearDownFeed_Response Message ......................................................................................................... 24 7.13. Requesting Configuration Settings............................................................................................................ 24 7.13.1. GetConfig_Request Message .............................................................................................................................. 25 7.13.2. GetConfig_Response Message ............................................................................................................................ 25 7.14. General_Response Message ..................................................................................................................... 25 8. ADDITIONAL STRUCTURES ................................................................................................................................... 26 8.1. Version ........................................................................................................................................................ 26 8.2. Hardware_Config ....................................................................................................................................... 26 8.3. splice_elementary_stream( ) ....................................................................................................................... 32 8.4. time( ) Field Definition ............................................................................................................................... 33 8.5. splice_API_descriptor( ) Field Definition................................................................................................... 34 8.5.1. playback_descriptor( ) Field Definitions............................................................................................................... 34 8.5.2. muxpriority_descriptor( ) Field Definitions .......................................................................................................... 36 8.5.3. missing_Primary_Channel_action_descriptor( ) Field Definitions ....................................................................... 36 ii 8.5.4. port_selection_descriptor( ) Field Definitions ...................................................................................................... 37 8.5.5 asset_id_descriptor( ) Field Definitions ................................................................................................................. 39 8.5.6 create_feed_descriptor( ) Field Definitions............................................................................................................ 40 8.5.7 source_info_descriptor( ) Field Definitions ........................................................................................................... 42 9. TIME SYNCHRONIZATION ..................................................................................................................................... 43 10. SYSTEM TIMING ................................................................................................................................................. 45 10.1. DPI Splice Signal Flow ............................................................................................................................. 45 10.2. DPI Splice Initiation Timeline .................................................................................................................. 47 APPENDIX A. RESULT CODES .................................................................................................................................. 49 APPENDIX B. EXAMPLE USE OF LOGICAL MULTIPLEX TYPE 0X0006 AND THE PORT_SELECTION_DESCRIPTOR( ) ... 52 LIST OF TABLES FIGURE 6-1 SINGLE SERVER / SINGLE SPLICER ...............................................................................................................5 FIGURE 6-2 MULTIPLE SERVERS / MULTIPLE SPLICERS ..................................................................................................6 FIGURE 6-3 OVERRIDEPLAYING FLAG OPERATION ........................................................................................................8 TABLE 7-1 SPLICING_API_MESSAGE ...........................................................................................................................10 TABLE 7-2 MESSAGEID VALUES ..................................................................................................................................11 TABLE 7-3 INIT_REQUEST_DATA.................................................................................................................................14 TABLE 7-4 INIT_RESPONSE_DATA ...............................................................................................................................14 TABLE 7-5 CUE_REQUEST_DATA ................................................................................................................................15 TABLE 7-6 SPLICE_REQUEST_DATA ............................................................................................................................17 TABLE 7-7 SPLICE_RESPONSE_DATA...........................................................................................................................19 TABLE 7-8 SPLICECOMPLETE_RESPONSE_DATA .........................................................................................................19 TABLE 7-9 ALIVE_REQUEST_DATA .............................................................................................................................21 TABLE 7-10 ALIVE_RESPONSE_DATA..........................................................................................................................21 TABLE 7-11 ALIVE_RESPONSE MESSAGE STATES ........................................................................................................21 TABLE 7-12 EXTENDEDDATA_REQUEST_DATA ..........................................................................................................22 TABLE 7-13 EXTENDEDDATA_RESPONSE_DATA .........................................................................................................23 TABLE 7-14 ABORT_REQUEST DATA ...........................................................................................................................23 TABLE 7-15 ABORT_REQUEST DATA ...........................................................................................................................24 TABLE 7-15 GETCONFIG_RESPONSE DATA ..................................................................................................................25 TABLE 8-1 VERSION( )..................................................................................................................................................26 TABLE 8-2 HARDWARE_CONFIG( ) ...............................................................................................................................26 TABLE 8-3 LOGICAL MULTIPLEX TYPE ........................................................................................................................27 TABLE 8-4 TYPE 0X0006 STRUCTURE ..........................................................................................................................30 TABLE 8-5 TYPE 0X0007 STRUCTURE...........................................................................................................................31 TABLE 8-6 SPLICE_ELEMENTARY_STREAM( ) ...............................................................................................................33 TABLE 8-7 TIME( ) ........................................................................................................................................................34 TABLE 8-8 SPLICE_API_DESCRIPTOR( ) .........................................................................................................................34 TABLE 8-9 PLAYBACK_DESCRIPTOR( ) .........................................................................................................................35 TABLE 8-10 BITRATERULE VALUES .............................................................................................................................35 TABLE 8-11 MUXPRIORITY_DESCRIPTOR( )...................................................................................................................36 TABLE 8-12 MISSING_PRIMARY_CHANNEL_ACTION_DESCRIPTOR ( ) ..........................................................................37 TABLE 8-13 IPV4 PORT_SELECTION_DESCRIPTOR ( ) ..................................................................................................38 TABLE 8-14 IPV6 PORT_SELECTION_DESCRIPTOR ( ) ...................................................................................................39 TABLE 8-15 ASSET_ID_DESCRIPTOR ( ) .........................................................................................................................40 TABLE 8-16 CREATE_FEED_DESCRIPTOR ( )..................................................................................................................41 TABLE 8-17 SOURCE_INFO_DESCRIPTOR ( ) ..................................................................................................................42 TABLE 8-18 FRAME RATE CODES (INFORMATIVE) ......................................................................................................43 FIGURE 10-1 SINGLE EVENT SPLICE .............................................................................................................................45 FIGURE 10-2 MULTIPLE EVENT SPLICE ........................................................................................................................46 FIGURE 10-3 DPI SPLICE INITIATION TIMELINE ...........................................................................................................48 iii LIST OF FIGURES FIGURE 6-1 SINGLE SERVER / SINGLE SPLICER ...............................................................................................................5 FIGURE 6-2 MULTIPLE SERVERS / MULTIPLE SPLICERS ..................................................................................................6 FIGURE 6-3 OVERRIDEPLAYING FLAG OPERATION ........................................................................................................8 FIGURE 10-1 SINGLE EVENT SPLICE .............................................................................................................................45 FIGURE 10-2 MULTIPLE EVENT SPLICE ........................................................................................................................46 FIGURE 10-3 DPI SPLICE INITIATION TIMELINE ...........................................................................................................48 iv Digital Program Insertion Splicing Application Program Interface 1. Scope This Application Program Interface (API) creates a standardized method of communication between Servers and Splicers for the insertion of content into any MPEG-2 Output Multiplex in the Splicer. This API is flexible enough to support one or more Servers attached to one or more Splicers. Digital Program Insertion includes content such as spot advertisements of various lengths, program substitution, public service announcements or program material created by splicing portions of the program from a Server. 2. References 2.1. Normative references The following standards contain provisions that, through reference in this text, constitute provisions of this standard. At the time of publication, the editions indicated were valid. All standards are subject to revision, and parties to agreements based on this recommendation are encouraged to investigate the possibility of applying the most recent edition of the standards indicated below. 2.1.1. Normative reference list 1. ITU-T Rec. H.222.0 / ISO/IEC 13818-1 (2000), Information Technology ---- Generic Coding of Moving Pictures and Associated Audio Information: Systems 2. ITU-T Rec. H.262 / ISO/IEC 13818- 2 (2000), Information Technology ---- Generic Coding of Moving Pictures and Associated Audio Information: Video 3. ANSI/SCTE 35 2007 [IN PROGRESS], Digital Program Insertion Cueing Message for Cable; also ITU-T Recommendation - J.181, June 2004. 4. SCTE 128 2008 AVC Video Systems and Transport Constraints for Cable Television 5. SCTE 54 2009 Digital Video Service Multiplex and Transport System Standard for Cable Television. 1 2.1.2. Normative reference acquisition ITU Standards: • ITU Sales and Marketing Service, International Telecommunication Union, Place des Nations CH-1211, Geneva 20, Switzerland; Telephone: +41 22 730 6141; Facsimile: +41 22 730 5194; E-mail: sales@itu.int ; URL: ISO/IEC Standards: • Global Engineering Documents, World Headquarters, 15 Inverness Way East, Englewood, CO 80112-5776, USA; Telephone: 800-854-7179; Facsimile: 303-397-2740; E-mail: global@ihs.com ; URL: SCTE Standards: United States of America • Society of Cable Telecommunications Engineers Inc., 140 Philips Road, Exton, PA 19341; Telephone 800-542-5040; Facsimile: 610-363-5898; E-mail: standards@scte.org; URL: 2.2. Informative references The following documents contain information that is useful in understanding this specification. Some of these documents are drafts of standards or balloted standards with unresolved comments. 2.2.1. Informative document list 1. ANSI/SCTE 67 2006, Digital Program Insertion Cueing Message for Cable – Interpretation for SCTE 35. 2. IETF RFC3810 --- Multicast Listener Discovery Version 2 (MLDv2) for IPv6 2.2.2. Informative reference acquisition SCTE Standards: United States of America • Society of Cable Telecommunications Engineers Inc., 140 Philips Road, Exton, PA 19341; Telephone 800-542-5040; Facsimile: 610-363-5898; E-mail: standards@scte.org; URL: 2.3. Bibliography 2.3.1. Bibliography document list M. Kar, S. Narasimhan, and R. Prodan, “Local Commercial Insertion in the Digital Headend”, Proceedings of NCTA 2000 Conference, New Orleans, USA. “Cable Advertising”, white paper, March 1997, Cable Television Laboratories, Louisville, CO. 2 2.3.2. Bibliography acquisition • The National Cable Television Association, 1724 Massachusetts Ave., NW, Washington, D.C. 20036-1969; Telephone: 202-775-3669; URL: http://www.ncta.com • CableLabs, 400 Centennial Parkway, Louisville, CO 80027; Telephone: 303-661-9100; Facsimile: 303-661-9199; URL: http://www.cablelabs.com 3. Compliance notation As used in this document, “shall” denotes a mandatory provision of the standard. “Should” denotes a provision that is recommended but not mandatory. “May” denotes a feature whose presence or absence does not preclude compliance, which may or may not be present at the option of the implementer. 4. Definitions API Connection - A TCP/IP socket connection between a Server and a Splicer for transferring API messages. Back-To-Back Insertion – Two or more temporally contiguous Sessions without return to the Primary Channel between Sessions. Channel - A Channel is a synonym for a “Service” in DVB terminology, or a “Program” in MPEG terminology. Insertion Channel - The Insertion Multiplex Channel(s) that replace the Primary Channel in whole or in part of the duration for a splice event. Insertion Multiplex - This is the source of the Insertion Channel. A Multiplex produced by a Server may under some circumstances exclude PSI information, thus it is understood that this Multiplex may be a non-compliant MPEG-2 transport stream. Multiplex - A Multiplex is a collection of one or more channel(s) that may include the associated service information. A Multiplex is an MPEG-2 Transport Stream with the possible exception of an Insertion Multiplex. Output Channel - The Channel that is produced at the output of the Splicer. Output Multiplex - The MPEG-2 Transport Stream produced by multiplexing one or more Output channels. Primary Channel - The Primary Multiplex Channel that is replaced in whole or in part. A single Primary Channel may result in multiple Output Channels. Primary Multiplex - This is the source of the Primary Channel(s). Server - The device that originates the Insertion Channel(s) to be spliced into the Primary Channel(s). This device communicates with the Splicer about when and what to splice. Session - A Session is the insertion of content (such as spot advertisements of various lengths, program substitution, public service announcements, or program material created by splicing portions of the program from a Server). Each Session is identified by a unique SessionID. 3 Splice-in – The splice at the start of the insertion. This happens at the time specified in the Splice_Request message. Splice-out – The splice at the end of the insertion. The expected insertion end time is calculated by adding the start time and the duration specified in the Splice_Request message, however this may occur earlier due to error conditions. Splicer - The device that splices the Insertion Channel(s) into the Primary Channel(s). It may receive SCTE 35 cue messages. This device also communicates with the Server about when and what to splice. 5. Abbreviations API Application Program Interface CNN Cable News Network DVS Digital Video Subcommittee DVB-ASI Digital Video Broadcast – Asynchronous Serial Interface ID Identifier ISO International Standard Organization ITU International Telecommunication Union MLD Multicast Listener Discovery MPEG Moving Picture Expert Group MPTS Multi-Program Transport Stream NCTA National Cable Television Association NTP Network Time Protocol PAT Program Association Table PCR Program Clock Reference PID Packet Identifier PMT Program Map Table PSI Program Specific Information SCTE Society of Cable Telecommunications Engineers SPTS Single Program Transport Stream tcimsbf twos complement integer, most significant bit first TCP/IP Transport Control Protocol/ Internet Protocol uimsbf unsigned integer, most significant bit first UTC Coordinated Universal Time 4 6. Introduction Note: This version of the standard increments the value of Revision_Num from 1 to 2. 6.1. System Block Diagram This API may be used with many different configurations of Server(s) and Splicer(s). This API focuses on the single Server, single Splicer configuration shown in Figure 6-1. However, this can be expanded to the multiple Servers, multiple Splicers configuration as shown in Figure 6-2. Primary Multiplex Splicer (with or without Embedded Primary Cue Message) Channel Output Output Channel Multiplex Insertion Insertion Multiplex Channel TCP/IP Socket Network Connection Server Figure 6-1 Single Server / Single Splicer 5 Primary Multiplex (with or without Embedded Splicer1 Primary Cue Message) Channel Output Insertion Output Insertion Multiplex Channel Channel Multiplex Insertion Insertion Multiplex Channel TCP/IP Socket Server1 Network Connection Server(N) Insertion TCP/IP Insertion Multiplex Channel Socket Output Insertion Output Insertion Multiplex Channel Channel Multiplex Primary Channel Primary Multiplex (with or without Embedded Cue Message) Splicer (K) Figure 6-2 Multiple Servers / Multiple Splicers The model referenced in this API has one or more Splicers with one or more Multiplex inputs. The Splicer logically separates the Channel(s) in the Multiplex(s) and presents these Channel(s) to a switch. This switch is capable of mapping any input to any Output Channel. The initial configuration maps Primary Channel(s) to the Output Channel(s). The Server may then direct the Splicer to switch from a Primary Channel to an Insertion Channel for a specified duration. It may then direct the Splicer to switch to another Insertion Channel following the initial switch. The Splicer may then create an MPEG-2 Transport Stream 6 produced by multiplexing one or more Output channels that shall be compliant with SCTE 54. Logically, a splice involves two input Channels and one output Channel. The Splicer is responsible for joining the various elementary streams (audio, video and data) together. The optimal splice point may occur at slightly different times for each elementary stream, so the Splicer should perform the splice that will supply the best quality output. Splicing may not always be performed from the Primary Channel, i.e. programming network, to the Insertion Channel, i.e. spot advertisement, and back to the Primary Channel. The Splicer may splice content that is stored solely on the server and arrives over a single input Multiplex. It is possible to use this API in a situation where a server has one Multi-Program Transport Stream (MPTS) output that contains program and interstitial material and uses the splicer to create proper splices between the content. This API supports all combinations of single and multiple Servers communicating with single and multiple Splicers. A separate API Connection is associated with each Output Channel. In some configurations, there can be either multiple Servers or multiple channels within the Insertion Multiplex connected to a Splicer. In these cases, the Splicer will have multiple API Connections associated with an Output Channel. When an SCTE 35 Cueing Message is received in a Primary Channel, the Cue_Request message must be sent to Servers over all of the API Connections that were made for the associated Output Channel(s). It is also possible that more than one API Connection will transport a Splice_Request message for the same insertion at the same time for an Output Channel. 6.2. Arbitration Priorities Different levels of access are used to ensure that the correct Insertion Channel is utilized. There are ten different levels of access, 0 through 9, with 9 being the highest priority which may override any lower priority connection. The OverridePlaying flag in the Splice_Request message specifies whether an insertion request is honored when the Splicer is currently queuing or performing an insertion. If the flag is set to 1, then the higher priority insertion can interrupt the same or lower priority currently playing insertion. If the flag is set to 0, the Splicer will not replace the insertion currently playing, even if the new request is of a higher priority. The Splice_Request message should be sent at least three seconds before the splice time( ) in order to be valid. If the three second minimum is not met, the outcome of the Splice_Request message is not determined by this API. If multiple Servers initiate splice requests for the same time with the same priority, the Splicer will prioritize the requests on a first come-first served basis. All other requests will be denied and a collision error will be sent in the Splice_Response message (unless the OverridePlaying flag is set). For example, during the period of time immediately preceding the initiation of an insertion, the following is true: if a priority 5 Splice_Request is received for the same splice time as a priority 3 Splice_Request, a collision error is returned for the priority 3 request. If a priority 7 Splice_Request is later received for the same time, a collision error is returned for the priority 5 request and the priority 7 request is queued. If a second priority 7 request is received with the OverridePlaying flag set to 0, then the second priority 7 request would receive a collision error. However, if the OverridePlaying flag is set to 1 on the second 7 priority 7 request, the original priority 7 request would receive a collision error and be overridden. In Figure 6-3, three Splicer inputs are shown. The shaded areas indicate which input source will be directed to the Output Channel at any given moment. Insertion Channel 2, t2 t3 t4 t6 (From Server 2) Insertion Channel 1, t1 (From Server 1) t1 t5 Primary Channel time Figure 6-3 OverridePlaying Flag Operation t1 - Server 1 issues a Splice_Request Message and begins its stream to the Splicer. Splicer switches this Insertion Channel stream to the Output Channel. The Splice_Request has requested an insertion duration from time t1 thru time t5. The Splicer shall send Server 1 a SpliceComplete_Response message with the SpliceType flag set to Splice_in and a Result Code set to 100, ”Successful Response”. t2 - Server 2 issues a Splice_Request, with the OverridePlaying flag set to 1 and has an equal or higher priority. At the time specified by the Splice_Request, Insertion Channel 2’s stream is switched to the Output Channel (replacing the ongoing stream from Server 1). Server 2’s Splice_Request requests a duration from time t2 thru time t3. The Splicer shall send Server 1 a SpliceComplete_Response message with the SpliceType flag set to Splice_out and a Result Code set to 125, Channel Override. The Splicer shall send Server 2 a SpliceComplete_Response message with the SpliceType flag set to Splice_in and a Result Code set to 100, ”Successful Response”. If Server 1 determines that the Channel Override is an error, it may send an Abort_Request and terminate its stream at this time. This behavior is not shown in Figure 6-3. t3 - The insertion duration is completed and the Splicer returns to the material from Server 1 to direct to the Output Channel. Note that the Splicer did not return to the Primary Channel for direction to the Output Channel. The Splicer shall send Server 1 a SpliceComplete_Response message with the SpliceType flag set to Splice_in and a Result Code set to 125, Channel Override. The Splicer shall send Server 2 a SpliceComplete_Response message with the SpliceType flag set to Splice_out and a Result Code set to 100, ”Successful Response”. 8 t4 - Server 2 issues another Splice_Request, with the OverridePlaying flag set to 1. At the time specified by the Splice_Request, Insertion Channel 2’s stream is switched to the Output Channel (replacing the still ongoing stream from Server 1). Server 2’s Splice_Request requests a duration from time t4 thru time t6. The Splicer shall send Server 1 a SpliceComplete_Response message with the SpliceType flag set to Splice_out and a Result Code set to 125, Channel Override. The Splicer shall send Server 2 a SpliceComplete_Response message with the SpliceType flag set to Splice_in and a Result Code set to 100, ”Successful Response”. t5 - Server 1’s insertion stream ends with 2 portions of its duration having been played and 2 portions having been overridden by Server 2’s stream. t6 - The final insertion duration is completed and the Splicer returns to the material from Primary Channel for direction to the Output Channel. The Splicer shall send Server 2 a SpliceComplete_Response message with the SpliceType flag set to Splice_out and a Result Code set to 100, ”Successful Response”. It is also possible that multiple Servers will need to split a Cue_Request message; a 60- second duration splicing opportunity where one Server will use the first 30 seconds and the second Server will use the last 30 seconds, for example. Depending on the priorities and when the Splice_Request messages are received, the Splicer shall indicate a Result Code 109 (Splice Collision) if one exists. This API does not coordinate the ability of the two Servers to be able to perform this functionality. This can be done by mutual agreement between the Servers or by a Server-to-Server API. 6.3. Abnormal Terminations It is possible that an insertion will be overridden at some time during playback by a higher priority insertion. In this case the Splicer shall return to the overridden insertion at the end of the higher priority insertion. If the higher priority insertion is aborted by an Abort_Request message, the Splicer shall return to the overridden insertion. If the initial Insertion Channel is no longer available, then the Splicer shall return to the Primary Channel if possible. If the Server requests a splice on a Primary Channel that currently has no valid input, the Splicer shall perform the splice and report a Result Code 111 (No Primary Channel Found) in the SpliceComplete_Response to the Server. Likewise, a splice from an Insertion Channel back to a Primary Channel that has no valid input shall complete with Result Code 111 (No Primary Channel Found). The Splicer vendor may consider adding software to insure that the Splicer always returns to the Primary Channel. It is highly desirable to have the Splicer fail-safe to the Primary Channel on any error condition that would cause the Output Channel to stop transmitting 6.4. Splicing Requirements The Splicer requires information about the Insertion Channel before it can be spliced into the Primary Channel. Some of this information shall be sent in the API Connection and some of it may be sent in the MPEG Multiplex. All of the information is required before the splice. 9 ChannelName is used for Output Channel identification. This is a unique name assigned to each Output Channel (e.g. CNN) in the Splicer setup and is needed by the Server to determine which Primary Channel shall be replaced by each Insertion Channel. The Splicer needs to know which Insertion Channel to splice into the Primary Channel. This includes the Insertion Multiplex location and which Channel in the Insertion Multiplex to use. This information is available in the Splice_Request message. 6.5. Communication The communication between the Server and the Splicer is conducted over one TCP/IP socket connection per Output Channel. Once this API Connection is established it remains established until one of the devices terminates it, at which time re-initialization is required to splice again. All messages exchanged between the Splicer and Server share a common general format detailed in Section 7.1. Only messages adhering to this format shall be used for communication between the Splicer and Server. The format allows for a class of "User Defined" type messages that can be used as a template for private data messages between the Server and Splicer, but is beyond the scope of this document. All request messages require a response from either the Splicer or the Server, depending on which device is making the request. Most of the response messages only indicate a result and do not contain any other data, but are needed to ensure the requestor that the message was received and interpreted correctly. If there are errors, the message can be resent. 7. API Syntax 7.1. Splicing_API_Message Syntax Messages in this API all contain a general message structure that wraps the data for the specific message being sent. This is done so that when the message is received a common parsing routine can store the message, determine what the structure of the data is and ensure that the message is received correctly. Table 7-1 Splicing_API_Message Syntax Bytes Type Splicing_API_Message { MessageID 2 uimsbf MessageSize 2 uimsbf Result 2 uimsbf Result_Extension 2 uimsbf data( ) * * } 10 MessageID – An integer value that indicates what message is being sent. See Table 7-2. MessageSize – The size of the data( ) field being sent in bytes. Result – The results to the requested message. See Appendix A – Result Codes for details on the result codes. On request messages, this is set to 0xFFFF. Result_Extension – This shall be set to 0xFFFF unless used to send additional result information in a response message. data( ) – Specific data structure for the message being sent. Details on each of the messages containing data are described below. The size of this field is equal to the MessageSize and is determined by the size of the data being added to the message. Not all messages utilize the data( ) field. Table 7-2 MessageID Values MessageID Message Name Sent Description By 0x0000 General_Response Splicer Used to convey asynchronous or information between the devices. There Server is no data( ) associated with this message. 0x0001 Init_Request Server Initial Message to the Splicer on port 5168 0x0002 Init_Response Splicer Initial Response to the Server on the established connection 0x0003 ExtendedData_Reques Server Request for detailed playback t information from the Splicer. 0x0004 ExtendedData_Respon Splicer Vendor unique response of extended se playback data from the requested playback event. 0x0005 Alive_Request Server Sends an alive message to acquire current status. 0x0006 Alive_Response Splicer Response to the alive message indicating current status. 0x0007 Splice_Request Server Request to splice at a specific time. 0x0008 Splice_Response Splicer Response to indicate that the Splice_Request was received and that the Splicer is preparing to splice. 0x0009 SpliceComplete_Resp Splicer Response at the splice in and splice out. onse 0x000A GetConfig_Request Server Request to get the current splice configuration for this API Connection. 11 0x000B GetConfig_Response Splicer Contains all of the splice information for the API Connection 0x000C Cue_Request Splicer Splicer sending the cue info section to the Server. 0x000D Cue_Response Server Acknowledgment that the cue info section was received. 0x000E Abort_Request Server Request to immediately return to the Primary Channel or overridden Insertion Channel. 0x000F Abort_Response Splicer Acknowledgment that the Abort_Request message was received. A SpliceComplete_Response shall also be generated if necessary. 0x0010 TearDownFeed_Requ Server Request to delete an output channel est created using the create_feed_descriptor( ).. 0x0011 TearDownFeed_Respo Splicer Response to indicate that the output nse channel has been deleted. 0x0012 - Reserved Range Reserved for future 0x7FFF standardization. 0xFFFF 0x8000 - User Defined Range available for user defined 0xFFFE functions. 12 7.2. Conventions and Requirements 1. Each message that contains data is outlined with its data fields and types below. Additional structures are indicated as functions and are described in Section 8 of this document. 2. All string lengths have space reserved for a null terminator character and must use null terminated strings. For example, a string that is defined as 16 characters can be at most 15 characters of data followed by a null (0x00) character immediately after the last data character. Once a null is encountered in scanning a string, the rest of the characters in the string are undefined. The size defined for the string is constant and will not vary depending on the length of the string. This specification uses 8 bit ASCII characters for strings. 3. All time values are UTC. 4. This specification uses all 1s for a DON’T CARE condition. For a 4 byte field this value would be 0xFFFFFFFF. 5. Response messages shall be sent out without unnecessary delay. The device expecting a response should consider no response within 5 seconds to indicate a timeout. When a Server suspects a timeout, it shall send an Alive_Request message. If the Splicer does not answer as specified in this document, the connection for this channel shall be dropped and re-established. 6. A Server receiving a response message indicating failure to parse a message (error code 123) shall send an Alive_Request message. If it does not receive the appropriate Alive_Response message, the connection for this channel shall be dropped and re- established. 7. The Result field in the Splicing_API_Message is used to return a Result Code. Multiple response codes can be returned by sending multiple General_Response messages at any time. 8. If the Splicer or Server can not parse the Request message, it shall return a General_Response with Result Code 123. 7.3. Initialization The initial communication begins with the Splicer listening on the predefined port 5168 and a Server opening an API Connection to the Splicer. The Server sends an Init_Request message to the Splicer. The Server then listens for the response from the Splicer on the established API Connection. All further communication is done on this API Connection. Either the Splicer or Server may terminate communications by closing this API Connection. Each device is responsible for detecting and properly handling a closed API Connection. When the Splicer initializes the TCP listener on port 5168, it should allow for at least three times the number of Insertion Channels for API Connections to the splicer. For example, if the Splicer controls 70 Channels of which 40 are spliceable, then it should allow 120, (40 * 3), simultaneous API Connections. 13 7.3.1. Init_Request Message The data( ) field for this message contains the Init_Request_Data structure outlined below. Table 7-3 Init_Request_Data Syntax Bytes Type Init_Request_Data { Version( ) ChannelName 32 String SplicerName 32 String Hardware_Config( ) for (i=0; i