Jump to article
V.O.I.C.E Virtual OS/2 International Consumer Education
April 2006
A A A
Feature articles

- Mark Dodel: Our Future
- Roderick Klein: Software Patents: Here we go again. . . - An urgent Message from the VOICE President
- V. Weise: Spell check in EPM with easily changeable dictionary files
- Andreas Peters: DBox2 - Video Streaming on OS/2 and eCS
- Robert Henschel: The ThinkPad On Screen Display Utility
- Peter Brown: Adventures in AMD 64 Land
- Arthur van Egmond: How to create a database using Lotus Smartsuite - Part Three
- Tips
- Letters, Addenda, Errata

Active GUI element

Static GUI element

Code

WPS object

File/Path

Command line

Entry-field content

`[Key combination]`

more

# DBox2
Video Streaming on OS/2 and eCS

by Andreas Peters, © April 2006

## Introduction

The Dbox is a standalone digital broadcast receiver for receiving DVB. It is capable of running Linux and, among other things, streaming raw MPEG2 over a network.

It is based on NEC's 78K/0 series microcontroller

Neutrino is both the name of the Linux port that runs on Dbox, and the GUI application.

An edited translation of Neutrino from the German Wikipedia:

> Neutrino is a graphical user surface designed for easy operation of the DBox2. Neutrino is based on the Client/Server principle and is designed for use with Linux. The architecture of Neutrino controls the Dbox2 through server requests rather than direct control. Thus Neutrino can, in principle at least, control servers from arbitrary hardware, e.g., PCs or other set top boxes.

It is unrelated to QNX's Neutrino RTOS.

Half a year ago I decided to obtain digital TV. I spent a long time searching for a suitable receiver which also had to support cable TV. During my research on the Internet, I came across DBox2 by Sagem, a slightly older digital receiver that was available at eBay quite inexpensively.

The reason for my decision was that the DBox2 is in fact a small computer with an RS232 serial port (DB-9), ethernet network interface card (RJ45), PC Card interface, and modem (RJ11). Furthermore, it runs Linux quite well which for the DBox is called Neutrino. It is quite colorful and also an excellent replacement for the original old, slow firmware.

Fig. 1. Dbox2 Neutrino, main menu [Larger Image]

Neutrino has many features that turn the DBox2 into a true multimedia terminal. If you want to make the most of Neutrino, you have no choice but to connect the DBox2 to a network. That way it is possible to listen to your MP3 collection on your PC, or Shoutcast radio stations from the Internet via your stereo. Pictures from the last vacation that are stored on a PC can be viewed on the TV, as well as videos.

In this article I won't discuss my holiday videos, but rather how to use eComStation as an extension for Neutrino. In brief, using eCS as a digital video recorder. In this context, two programs are reviewed, XMediaGrabber and ProjectX. Both run on eComStation, both are capable of recording videos in different formats, and they both have options to create output with different quality.

## XMediaGrabber and ProjectX

Fig. 2. XMediaGrabber, station list [Larger Image]
Dbox2 sends the streams direct from a TV broadcaster to your computer. That format is not very useful. So a grabber engine converts it to another format such as MPEG or DVD (VOB).

### Description

XMediaGrabber is a Java application which comes with its own grabber engine but is also capable of using external ones. The good thing about this application is that it allows you to conveniently program the DBox2 timer from your PC. You can then go and spend some time at your favorite bar while DBox2 automatically records the desired movies—as long as you don't turn off your computer, that is, since it is required for storage.

XMediaGrabber reads an XML file from the webserver (included in Neutrino) to get the video and audio PID for a TV channel. After that, XMediaGrabber connects the Dbox2 via SOCKS. The audio and video PID is the SOCKS port. Then the Dbox2 sends the video and audio stream.

### Requirements

XMediaGrabber needs Java version 1.4.2 and the external tool ProjectX.

### Installation

Before installing the software, a directory tree must be created, e.g., like this:

    D:\DBox2\ProjectX
    D:\DBox2\Videos
    D:\DBox2\XMediaGrabber

XMediaGrabber can be simply extracted into the XMediaGrabber directory.

ProjectX, on the other hand, needs more attention. This package has to be compiled first. For that purpose, ProjectX has to be extracted to the ProjectX directory and then compiled using the following batch file (a pre-compiled version is available from my home page). Some path changes may be necessary.

    set JAVA_HOME=C:\PROGRAMS\JAVA142
    set PATH=%JAVA_HOME%\bin
    mkdir build
    javac.exe -O -classpath lib\commons-net-1.2.2.jar -d build @sources.lst
    copy resources\*.* build
    jar.exe cfvm ProjectX.jar MANIFEST.MF -C build .

