teletext subtitles not transparent (1 Viewer)

brickbat

Portal Member
December 22, 2006
19
0
Home Country
MediaPortal Version: 0.2.2.0
MediaPortal Skin: Default
Windows Version: XP sp2
CPU Type: AMD 3700+
HDD:
Memory:
Motherboard:
Motherboard Chipset:
Motherboard Bios:
Video Card:
Video Card Driver:
Sound Card:
Sound Card AC3:
Sound Card Driver:
1. TV Card: Hauppauge MCE 500
1. TV Card Type:
1. TV Card Driver:
2. TV Card:
2. TV Card Type:
2. TV Card Driver:
3. TV Card:
3. TV Card Type:
3. TV Card Driver:
4. TV Card:
4. TV Card Type:
4. TV Card Driver:
MPEG2 Video Codec:
MPEG2 Audio Codec:
Satelite/CableTV Provider:
HTPC Case:
Cooling:
Power Supply:
Remote:
TV:
TV - HTPC Connection:

None of the above stuff is relevant. The problem is that the teletext subtitles on the BBC are not transparent but instead show up as a big black box. I am happy to help on this further if someone will give me direction.

I looked through the code of TeletextPageRenderer.cs and I cannot see where it is getting the _transparentmode setting from. It is being set as false when it is defined and then it is only being checked with "if"s - but never set. I couldn't find anything in the decoder or the grabber code either.

In the toptextdecoder.cs I found a constant called subtitlepage but I also couldn't find where it is being used subsequently. I would have thought that if the page is a subtitle page then _transparentmode is true and I would have expected to see that kind of statement somewhere.
 

DalaNorth

Retired Team Member
  • Premium Supporter
  • December 18, 2006
    142
    1
    46
    Skellefteå, Sweden
    Home Country
    Sweden Sweden
    Just have to clear my head...

    Disclaimer: Nerdy tech stuff below. If you aren't a developer or extremely interested, don't even bother continue reading. :D

    Thought I'd do some ranting here since I don't really know what I'm talking about, but this caught my interest...

    Looking at EN 300 706 found at www.etsi.org and the code in Hamming.cs I have come to the following conclusions:

    Hamming.cs uses something called SUBTITLE_BIT_OFFSET and SUBTITLE_BIT. The offset is used to locate the correct byte in the stream and the subtitle bit (which isn't a bit, but an integer) is used as a mask to perform bitwise and with.

    If we first look at another constant, called BOXED_BIT_OFFSET and its' companion BOXED_BIT, we see that BOXED_BIT is set to 12, which we all know is 1100 in binary. I assume that this is because the byte from the teletext stream is coded in Hamming 4/8, which means that only four bits are relevant data and the other are control bits. Now, there are two reasons that the teletext should be boxed, one is that the Newsflash bit is set and the other that the subtitle bit is set. These bits are in the same byte on positions 6 and 8 respectively, which translates to 3 and 4 using Hamming 4/8 coding. Now, since the bits are transmitted LSB (least significant byte first) if either of these bits are set when performing the bitwise and with 12, the result will be something other than 0 (12, 8 or 4). Thus, the code for IsBoxed will be:

    Code:
          controlByte &= BOXED_BIT;
          return (controlByte != 0);

    And what do you know, it is...

    Now, the problem I have is with the offsets. Like I said, subtitle and newsflash are in the same byte, but the erase bit isn't. So I can't for the life of me figure out why the constants are:

    Code:
        const int ERASE_BIT_OFFSET = 5;
        const int ERASE_BIT = 8;
        
        const int SUBTITLE_BIT_OFFSET = 7;
        const int SUBTITLE_BIT = 4;
    
        const int BOXED_BIT_OFFSET = 5;
        const int BOXED_BIT = 12;

    To me, it seems that the SUBTITLE_BIT_OFFSET and BOXED_BIT_OFFSET should be the same and that the ERASE_BIT_OFFSET should be...I don't know...I guess 7 could make sense since it's two bytes from the other according to the ETSI doc.

    Anyway, if I'm onto something here, I also feel that the SUBTITLE_BIT should be 8(binary 1000) and if there were a NEWSFLASH_BIT it would be 4 (binary 100). Wait just a minute... The ERASE_BIT is defined as 8! Maybe the developer has mixed these two up? Well, no, that can't be it, since the erase bit, according to etsi is bit 8 in byte 9, the ERASE_BIT should in that case be 8 also (binary 1000). So, to summarize, if I have got anything right in my ranting above, these would be more "correct" constants:

    Code:
        const int ERASE_BIT_OFFSET = 7;
        const int ERASE_BIT = 8;
        
        const int SUBTITLE_BIT_OFFSET = 5;
        const int SUBTITLE_BIT = 8;
    
        const int BOXED_BIT_OFFSET = 5;
        const int BOXED_BIT = 12;

    Now, I don't have any way of testing this right now and I don't think that it will work, but if anyone feels like picking up where I gave up or explain where I'm thinking wrong, I would be very eager to listen!

    Anyway, :D for your time and :sorry: that I don't know what I'm talking about :rolleyes:
     

    Bram

    Portal Pro
    December 12, 2005
    851
    3
    's-Hertogenbosch
    Home Country
    Netherlands Netherlands
    Great stuff!
    But the subtitles are not synced and often stop completely. Only restarting the subtitles page make the subtitles work again for a little while (still out of sync).

    If at all possible, it would be great to have the abillity to record the subtitles to!
     

    Mr Hipp

    Retired Team Member
  • Premium Supporter
  • April 2, 2006
    1,261
    188
    56
    Malmö
    Home Country
    Sweden Sweden
    Yes, I know. I think it has to do with the fact that the teletext implementation is very slow. See if I can take a look at it sometime soon.

    At least transperancy is now working as expected for the other pages.

    MrHipp
     

    DonBogo

    Portal Pro
    July 26, 2006
    79
    2
    Home Country
    Italy Italy
    Works here !

    I've used subtitle for about one hour yesterday evening with latest SVN and seems that everything it's synchronized with no bugs.
    Maybe depends also by codec used.
    It's the TV video that seems a little slowed down (framerate) sometimes. Maybe fir this slow teletext implementation issue.

    However this it's a great start
    thanks!

    EDIT: tried another channel with higher bitrate and TV video is shuttering a lot.... subtitles stays synchronized.
     

    Bram

    Portal Pro
    December 12, 2005
    851
    3
    's-Hertogenbosch
    Home Country
    Netherlands Netherlands
    What codec are you using. In my case the subs are far from synced (default codec that comes with MP)
     

    D_law

    Portal Member
    February 1, 2006
    27
    0
    Finland
    Those teletext subs are useless because of that stuttering when text come on to display.
    One can not watch movie if it is so stuttering with teletext subs.
    So I have to watch movies without teletext subtitles...
     

    Users who are viewing this thread

    Top Bottom