Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

MOS Protocol Fundamentals

0.00/5 (No votes)
1 Apr 2009 2  
MOS protocol from introduction to implementation

Table of Contents

Introduction 

My inspiration for writing this article is based on my experience. When I started working on MOS protocol, I found myself nowhere on the web. There was only one site www.mosprotocol.com (the official site for MOS protocol and perhaps the only one). I decided then that I would share my experience and thoughts once I implement this.

MOS Fundamentals 

What is MOS

MOS is a device capable of storing media objects. Media Object refers to Character Generator Objects: CGs, Still Store, Audio and Video.

What is MOS Protocol

MOS protocol is an XML-based protocol used to communicate between NCS (News Room Computer System) and MOS device.

Need of MOS Protocol

News Room Computer System automates that operation of News Room operation that includes script writing/editing to broadcast content. This process includes many devices and each device vendor has his set of protocol to talk to NCS.
The tremendous growth of media industry inspires broadcast industry to introduce a standard protocol for the communication between NRCS and MOS devices.

Exchange of Data between NCS and MOS Devices 

MOS Protocol allows Newsroom Computer Systems (NCS) and Media Object Servers (MOS) to exchange information using a standard protocol. This protocol enables the exchange of the following type of messages:

1. Descriptive Data for Media Objects  

The MOS "pushes" descriptive information and pointers to the NCS as objects are created, modified, or deleted in the MOS. This allows the NCS to be "aware" of the contents of the MOS and enables the NCS to perform searches on and manipulate the data the MOS has sent.

2. Playlist Exchange

The NCS can build and transfer playlist information to the MOS. This allows the NCS to control the sequence in which media objects are played or presented by the MOS.

3. Status Exchange  

The MOS can inform the NCS of the status of specific clips or the MOS system in general. The NCS can notify the MOS of the status of specific playlist items or running orders.

mospic1.JPG

MOS Workflow 

Let me share the basic workflow of information exchange between NCS and MOS devices. NCS contain data in the form of Rundown objects (sometime called Runorder as well). A single Rundown can contain multiple stories and a single story can have multiple items. Each item corresponds to media objects, i.e. CGs, video file, audio file or still graphics.

workflow.JPG

NCS associate metadata to these items. Metadata information includes type, path, time to play and time length, etc.

Example: A Video Item Metadata

FileName: inauguration.mpeg
StartTime: 12:30:35 10-02-2009
Duration:00:10:30
Video Serve: MOSDEVICE 

NCS transform this metadata into MOS compliant XML and send it to MOS devices using TCP connection. In return, MOS devices send MOS XML responses to NCS.
A sample MOS XML message of the above metadata.

<mos>
<mosID>MOSDEVICE</mosID>
<ncsID>NCS</ncsID>
<messageID>507891</messageID>
<roStorySend>
<roID>96857485</roID>
<storyID>5983A501:0049B924:8390EF1F</storyID>
<storySlug>Show Open</storySlug>
<storyNum>C8</storyNum> 
<storyBody>
<storyItem>
<itemID>1</itemID> 
<itemSlug>Hotel Fire vo</itemSlug>
<objID> inauguration</objID>
<mosID>testmos</mosID>
<itemEdStart>12:30:35 10-02-2009</itemEdStart>
<itemEdDur>00:10:30</itemEdDur>
</roStorySend>
</mos>

MOS Implementation

Since MOS Protocol is an XML based protocol, its implementation is done in the standard way of XML data exchange. 

Basic Strategy

There are many MOS XML messages, e.g. <heartbeat>, <roCreate>, <roStorySend>, <roStoryMove>, etc. and for each message, we use the following strategy:

  1. Create a class that confirms one of the MOS XML message 
  2. Create object of that class and set its properties  
  3. Serialize that object to get the MOS XML message
  4. Convert MOS XML message into stream
  5. Send stream using TCP connection to MOS Device 

An Example using C# .NET 2.0  

We will create the <heartbeat> message and send it to MOS Device. <heartbeat> message is used to verify network and application continuity. 

  1. Create a MOS and heartbeat classes that confirms one of the MOS XML message:
    //<mos> message
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Xml;
    using System.Xml.Serialization;
    
    namespace mosprotocol
    {
       [XmlRoot("mos")]
       public class cMOS
        {
            string _mosID, _ncsID;
            long _messageID;
            cHeartBeat _heartbeat;
    
            public string mosID
            {
                get {return _mosID; }
                set { _mosID = value; }
            }
    
            public string ncsID
            {
                get { return _ncsID; }
                set { _ncsID = value; }
            }
    
            public long messageID
            {
                get { return _messageID; }
                set { _messageID = value; }
            }
    
           public cHeartBeat heartbeat
            {
                get { return _heartbeat; }
                set { _heartbeat = value; }
            }
        }
    }
    //heartbeat message
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Xml;
    using System.Xml.Serialization;
    
    namespace mosprotocol
    {
        [XmlRoot("heartbeat")]
        public class cHeartBeat
        {
            DateTime _time;
    
            public DateTime time
            {
                get { return _time; }
                set { _time = value; }
            }
        }
    } 
  2. Create object of mos and set its properties:
    HeartBeat heartbeat = new cHeartBeat();
    heartbeat.time = DateTime.Now;
    
    //create MOS message and set its heartbeat property
    cMOS mos = new cMOS();
    mos.messageID = 333;
    mos.mosID = "MOSDEVICEID";
    mos.ncsID = "NCSID";
    mos.heartbeat = heartbeat;      
  3. Serialize object into memory stream:
    //serialize MOS object
    MemoryStream ms = new MemoryStream();
    XmlSerializer xml = new XmlSerializer(typeof(cMOS));
    xml.Serialize(ms, mos);          
  4. Send the stream to MOS device over TCP connection:
    //create TCP connection with MOS device
    TcpClient mosClient = new TcpClient("10.1.0.94", 10641);
             
    //write MOS object stream to MOS device
    mosClient.GetStream().Write(ms.GetBuffer(),0,ms.GetBuffer().Length);

Reference  

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here