If the above completed without errors, there now should be a file called ProjectX.jar.

### Configuration

Once all required applications have been installed, XMediaGrabber needs to be set up. First, run it the following way:

    java -jar XMediaGrabber.jar

Fig. 3. XMediaGrabber, basic setup options [Larger Image]

On the Settings page, enter the DBox2's IP address.

Fig. 4. XMediaGrabber, recording settings [Larger Image]

Next, delete the directory name in the Record section and ensure that Filename contains just %NAME%. Enable the replace blanks option.

Fig. 5. XMediaGrabber, assorted path settings [Larger Image]

Finally, you specify where XMediaGrabber stores the videos. In the destination path of record entry field, enter the Videos directory you created above in the Installation section.

### Recording a movie

Fig. 6. XMediaGrabber, Recording Menu [Larger Image]

XMediaGrabber can record videos in two ways.

- If you press the Record button, the program from the currently selected station is recorded. Before recording starts, XMediaGrabber asks for recording PIDs and duration.

  The first PID is always the video stream, all others are audio streams. So far I haven't had to change any settings. The one thing you must not forget is the recording duration, though. By default, it is set to 60 minutes. Just enter the duration of the movie there.

- The second way to record a movie is to start recording via Neutrino.

  Neutrino offers many ways to achieve this. For instance, via the Features menu item or directly from the EPG details view.

Whatever method is used to start recording, the DBox2 searches for a streaming server. In our case, it is XMediaGrabber which promptly begins to record the movie.

After recording has finished, the video and audio files are further processed by ProjectX automatically.

### Quality

While testing several other applications, I noticed that many of them frequently have problems with image and audio synchronisation. That is, audio is played later than the corresponding image, or vice versa. None of this has occurred with XMediaGrabber.

## Converting files to DVD using IfoEdit

Fig. 7. IfoEdit

Using IfoEdit, video and audio can be reassembled and inserted into a DVD structure. To do so:

- Start IfoEdit via the command file provided by me [in the Ifoedit archive]
- Select DVD Author > Author New DVD from the menu
- Select the recorded video and audio streams
- Specify the directory where the DVD files should be placed.

To specify the target directory:

- Enter C:\Temp\MyVideo\VIDEO_TS for Output Stream destination.
- Before pressing OK, use the WPS to change to your TEMP directory, create a MyVideo directory and, below that, the AUDIO_TS and VIDEO_TS subdirectories.

  You should have a directory tree that looks like the following:

      c:\temp
         |
         +--MyVideo
            |
            +--AUDIO_TS
            |
            +--VIDEO_TS

- Now you can confirm the multiplexing in IfoEdit by pressing OK.

## At last, writing to DVD

DVDDAO and CDRecord are required to do this.

Change to the directory where IfoEdit placed the files it created. In this case, C:\temp\MyVideo. There, run mkisofs [installed as part of CDRecord] from the command line:

    mkisofs -dvd -udf --split-output -o video.iso .

Don't forget the period at the end!

Next, you can write the files video.iso_01 up to video.iso_0N to a DVD using DVDDAO:

    dvddao -d a,b,c video.iso_01 video.iso_02 ... video.iso_0N

Of course, you have to insert the correct values of your writer for a,b,c. These can be found with:

    cdrecord -scanbus 1>dvd-ids

In the dvd-ids file, you should find your DVD drive and an ID of three digits. Here, it looks like the following:

    0,1,0     1) 'HL-DT-ST' 'DVDRAM GSA-4160B' 'A301' Removable CD-ROM

Okay! Now you should have a DVD with the movie that you recorded from the DBox2 that you can watch using your DVD player and TV.

Have fun!

Translation: Christian Hennecke
Editing: James Moe

##### References

XMediaGrabber: - http://www.andreas-peters.net/download/XMediaGrabber.zip
(The new version (Shareware) does not work on eComStation, as it requires Java 1.5.)
ProjectX: http://sourceforge.net/projects/project-x
ProjectX, compiled for eComStation: http://www.andreas-peters.net/download/ProjectX.zip
IfoEdit, home page: - http://www.ifoedit.com/
IfoEdit, download: - http://www.andreas-peters.net/download/ifoedit.zip
DVDDAO: http://hobbes.nmsu.edu/cgi-bin/h-search?key=dvddao
CDRecord: http://www.os2world.com/cdwriting/