[mythtv] [PATCH] Enable recording of encrypted channels without decrypting them first.

James Courtier-Dutton james.dutton at gmail.com
Fri Jul 9 12:37:10 UTC 2010


On 9 July 2010 12:47, Janne Grunau <janne-mythtv at grunau.be> wrote:
> On Fri, Jul 09, 2010 at 10:09:01AM +0100, Stuart Auchterlonie wrote:
>> On 09/07/2010 01:42, James Courtier-Dutton wrote:
>> > Hi,
>> >
>> > Here is a patch that lets one record encrypted channels without
>> > decrypting them first.
>> > It also includes the ECM PID so that the recording can be later
>> > decrypted at playback time.
>> > The main advantage of this is that one can then record as many
>> > encrypted channels as one has tuners, and then later, using the
>> > correct smart card, decrypt them while playing them back.
>> > In this way, you only have to decrypt one channel at a time.
>> >
>> > I would be interested to find out if this patch breaks anything.
>> >
>> > Kind Regards
>> >
>>
>> I may be missing something. but what is the point of creating
>> ProcessEncTSPacket ???
>>
>> An encrypted TS packet isn't any different from a normal TS packet
>> apart from the data portion being encrypted, as such the ProcessTSPacket
>> could be used instead?
>
> There is one important difference: the payload is encrypted.
> ProcessTSPacket() looks at the payload for keyframes.
>
> I haven't look at the patch in detail, there is nothing fundamentally
> wrong with it just one detail. Not writing scrambled TS packets is a
> good idea if there is no mean of unscramble it later and should be
> preserved.
>

I have a method to unscramble the packet later.
As I explained, one decrypts it during playback. (I have code to do
it, It is just not ready to be patched into mythfrontend yet.)

Now, the question is probably, how does one tell myth whether one has
a means to unscramble it later.
I suggest one lets the user decide. The recording is only kept if the
user presses the "r" (record) button, and they will soon learn that
channel X is not playable and just not bother pressing "r" next time.
We could modify the current mythfrontend to display a big "key" symbol
instead of any video if it is asked to play encrypted video TS
packets.

Let me take an example. In the UK, pay tv has an "anytime" feature,
whereby the content provider delivers content to the set top box ahead
of time. It is stored in encrypted form. If you wish to view it, an
option pops up to pay a one off charge to view the content. The
content provider then sends a message to your smart card to enable it
to decrypt the content. You then can watch it, pause it, rewind it,
etc.
This only works if you have captured the encrypted content ahead of
time. My patch enables this sort of functionality in myth.


More information about the mythtv-dev mailing list