Sunday, 21 August 2016

DVBStreamExplorer Community Preview

A DVBStreamExplorer Community Preview including Python integration has been made public available. This is in a very early stage but will allow you to try out Python integration feature now.

At this point only x64 is available. You need a valid DVBStreamExplorer license or you can try it out for time limited period. You also need to have Python 3 x64 version installed.
Download from here:

This version is almost identical to the recent DVBSE 4.0.21 except for the Python integration.
To integrate Python launch DVBStreamExplorer. Open options / preferences. You should notice a new tab 'Python integration'.

Here you can enable Python integration. You can open the the folder where user Python scripts should be stored. The folder path is fixed and cannot be changed.

Currently only Multiple DVB MUX scanning (S/C/T) integrates Python.

Download following script and use it as a starting point, This basically just defines simple stubs for the methods that will be invoked by DVBStreamExplorer.
The print statements do not have any effect when invoked from DVBStreamExplorer since these is no active console for output. They were used when invoking script from a small Python test application. Each method increments a member variable, This is just to demonstrate that state is kept in between calls.
Now you can modify the sample script for your own need. The general rule is if you want DVBStreamExplorer to continue it's current task return 0. If you want DVBStreamExplorer to abort it's current task return 1. In the sample script this is demonstrated for DVB-S scanning that will skip scanning for vertical transponders.

This is work in progress and likely to change before final release. It is strongly recommended not to make any custom solution for production usage. Things can break in furure preview and final releases.

Feel free to provide feedback, either as comment to post or directly to

Saturday, 23 April 2016

Showing EIT information in DVBStreamExplorer Service View

DVBStreamExplorer V.4.0.20 includes a new feature that will allow EIT information to be continuously saved  to XML files from TS Monitor (DVB). DVBStreamExplorer Service View has been updated so it can now load and display such files. Below is screenshot after loading EIT XML file. Note how service names are initially displayed as triplet of ONID/TSID/SID.

To show real service names, load a DVBStreamExplorer service XML export that contains the necessary information. Below is screenshot after loading such file.

Note that the service tree items are ordered by the underlying ONID/TSID/SID values. This should preferably be changed to order by service names.

Friday, 15 April 2016

How section binary view in DVBStreamExplorer helped locating a bug

A little known feature in DVBStreamExplorer is the ability to view raw section content in main window. This feature recently helped me out locating a bug in DVBStreamExplorer.
Some time time ago I had done some DVB-S scanning of several satellites. SI and SVC XML files had been saved. Recently I tried to open SVC XML file in DVBStreamExplorer Service View which I was running from Visual Studio. I got this error during load.

I opened SVC XML file in wxHexEditor. I was able to locate the 0x07 character.

The problem was related to a service name. I was able to figure which service had the problem. I loaded the SI XML file in DVBStreamExplorer and navigated to that service and got this view.

There appears to be some kind of control character before service name. That's suspicious since control characters are supposed to be filtered out before being displayed. To view raw section content select section on tree view. And select 'value' tab in bottom view.
The first byte in highlighted area is 15 which is hexadecimal for 21 decimal which again is the length of the string. Then there is a sequence of 10 00 07 which constitutes character set selector. From ETSI EN 300 468 table A.4 it can be seen this is Latin/Greek. After this sequence there is the actual service name string. Considering that issue is about an unexpected 0x07 character it's obvious to suspect that 0x07 is considered part of the service name string.
After a code review such a bug was indeed found. This has been fixed in DVBStreamExplorer 4.0.20 just released. SI XML was loaded in new version. Service name was now displayed correctly as seen below.

A new SVC XML file was exported. And this time it could be loaded from DVBStreamExplorer Service View without any issues.

Sunday, 6 March 2016

Integrating user defined Python scripts with DVBStreamExplorer

NOTE: this post describes a feature that is not yet included in DVBStreamExplorer public release.

A new feature is planned for a future DVBStreamExplorer release. This feature will allow a user defined Python script to be invoked at certain points during 'Multiple DVB-x MUX scanning'. User script will be called on events like:
  • Starting a new scan session.
  • Starting scan of new satellite. This is only applicable for DVB-S scanning.
  • Starting scan of new MUX. Tuner parameters. 
  • Scanning of MUX completed.
  • Scanning of satellite completed. This is only applicable for DVB-S scanning.
  • Scan session completed.
Depending on event context user script can typically request DVBStreamExplorer to continue scanning, skip scanning of current satellite/MUX or abort the entire scanning session. Events handlers are methods in a class user script must implement. Using a class allows script to maintain state between calls to methods.
In example below user script is handling the start scanning of new DVB-S MUX event.

    def StartScanMuxDvbS(self,frequency, symbolrate, polarisation, fec):
        print(self.count,frequency, symbolrate, polarisation, fec)
        if polarisation == "H":
            return 0
            return 1

This code causes scanning of horisontal transponders only. Scanning of vertical transponders will be skipped.While this might not represent an interesting case for a real production system, it does demonstrate the possibilities. Note that 'self.count=self.count+1' statement is to keep track of the number of times script was called. This is for debugging purposes only.

A more realistic case for a real production system: If you are scanning multiple satellites on a regular basis, you might have certain expectations about hove many transponders should be scanned and how many services should be found. If scan result differs too much from your expectations you could send a notification, i.e. email, to a user to alert about this.

The work on this is still in progress. I now have a working prototype. But there is still some way before it's ready for public release.
Please feel free to provide feedback on this, i.e. if you have any suggestion about information that should be passed on to user script. You can provide feedback either by commenting on this post or send to

Wednesday, 10 February 2016

PCR, OPCR,PTS and DTS reports in TS File Demux

In TS File Demux v2.3.17 new feature has been added to generate CSV reports containing details about PCR, OPCR, PTS and DTS timestamps.

To create PCR, OPCR CSV report add 'Single PID one file' filter for a PID stream containing such timestamps. That will typically be the PID marked as PCR in program tree. I.e. for PID 0x1001 the binary file ts_pid_0x1001.bin will be created in output folder together with ts_pid_0x1001.bin.csv file.
See embedded sheet below for an example of such CSV file.

To create PTS, DTS report add PES filter for a PES stream containing such timestamps. That would typically be video and audio streams. Note that not all stream types recognized as PES streams may contain timestamps. Refer to ISO 13818-1 for details.  I.e. for PID 0x0fa1 the binary file pes_0x0fa1.bin will be created in output folder together with pes_0x0fa1.bin.csv file.
See embedded sheet below for an example of such CSV file.

Wednesday, 7 October 2015

Extracting DSM-CC data and object carousel content with TS File Demux

TS File Demux now includes a feature to extract DSM-CC data and object carousel content. This feature is meant to be a lighter alternative to a similar feature in DVBSTreamExplorer which might be overkill in some situations. If you need decoding of DSM-CC sections and BIOP messages, DVBStreamExplorer is the still way to go.
Below is a screenshot of a TS file that contains  DSM-CC data.
TS File Demux main window

The DSM-CC filters have been added automatically after applying 'Add all'. Streams of type 0x0b, ISO/IEC 13818-6 type B, are considered as DSM-CC carousel streams. You can add DSM-CC filter for arbitrary PID if it wasn't recognized as DSM-CC carousel and you believe that it is.
Below is screenshot of some extracted object carousel files. The files are part of a MHP application.

Extracted files
The files can now be studied offline.
Follow this link to download TS File Demux here.

Saturday, 25 April 2015

Decrypting service in DVBStreamExplorer using CI capable hardware

A little known feature in DVBStreamExplorer is the ability to decrypt DVB services using hardware that supports common interface (CI). You will need a TechnoTrend tuner card with CI support. This includes devices such as TT-connect CT 3650 CI and TT-connect S2 3650 CI. TT Budget cards with CI add-on card will also work. Cards with CI option from manufactures other than TechnoTrend will not work. Also this will only work with DVBStreamExplorer x86 version. CI and DiSEqC features are implemented in a proprietary DLL from TechnoTrend, ttBdaDrvApi_Dll.dll. Apparently this DLL is only available in 32 bit version.
You will also need a conditional access module (CAM) and a valid subscription smart-card. See picture below. It shows TT-connect CT 3650 CI, Conax CAM and subscription smart-card.

Insert your CAM and do a SI scan in DVBStreamExplorer. When completed switch to service view and DVBStreamExplorer should look similar to below.

Note that in lower right corner it can be seen that no service is currently selected.
To select a service for decryption locate an encrypted service in service view and double-click on it.
Lower right corner will now show that a service has been successfully selected.

Note this does not necessarily mean that service will be decrypted successfully. It just mean that tuning and selection of service was executed successfully.

You can check the DVBStreamExplorer log file for CI related entries. The log file can be found from options / preferences / logging.

Here is some logging from when CAM was inserted and initialized. The CA ID 0xb00 is for Conax.
 213 - Apr 25 09:25:51.189 - (9.842) - <4> - CI_OnSlotStatus(0,1)
 214 - Apr 25 09:25:51.189 - (9.842) - <4> - CI_SLOT_MODULE_INSERTED
 215 - Apr 25 09:25:57. 63 - (15.716) - <4> - CI_OnSlotStatus(0,2)
 216 - Apr 25 09:25:57. 63 - (15.716) - <4> - CI_SLOT_MODULE_OK
 217 - Apr 25 09:25:57. 63 - (15.716) - <4> - CI_SLOT_CA_OK
 218 - Apr 25 09:25:57. 63 - (15.716) - <4> - CA:  219 - Apr 25 09:25:57. 63 - (15.716) - <4> - supported CA ID[0]: 0x0B00

And here is some logging from when a service was selected for decryption.
1222 - Apr 25 12:10:11.524 - (9870.177) - <4> - Selecting service 'Discovery Channel'
1223 - Apr 25 12:10:11.623 - (9870.276) - <4> - CI_OnCAStatus(255,14,0)
1224 - Apr 25 12:10:11.623 - (9870.276) - <4> - CI_SWITCH_PRG_REPLY
1225 - Apr 25 12:10:11.623 - (9870.276) - <4> - ERR_NONE

Again this does not not necessarily mean that service will be decrypted successfully. It just means that connection to CAM is in good state.

To check that service is actually decrypted open DVB TS Monitor. Make sure that "Options / Parse A/V elementary headers" is enabled. Start the scan. In current service tab, services node locate the service selected for decryption. Verify that it looks something like below.

If you see details about A/V streams as tagged above, it means that service is successfully decrypted. That is unless the service was not encrypted at all to begin with. Note that it can take up to a minute or in rare cases even more for the header details to appear. This is because each stream in TS is scanned one by one for some time looking for header information.

Once decryption is verified you can save TS to disk. You can then view decrypted service in VLC. You can also stream service over UDP. Other clients can then pick up the decrypted service.