Dialogic® PowerMedia™ Extended Media Server (PowerMedia XMS) - more articles
An Offline Utility for PowerMedia XMS Dynamic Image and Menu Generation
In RESTful mode, Dialogic® PowerMedia™ Extended Media Server (XMS) uses the ImageMagick libraries to enable images and captions to be created dynamically by the application. This can simplify the task of building menus as it relieves the application developer from having to create every image in advance and having to maintain these as the application evolves.
While this feature can be very convenient, developing new formats for these images generally requires some amount of trial and error in getting the text properly placed and sized and colors/background images adjusted. Being able do this in an offline, batch mode should greatly speed up this process, as restarting the PowerMedia XMS services must be done after making adjustments. The "Imaker" utility uses the same config files, templates and style files as PowerMedia XMS. Running the utility on a command line will reference these files and produce a JPEG image that can then be viewed with any common photo (JPEG) viewer. When the desired results are obtained, the files can be moved into the proper places on the PowerMedia XMS system and used as part of a RESTful application.
A full description of PowerMedia XMS dynamic Image and Menu Generation will not be given here. Rather, refer to section 8 in the Dialogic® PowerMedia™ Extended Media Server (XMS) RESTful API Developer's Guide for full information.
Imaker can be used to produce files at the following resolutions:
- CIF - 352x288
- VGA - 640x480
- 720p - 1280x720
There are examples included that use all 3 resolutions.
Installing and Running Imaker
Imaker is contained in the tar file that can be downloaded here. Untar the file with "tar -xvfz imaker.tgz". Executable and source are contained in the Imaker directory.
Running on CentOS 6.0, Imaker requires the following packages:
which can be installed using the "yum" utility:
> yum install ImageMagick-18.104.22.168-6.el6_2.i686
> yum install ImageMagick-c++-22.214.171.124-6.el6_2.i686
Run the Imaker utility with the following command line arguments:
> Imaker <template_and_text> <output_file.jpeg> <image_width> <image_height>
A simple shell script, "make_menus.sh", contain examples of imaker runs that were used to create the demo menus for the XMS RESTful verification demo and the MSML demo that are shipped as part of PowerMedia XMS.
The resulting JPEG image can be directly played in XMS RESTful mode. For example:
will continually broadcast the JPEG image greeting.jpeg. If the URL is given as "file://verification/greeting" and greeting.vid is not available, the image and any associated audio file (.wav) will be played for 10 seconds.
If a max_time is not specified, the play will remain in effect until a RESTful "stop" command is issued:
For use in MSML mode, the image must be further processed with a video editor, and then converted to a PowerMedia XMS video format. Most editors allow a static image to be used and displayed for some predetermined number of seconds. The resulting video can then be saved and processed into the .vid format that PowerMedia XMS uses, much like any other video clip.
If modifications to the utility are desired, the source code is included. The following additional yum-installed packages are needed to build it:
There is a simple Linux shell script called "build" included that will compile the source modules and create the executable.
Files for Dynamic Menu and Image Generation
Click here to download a tar file of the scripts and files mentioned in this article.
The following are links to all of the major components used in this article:
Dialogic® PowerMedia™ Extended Media Server (XMS) – http://www.dialogic.com/products/media-server-software/xms.aspx
Image Magick - http://www.imagemagick.org/script/index.php
This article discusses one or more open source products, systems and/or releases. Dialogic is not responsible for your decision to use open source in connection with Dialogic products (including without limitation those referred to herein), nor is Dialogic responsible for any present or future effects such usage might have, including without limitation effects on your products, your business, or your intellectual property rights.
First published: 12-Nov-2012
Open access: Product rule: open; Page rule: Auto