Click here to Skip to main content
Click here to Skip to main content

MOS Protocol Fundamentals

, 1 Apr 2009 CPOL
Rate this:
Please Sign up or sign in to vote.
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Rizwan Qureshi
Chief Technology Officer Neuron Management Services
Pakistan Pakistan
I am a man with distinguish academic and professional career. i love programming and it is next to breathing to me. I did my post graduation in Computer Science and specialized in the field of Artificial Intelligence. these days i am busy in developing a developer friendly site. I am open to any suggestion and would definitely seek help in this regard.
 
Here are few Smile | :) certifications i earned:
 
MCPD Enterprise Application Development Framework 2.0
MCTS: Framwork Fundamentals 2.0
MCTS: Web Client Development 2.0
MCTS: Window Client Development 2.0
MCTS: Distributed Client Development 2.0
 
MCITP:Microsoft® SQL Server™ 2005 - Implementation and Maintenance
 
MCTS:Microsoft Windows SharePoint Services 3.0 - Application Development
MCTS:Developing Business Process and Integration Solutions using Microsoft® BizTalk® Server 2006
MCTS:Microsoft SQL Server 2005 Business Intelligence–Implementation and Maintenance
 

I wish my son would earn more certification when we celebrate his sixth birthday... Smile | :)
 
you can reach me at rizwanqureshi@yahoo.com

Comments and Discussions

 
QuestionSample code Pinmemberkarak26-Apr-09 19:57 
AnswerRe: Sample code PinmemberRizwan Qureshi28-Apr-09 19:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.141015.1 | Last Updated 1 Apr 2009
Article Copyright 2009 by Rizwan Qureshi
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid