AboutMe     MyCurrentLocation     Blog      GuestBook     Think Big- Possibilities are Endless     HOME

DRM Server Deployment 

This Proof of Concept is about setting of DRM rights on media files.

This has been achieved by integration of two Open Source Software’s

Openipmp and mpeg4ip which are available for free public download at sourceforge.net


Step 1: Environment Setup 

Place openimp2 software setup at a convenient location on the Deployment m/c:

We will refer it to as INSTALL_DIR


Install Java, Jboss Server and MySql on the Deployment machine

Set the environment Variables JAVA_HOME and JBOSS_HOME

Check the environment variables on the Command line




The PATH variable must contain the path JAVA_HOME/bin and the path to mysql command line client executable (used to access MySQL server).

Step 2 : Build the OPENIPMP SDK 

We will be building the SDK using Microsoft Visual Studio 6
Load src/DRMPlugin/DRMPluginAll/DRMPluginAll.dsw

2.       Build the DRMPluginAll project to build all the code for the SDK.

3.       After the build is completed, all libraries and headers are copied to

src/DRMPlugin/DRMPluginAll/DRMPlugin directory. Headers are copied to include directory.

DRMPluginAll.dsw copies all binaries to lib/win32/VC6/debug directory for Debug

configuration and to lib/win32/VC6/release directory for Release configuration.

DRMPluginAll.sln copies all binaries to lib/win32/VC7/debug directory for Debug

configuration and to lib/win32/VC7/release directory for Release configuration.

If the Build is successful you willl see a new Directory under

 INSTALL_DIR \src\DRMPlugin\DRMPluginAll having the structure

Note:OMA DRM clients depend on the exact URL string from which OMA DRM server

module communicates with them, please set the value of <ri><url> tag in

INSTALL_DIR /src/server/OMADRMWS/server_config.xml file to IP address and port from which you want OMA DRM server module to communicate with OMA DRM clients.

 Typically, this could be localhost:8080 or <IP address>:<IP port> where <IP address> and <IP port> are the values appropriate for the host machine where DRM server is installed.

Note 1 :

If If MySQL server is not installed on default address and port (localhost

and 3306), please edit files OMADRMWS/server_config.xml and osms/ serverConfigData.xml to proper

data for MySQL address and port.

Run the install.bat file located in INSTALL_DIR/src/server directory

Enter the name of mysql username and password

Upon Successful build a message is displayed on the command line.

Now Start the JBOSS server.

To start JBOSS run the JBOSS_INSTALL_DIR/bin/run.bat batch file.

Note : We might need to change the port number during deployment time

I have changed my port number to 18080 so the Url becomes


For changing the Port number in JBOSS perform the following steps


Change the Port no in server.xml as Illustrated

Open the URL


Register a New User

Save the .p12 file .


Log Out


From now on you will be able to successfully login with the user created


The SDK has been integrated with the mpeg4ip project.

The mpeg4ip project provides mpeg4 files encoding and decoding  applications.

To build and use mpeg4ip with DRM support, unpack src/Demo/mpeg4ip/mpeg4ip-1.5.rar to

some directory.

On Windows platform, use Microsoft Visual Studio 6 workspace DRMPluginAll.dsw

to build the SDK. The build will create a directory containing headers and binaries under

 INSTALL_DIR \src\DRMPlugin\DRMPluginAll\DRMPlugin.

Copy the DRMPlugin directory to mpeg4ip-1.5 root directory.

For Windows platform:

1.       Load mpeg4ip-1.5/encoding60.dsw in Microsoft Visual Studio 6 and build mp4creator application.

2.       Load mpeg4ip-1.5/player/src/player60.dsw in Microsoft Visual Studio 6 and build mp4player application.

3.       Either use mp4creator and mp4player applications from Microsoft Visual Studio or

copy them wherever you like together with all the dynamic link libraries from DRMPlugin directory and mpeg4ip plugin libraries.

mpeg4ip instructions building and installation

For windows, Visual Studio 6.0 projects are included.

You will need to rename nasmw.exe to nasm.exe. We require Service Pack 5.

You should get nasm-0.98.22-win32.zip from the nasm web site  http://sourceforge.net/project/showfiles.php?group_id=6208&package_id=47

 You will need to install nasm in the Microsoft Visual Studio\VC98\Bin directory before  compiling.

We are also required  to install the SDL project into where ever we are compiling the mpeg4ip project. Download the latest SDL Development Library, Windows Visual C++ zip file and extract it into the mpeg4ip top level directory.

You may also have to install lib/SDL.dll into a Windows directory (c:\win\system32)

I have copied the Files to the Location and set this path in the PATH Environment variable


Use the encoding60.dsw project for encoding tools, and the player/src/player60.dsw for the player. You may have problems with certain projects not being able to load. This is due to a problem with the way Windows ends lines in their files (using a Ctrl-M, instead of a CR-LF like DOS).

. You can use a unix to DOS file converter, or just open the .dsp or .dsw in Wordpad and save it.

Once you build it successfully you will see a message like this in Microsoft Visual Studio


Specifications of Input  XML configuration file for encryption

RightsHostURL tag in XML configuration file must be set to IP address of a host where DRM server is installed and working.

P12FilePath tag in XML configuration file must be set to the path where p12 file for the user identified with UserName and UserPass resides.

RandomNumberFilePath tag in XML configuration file must be set to the path where entropy.dat will reside.

For all the following sample command lines, it is assumed that test30.mp4 is a plain mp4

file which will be protected and saved as enc-test30.mp4


Note: For each of the following examples, the OpenIPMP DRM Server must be running. 


DRM Plugin SDK supports both creating protected files and decoding protected files. In mpeg4ip project, mp4creator application is used to encode content. Besides standard mpeg4ip parameters, it now takes certain parameters needed for DRM encryption.

· -E option is used to set encryption of all (audio and video) tracks in a file, and -E=<track ID> is used to set encryption of a track corresponding to track ID (identifier).

DRM options are the following:

· -W=<xml file name>, [mandatory], set XML configuration file name.

· -X=<sensitive data>, set sensitive information.

· -Y=<drm method>;<encryption method>, [mandatory], set protection methods.

XML configuration file contains necessary information for DRM encryption.

Sensitive information is set via command line if it shouldn't appear in the XML

configuration file (user name, password, licenses...).

 -X option can be used multiple times.

<sensitive data> can be:

· UserName;<user name>, [mandatory, only one], user name for DRM server access.

· UserPass;<password>, [mandatory, only one], user password for DRM server access.

· License;<user name>;<start date>;<end date>;<license format>, [mandatory for ISMA and

OpenIPMP DRM, can be more than one], where start and end date must be formatted as <YYYY>-<MM>-<DD>, and license format must be ODRL.

License will be added for user identified by user name and for given time period.· License;<device identifier>;<start date>;<end date>, [mandatory for OMA DRM, can be morethan one], where start and end date must be formatted as <YYYY>-<MM>-<DD>T<HH><MM><SS>Z, and one can use OMADRMDeviceIDCalc application(from DRMPlugin binaries) to calculate the device identifier from DER encoded X509 certificate file. License will be added for device identified by device identifier and for given time period. 

DRM and encryption method must be one of the following combinations:
oma;cbc, oma;ctr,isma;icm, openipmp;bfs, openipmp;ctr. oma, isma and openipmp stand for OMA DRM, ISMA DRM and OpenIPMP DRM protection, respectively. cbc, ctr, icm stand for AES encryption with 128-bit key, and cipher block chaining, counter and integer counter modes, respectively.
bfs stands for blowfish encryption.


Here is a sample command line for OMA encryption on Windows platform:mp4creator -E -W=EncoderInfo.xml -X=UserName;rajat -X=UserPass;rajat -X=License;dG2IhDioBnMdX1faxsuX0MCCmaQ=;2008-01-02T00:00:00Z;2008-12-31T00:00:00Z -Y=oma;cbc test30.mp4 enc-test30.mp4.

Here is a sample command line for ISMA encryption on Windows platform:mp4creator -E -W=EncoderInfo.xml -X=UserName; rajat -X=UserPass; rajat-X=License;danijelk;2005-08-31;2006-08-31;ODRL -Y=isma;icm test30.mp4enc-test30.mp4.

Here is a sample command line forOpenIPMP encryption on Windows platform:

mp4creator -E -W=EncoderInfo.xml -X=UserName; rajat -X=UserPass; rajat-X=License;danijelk;2005-08-31;2006-08-31;ODRL -Y=openipmp;bfs test30.mp4enc-test30.mp4.

In mpeg4ip project, mp4player application is used to play the content. Besides standardparameters, mp4player now takes certain parameters needed for playing DRM protectedcontent


Go To the path where you have built the mp4creator file.

In my Case it is C:\mpeg4ip-1.5\server\mp4creator\Release

Make sure that this location is in the path environment variable and the EncoderInfo.xml file and the file to be encoded are in the given location as specified on the command line.

Fire a command to check whether its functioning correctly

The Various options we have now for Encrypting content can be seen now by the command mp4creator.exe –help on the command line.