Re: TV stream and scrambled channels



"David Olsson" <david.olsson@xxxxxxxxx> schrieb im Newsbeitrag

I've writing an application which is able to communicate with my program
card/smart card provided to me by my DVB TV distributor so that I can
subscribe to Pay TV channels. This application is able to query the
smart card for key to descramble the TV channels I subscribe to.

If I understand you correctly, you're communication with your smart-card by
some kind of SC-Interface _other_ than a CA-Module?

I do
however have no connection between my "software CA-module" (as one might
call it) and the TV-tuner (its a DVB-T tuner). The DVB-T tuner I have
come with BDA driver so it should work fine with DirectShow. My question
is however this; is it possible to access the scrambling information
sent in the mpeg2 transport stream's PES packets through the DirectShow
API somehow so I can send it to the smart card?

It certainly is possible, e.g. using the sample-grabber or a custom
transform-filter. You would have to insert it after your BDA-capture-filter
(not the bda-tuner), or possibly behind the MPEG2-Demux-filter, but
certainly before any MPEG2/Audio-Decoder.

This way you can access the raw TS (including all information
scrambling-information ca-sections, scrambled packets) or only specific PIDs
(if you insert your filter behind the demux).

You will however have to "read" any information you need out of the "raw"
ts-packets - MS-Digital-TV infrastructure knows nothing about
ca-systems/scrambling.

And is it futhermore
possible to feed the descramble key returned by the smart card back to
the mpeg2 decoder so that the scrambled channels gets decoded correctly?

No. In a regular (and possibly the only legal) scenario the CA-Module will
do all that - talking to the smart-card, reading CA-information, determining
the correct descrambling-key and descrambling the affected packets (or at
least telling the demux the CW for descrambling packets - not sure who
actually does the XORing) - you are not expected to get access to any
descrambling CWs anywhere along the TS-data-path.

But definitely neither the ms-mpeg2 demux nor _any_ mpeg2-decoder know about
descrambling any data/pes-packets. They simply expect correct data at their
input-pins. (however the demuxer is able to pass through scrambled packets,
since it doesn't actually care about the embedded data). So with DVB-cards
supporting CI-slots the driver will ensure that the data that gets out of
the BDA-capture-filter is already processed correctly (by passing though the
CAM beforehand).

So for your "software CI" to work you will also have to do the actual
descrambling yourself (which is basically nothing but a simple
xor-operation) - there are some dvb-s programs out there that implement an
interface for software-cams - you could have a look at their source-codes
(basically they take each 188byte-packet coming in with the TS, examine it
if it has to be processed/process it and then pass on the modified packet)
....

Be aware that legally you're on very thin ice (if not to say that you're
already under water;)
--
Peter Feldbaumer
p dot feldbaumer at utanet dot at


.