Anda di halaman 1dari 8

Getting started with the CMS 500 STB (Galio 2) & the BEL demo

Alex Cameron, Digital TX Ltd, August 2006 Setting Up The Tin Can STB
Plug it into a multicast-capable router, a Homeplug/PLC Ethernet adaptor or use a crossover cable. This bit isnt hard. If you find it hard, you are a retard. Hand the settop back to CMS, and punch yourself in the balls. Hopefully the box has been set up to use DHCP, as then you can log into your router and get its IP address from there. Otherwise, youre in serious trouble. Youre going to reset it to the factory defaults, or use a software tool like Ethereal to sniff the network traffic for clues to its IP address. Good luck. Youll need it. When you fire up the box it goes to the "home" url, but may also present the (extremely ugly) configuration screen if it cant find the web server with the home page content. To set this, telnet into the box's IP (either static or DHCP) with the user/pass "admin/admincms" and use these commands with the URLs to your pages: seturl home=http://192.168.0.2/dir/home.html (for confirm, type "Y") seturl guide=http://192.168.0.2/dir/epg.html (for confirm, type "Y") type "savecfg" and then "reboot". To get the box to go to a specific page/URL, telnet in and type: url http://www.domain.com/page.html Every time you change a setting in the firmware, you need to save the changes to the flash memory and restart it. A bit like Windows. Only more annoying. And its not particularly clever or powerful either. Dont bother trying to use the remote control to enter text. Its a hell you dont want to go near. Do whatever you can via telnet. The newer boxes have a web-based control panel.

Transparency & Menu Overlays Dont Bother


The way you mostly want to do things is to display screens and menus over live video in the background. The graphics layer is called the OSD, and CMS javascript functions need to be accessed first to make sure it displays over the video (using BrowserOSD() and ForceBrowserOSD() etc). If you use a udp:// link in your HTML page, the box takes 15-20secs to tune into it, and then overtakes the HTML screens to fill the whole screen with live motion video (menus go behind the video). The box only supports alpha blending/transparency in 1/5th of the screen, which is the 1/5th of the screen extending from the first element on the page which needs alpha blending. In short, don't try and use transparency, as it won't work. You need a

more powerful STB for it And you can only get screens over the video is they are opaque (solid). .

Galio 2: Yesterdays Problems, Today


This section could be a book of its own. Galio is nowhere near what it could be. It supports the very latest in web standards such as CSS 3, RSS and AJAX (XmlHttpRequest()), but in many circumstances it cant do the most basic of operations. Its a lot faster on the PC than it is on the STB, and renders differently. To set up the desktop version of Galio, you need to create a series of shortcuts to the program on your desktop, each starting the program with a different URL. Right-click the shortcut(s) to set the details for them. You need to set the geometry of the program to standard PAL resolution (720x576 pixels), and then specify a local or internet URL for it to load up with. You could do it the old fashioned way of entering an address in the address bar, buts its a pain in the ass. Just create shortcuts. Its easier.

Its HTML, CSS, Javascript & Photoshop, Dumbass Galio is a web browser, like Internet Explorer, Firefox, Opera or Safari. You build menus and screens for the TV in standard HTML, just as you would do for a website. Theres no documentation for it, as its all on the web as open standards you can read. Ant developers are a bit posh and call Javascript ECMAScript. Dont be fooled. Its just Javascript. Youre just developing a website, and you use the same tools Dreamweaver, Photoshop and you favourite code editor. The difference is that you dont have a keyboard or a mouse, and the screen resolution is always

720x576 pixels, unlike a PC, which is typically set at 1068x768 or, god forbid, 800x600. Roll Your Own Navigation Galio doesnt have any in-built functions to go back or refresh like a normal web browser. Its dumb and just displays HTML pages as TV menus and screens. You need to build these functions into your HTML screens using history.back() and location.reload(), and fire them from key presses you pick up from the remote. The key press codes are the same you find on a desktop PC when developing a website. In the PC development emulator. Pressing Control+G on your PC will bring up the address bar so you can do to specific pages. TV On The Desktop? Err, No. The desktop version of Galio can display video files, but its crap. Theoretically its capable of showing anything that you have a DirectShow filter for (like DivX), but in reality it only likes WMV files. You can pop them in your HTML using the TV URL, e.g. url(tv:C:\video1.wmv). It will play the actual size of the video, so if you want to stretch it to be the size of a TV (720x576 pixels), you will need to create a div that size and set the background video to 100%. Yes! More Alert()! Galio also doesnt come with a debugger, or Javascript error notification. If you have a problem in your code, it just goes silent. Put code through a traditional Javascript debugger first (like a Firefox extension), and create a file called config.txt in your Ant showcase directory (C:\ANT\Showcase) with the setting to display Javascript errors (browser.ecmascript.errors.alert: true). Yes, its 1000 calls to alert() all over again.

HREF is dead Menus are traditional block style lists that you create using <div> tags and <ul> objects. In Galio, anything can receive focus (called hover in web lingo) and to handle interaction on your <li> items, you need to use standard DOM Javascript calls like AddEventListener(click, object). NB: We dont use OnClick as its messy. Links are OK, but theyre ugly as sin. Do everything you possibly can in CSS. Everything. One Version To Rule Them All Every STB manufacturer has a different Javascript API to access the hardware on the STB. Ant are supposedly working on an abstraction layer so developers can port code across different devices, but its yet to materialise. Very occasionally, content on a website displays differently to what youve got stored locally, even though its the same code. Very dumb, and totally unexplainable. The desktop version crashes when it loads the sample showcase, and when you shut it down. Ant know about it, but they havent got round to fixing it. The access the Javascript extensions provided by CMS for tuning channels, loading video etc, you need to provide a username and password in your Javascript so you have admin privileges to talk to the hardware. The documentation says you can read them, but its lies. If you call them without having the admin rights, you dont get anything returned.

Live Video Formats For Gods Sake Just Use MPEG-2


The CMS STB only supports MPEG-2 and MPEG-4 AVC H.264, nothing else. You can't do audio only, so if you want to simulate a radio station, you need a still video frame with the audio stream. Your Pirated Porn Movies Wont Play You can't display MPEG-1, DivX, xVid, MP4 or anything like it. If you want to stream anything you already have (e.g. MPG and AVI files), you need to transcode them on the fly to MPEG-2 using VLC. This doesn't work all the time. You can automate this in VLC by creating playlists of 10 MPG files or so, but the box doesnt always switch cleanly between them and thinks the network has dropped out. TRANSPORT STREAM TRANSPORT STREAM TRANSPORT STREAM The video you use has to be an MPEG transport stream (MPEG TS). Not a program stream or raw data. A transport stream. The box doesn't like H.264 streams that are 1.5Mbit/s and above. In fact it doesnt like H.264. Watching it choke is funny at first, but its gets very irritating very quickly. As soon as any action is displayed in the video, its meltdown time.

The Chaos Known As Multicasting


For multicasting, you have 3 options for sending a big, fat, unstable UDP stream from your PC to the STB to chomp on: a) Pixstream Winsend b) CMS Multicasting tool c) VL

Winsend is industry standard and will work in most circumstances. It handily gives you a choice of network card to stream out on, which the others don't.

Only trouble is that its out of production. Youll need to get a copy from someone. And no, its not on Limewire. I checked. You can get all the encoding tools on there though (Emule is better). The unsupported CMS multicasting tool looks pretty but its useless. It rejects everything as not having an appropriate program stream. The only file it has accepted so far is an H.264 mpg file created using Cyberlink PowerEncoder (AVC Edition).

VLC is free, easy and trusted. Its the Swiss army knife of desktop video. The only problem is that it doesn't give you a choice as to which interface to stream out on, and uses the default. Great if you're on a router, but a crossover cable sucks.

Especially when you have a wi-fi connection running too, as you have to have the crossover as the only connection for it to stream onto it.

When you open the file in VLC, stream/save the output (click "play locally" if you want to see it on screen as by default the video doesn't display on your PC) and choose to send it to UDP (not labelled multicast). If its not MPEG-2, click the boxes to transcode to: MPEG-TS Video codec: mp2v (MPEG-2 video) Audio code: mp2a (MPEG-2 Audio)

Don't try transcoding to H.264 in VLC. It doesn't work. In fact, the only H.264 output the CMS 500 likes is from the Cyberlink PowerEncoder. It hates MainConcepts AVC tools for some reason, even if you set them to create an MPEG transport stream. Mardy Multicast Addressing The simplest way to multicast the video is to rig up a crossover cable direct from a PC to the STB, as a lot of broadband routers don't support multicast. Multicast addresses can be problematic, so use this as it will definitely work: 235.5.5.5, port 10201. Put the udp://235.5.5.5:10201 link in the web page as a background colour/image, set the stream running (by just pressing play), and when you browse to the page you've created, the box will automatically pick it up and display it on the TV.

Video Not-Quite-On-Demand
Forget video on-demand streaming with proper VCR-like controls using RTSP. There are no open-source tools out there that can do it like the professional versions can. The nearest is Darwin Streaming Server (FOSS), which can do H.264 using RTSP. Its a pain in the ass to set up as its designed for streaming hinted QuickTime video (.MOV files) and the STB doesn't like it. The easiest way to stream video is using HTTP from a normal web server. So to play http://domain.com/movie.mpg, you use video://domain.com/mpg.

Saying that, theres no reason why you couldnt use the Helix or Unreal servers to try it. Or of course you could take CMS advice, and just spend $50k on a professional VoD server.

Famous Last Words


Do everything in CSS. I repeat, do it all in CSS. Every time the box has to think using Javascript, it slows down. These things are calculators, not desktop PCs. Do as much as you can on the web server. Use GZip/BZip encoding for HTTP transactions, and employ a script-caching mechanism to avoid the lag of interpreted code. Kill whitespace in the html and compress where you can. Large Javascript arrays kill the box, as do long lists and repeated calls to SetTimeout(), SetInterval() and innerHTML. Use 8-bit PNG images where you can and try to put in as much caching (inc. invisible preloading) is as physically possible. Dont put too much on screen, and remember viewers are lazy. Imagine a family of chavs staring at the screen wondering what a red button is. Then minus 50 IQ points, and you have your average viewer.

Copyright 2006 Alex Cameron, Digital TX Limited. www.digitaltx.tv