Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

Playback of encrypted dvd iso images from storage group

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


lvr at softsystem

Nov 27, 2011, 4:52 AM

Post #1 of 9 (2154 views)
Permalink
Playback of encrypted dvd iso images from storage group

Hi,

I use my Myth box to, amongst other things, play and archive DVDs. For
this reason, back in May I presented a patch to reinstate the ripping of
DVD ISO images and the myth transcode daemon:
http://www.mythtv.org/pipermail/mythtv-dev/2011-May/070839.html

This had limited appeal, partly because the ripped images are encrypted
and thus can't be played back from a storage group using the myth wire
protocol.

I had a flash of inspiration a few weeks ago and realised that it would
be possible to read the raw iso image blocks on the BE using
libdvdreader which would then use libdvdcss, if available, and send them
to the FE in decrypted form.

For iso images I replaced the current FileRingBuffer with a class that
uses libdvdread to decrypt the raw blocks. The real heart of the change
is in creating a list of blocks that need decrypting and then in
safe_read() lookup the blocks requested in that list and decrypt them if
necessary. The lookup is necessary since, if a block is unencrypted
like ifo files, the decryption operation corrupts the data.

I've been using the patch for a couple of weeks now on fixes/0.24.1. So
if anyone else would like to try the patch for current git fixes/0.24.1:
http://www.softsystem.co.uk/download/mythtv/fixes024-dvd-iso-image.patch
or for current git master:
http://www.softsystem.co.uk/download/mythtv/master-dvd-iso-image.patch

I'm well aware that several devs have publicly criticised my
contributions (NIH is a wonderful virtue), and that anything to do with
media copying, ripping and decryption is taboo, so it's pointless
submitting these patches to Trac.

If you're using my mythbuild.sh script to build or cross compile MythTV
from sources on Linux or Windows (www.softsystem.co.uk/mythtv/index.htm)
then these patches, together with the patch to add DVD ripping, are
included in the latest patch set which is downloaded automatically by
mythbuild.sh. NB if you have an existing mythpatches-0.24 folder then
delete that first to get an update.

Comments and suggestions welcome.

--
Lawrence
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


tylernt at gmail

Nov 29, 2011, 8:24 AM

Post #2 of 9 (2096 views)
Permalink
Re: Playback of encrypted dvd iso images from storage group [In reply to]

> I'm well aware that several devs have publicly criticised my
> contributions (NIH is a wonderful virtue), and that anything to do with
> media copying, ripping and decryption is taboo, so it's pointless
> submitting these patches to Trac.

I read your thread on -dev and didn't see anyone discouraging your
patches on the basis of "piracy!" (though maybe you got some off-list
emails that did). Playback of encrypted DVDs seems to have at least
the tacit approval of the devs or else the option on the FE menu would
refuse to do it. And so far as I know (IANAL), making backups of your
DVDs is allowed by copyright laws and storing them encrypted should
not break the DMCA either.

Rather, the main objection to your earlier patch seemed to be the lack
of SG support -- and now that you have that, I think your patches
would be welcomed.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


lvr at softsystem

Nov 29, 2011, 10:29 AM

Post #3 of 9 (2089 views)
Permalink
Re: Playback of encrypted dvd iso images from storage group [In reply to]

On Tue, 2011-11-29 at 09:24 -0700, Tyler T wrote:
> > I'm well aware that several devs have publicly criticised my
> > contributions (NIH is a wonderful virtue), and that anything to do with
> > media copying, ripping and decryption is taboo, so it's pointless
> > submitting these patches to Trac.
>
> I read your thread on -dev and didn't see anyone discouraging your
> patches on the basis of "piracy!" (though maybe you got some off-list
> emails that did).

No direct, in the open, criticism about 'piracy' but when it comes to
copying or ripping, just a great deal of inertia. The criticism seems
to be that my patches are just too big. I sense sensitive toes.

> Playback of encrypted DVDs seems to have at least
> the tacit approval of the devs or else the option on the FE menu would
> refuse to do it. And so far as I know (IANAL), making backups of your
> DVDs is allowed by copyright laws and storing them encrypted should
> not break the DMCA either.
>
> Rather, the main objection to your earlier patch seemed to be the lack
> of SG support -- and now that you have that, I think your patches
> would be welcomed.

I don't believe so. I submitted patches to MythMusic to replace the
obsolete libcdaudio with libcdio and hence allow CD ripping, playback
and cddb lookup on Win32 systems. These were submitted over a year ago
http://code.mythtv.org/trac/ticket/9362 and have been ignored. Most
likely they're useless now as the code has moved on considerably.

The DVD ripping patches will stay on my website. If someone wants to
work them into master I'll give them any advice that they request. But
I don't expect to hear from anyone.

There are also a number of patches that add BBC iPlayer functionality
that also look like they're going the same way.

--
Lawrence
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


raptorjr08 at gmail

Nov 30, 2011, 1:08 PM

Post #4 of 9 (2084 views)
Permalink
Re: Playback of encrypted dvd iso images from storage group [In reply to]

On Sun, Nov 27, 2011 at 1:52 PM, Lawrence Rust <lvr [at] softsystem> wrote:

> Hi,
>
> I use my Myth box to, amongst other things, play and archive DVDs. For
> this reason, back in May I presented a patch to reinstate the ripping of
> DVD ISO images and the myth transcode daemon:
> http://www.mythtv.org/pipermail/mythtv-dev/2011-May/070839.html
>
> This had limited appeal, partly because the ripped images are encrypted
> and thus can't be played back from a storage group using the myth wire
> protocol.
>
> I had a flash of inspiration a few weeks ago and realised that it would
> be possible to read the raw iso image blocks on the BE using
> libdvdreader which would then use libdvdcss, if available, and send them
> to the FE in decrypted form.
>
> For iso images I replaced the current FileRingBuffer with a class that
> uses libdvdread to decrypt the raw blocks. The real heart of the change
> is in creating a list of blocks that need decrypting and then in
> safe_read() lookup the blocks requested in that list and decrypt them if
> necessary. The lookup is necessary since, if a block is unencrypted
> like ifo files, the decryption operation corrupts the data.
>
> I've been using the patch for a couple of weeks now on fixes/0.24.1. So
> if anyone else would like to try the patch for current git fixes/0.24.1:
> http://www.softsystem.co.uk/download/mythtv/fixes024-dvd-iso-image.patch
> or for current git master:
> http://www.softsystem.co.uk/download/mythtv/master-dvd-iso-image.patch
>

Nice work. I hope it gets included. I will try this as soon as i get the
time. Have been missing the possibility to use my DVD isos since i moved to
SGs.

/Stefan


dave at daveoxley

Apr 26, 2012, 10:57 PM

Post #5 of 9 (1925 views)
Permalink
Re: Playback of encrypted dvd iso images from storage group [In reply to]

Hi Lawrence,

Has any of this been merged into 0.25? I'm specifically interested in
the playback of encrypted iso's from storage groups as I don't mind
ripping DVD's externally. Having said that I did used to use MythTV DVD
ripping functionality a lot in previous versions.

Cheers,
Dave.

On 30/11/11 05:29, Lawrence Rust wrote:
> On Tue, 2011-11-29 at 09:24 -0700, Tyler T wrote:
>>> I'm well aware that several devs have publicly criticised my
>>> contributions (NIH is a wonderful virtue), and that anything to do with
>>> media copying, ripping and decryption is taboo, so it's pointless
>>> submitting these patches to Trac.
>> I read your thread on -dev and didn't see anyone discouraging your
>> patches on the basis of "piracy!" (though maybe you got some off-list
>> emails that did).
> No direct, in the open, criticism about 'piracy' but when it comes to
> copying or ripping, just a great deal of inertia. The criticism seems
> to be that my patches are just too big. I sense sensitive toes.
>
>> Playback of encrypted DVDs seems to have at least
>> the tacit approval of the devs or else the option on the FE menu would
>> refuse to do it. And so far as I know (IANAL), making backups of your
>> DVDs is allowed by copyright laws and storing them encrypted should
>> not break the DMCA either.
>>
>> Rather, the main objection to your earlier patch seemed to be the lack
>> of SG support -- and now that you have that, I think your patches
>> would be welcomed.
> I don't believe so. I submitted patches to MythMusic to replace the
> obsolete libcdaudio with libcdio and hence allow CD ripping, playback
> and cddb lookup on Win32 systems. These were submitted over a year ago
> http://code.mythtv.org/trac/ticket/9362 and have been ignored. Most
> likely they're useless now as the code has moved on considerably.
>
> The DVD ripping patches will stay on my website. If someone wants to
> work them into master I'll give them any advice that they request. But
> I don't expect to hear from anyone.
>
> There are also a number of patches that add BBC iPlayer functionality
> that also look like they're going the same way.
>

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


lvr at softsystem

Apr 27, 2012, 3:32 AM

Post #6 of 9 (1936 views)
Permalink
Re: Playback of encrypted dvd iso images from storage group [In reply to]

On Fri, 2012-04-27 at 15:57 +1000, Dave Oxley wrote:
> Has any of this been merged into 0.25?

Unfortunately not. Mark Kendall was looking at it but now that he's
left I think that the patches have been left dangling.

> I'm specifically interested in
> the playback of encrypted iso's from storage groups as I don't mind
> ripping DVD's externally. Having said that I did used to use MythTV DVD
> ripping functionality a lot in previous versions.

If you are interested, I maintain an archive of patches here:
http://www.softsystem.co.uk/download/mythtv/mythbuild-CURRENT.zip

The iso playback patch (for fixes/0.25) is here:
mythpatches-0.24/mythtv-0.25//0043-libmythtv-Play-encrypted-dvd-s-and-iso-images-from-s.patch

and this is the patch that added back DVD ripping:
mythpatches-0.24/mythtv-0.25//0034-Mythvideo-restore-DVD-ripping.patch

This patch enables mytharchive to burn the ripped iso image:
mythpatches-0.24/mythtv-0.25/0044-mytharchive-Add-capability-to-burn-a-user-selected-i.patch

This patch adds support for storage groups to mytharchive:
mythpatches-0.24/mythtv-0.25/0070-mytharchive-Add-support-for-Storage-Groups.patch

The last patch allows mytharchive to be run on a remote frontend and
build a DVD using material from any BE.

In the archive there are versions of the patches against fixes/0.24,
fixes/0.25 and master from today's git repo. I try to update the
patches weekly or better.

HTH

-- Lawrence


>
> Cheers,
> Dave.
>
> On 30/11/11 05:29, Lawrence Rust wrote:
> > On Tue, 2011-11-29 at 09:24 -0700, Tyler T wrote:
> >>> I'm well aware that several devs have publicly criticised my
> >>> contributions (NIH is a wonderful virtue), and that anything to do with
> >>> media copying, ripping and decryption is taboo, so it's pointless
> >>> submitting these patches to Trac.
> >> I read your thread on -dev and didn't see anyone discouraging your
> >> patches on the basis of "piracy!" (though maybe you got some off-list
> >> emails that did).
> > No direct, in the open, criticism about 'piracy' but when it comes to
> > copying or ripping, just a great deal of inertia. The criticism seems
> > to be that my patches are just too big. I sense sensitive toes.
> >
> >> Playback of encrypted DVDs seems to have at least
> >> the tacit approval of the devs or else the option on the FE menu would
> >> refuse to do it. And so far as I know (IANAL), making backups of your
> >> DVDs is allowed by copyright laws and storing them encrypted should
> >> not break the DMCA either.
> >>
> >> Rather, the main objection to your earlier patch seemed to be the lack
> >> of SG support -- and now that you have that, I think your patches
> >> would be welcomed.
> > I don't believe so. I submitted patches to MythMusic to replace the
> > obsolete libcdaudio with libcdio and hence allow CD ripping, playback
> > and cddb lookup on Win32 systems. These were submitted over a year ago
> > http://code.mythtv.org/trac/ticket/9362 and have been ignored. Most
> > likely they're useless now as the code has moved on considerably.
> >
> > The DVD ripping patches will stay on my website. If someone wants to
> > work them into master I'll give them any advice that they request. But
> > I don't expect to hear from anyone.
> >
> > There are also a number of patches that add BBC iPlayer functionality
> > that also look like they're going the same way.
> >
>


_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


peterpf_mitchell at yahoo

Jul 11, 2012, 2:52 PM

Post #7 of 9 (1757 views)
Permalink
Re: Playback of encrypted dvd iso images from storage group [In reply to]

> -----Original Message-----
> From: mythtv-users-bounces [at] mythtv [mailto:mythtv-users-
> bounces [at] mythtv] On Behalf Of Lawrence Rust
> Sent: 27 April 2012 11:33
> To: Dave Oxley
> Cc: Discussion about MythTV
> Subject: Re: [mythtv-users] Playback of encrypted dvd iso images from
> storage group
>
> On Fri, 2012-04-27 at 15:57 +1000, Dave Oxley wrote:
> > Has any of this been merged into 0.25?
>
> Unfortunately not. Mark Kendall was looking at it but now that he's
> left I think that the patches have been left dangling.
>
> > I'm specifically interested in
> > the playback of encrypted iso's from storage groups as I don't mind
> > ripping DVD's externally. Having said that I did used to use MythTV DVD
> > ripping functionality a lot in previous versions.
>
> If you are interested, I maintain an archive of patches here:
> http://www.softsystem.co.uk/download/mythtv/mythbuild-CURRENT.zip
>
> The iso playback patch (for fixes/0.25) is here:
> mythpatches-0.24/mythtv-0.25//0043-libmythtv-Play-encrypted-dvd-s-and-iso-
> images-from-s.patch
>
> and this is the patch that added back DVD ripping:
> mythpatches-0.24/mythtv-0.25//0034-Mythvideo-restore-DVD-ripping.patch
>
> This patch enables mytharchive to burn the ripped iso image:
> mythpatches-0.24/mythtv-0.25/0044-mytharchive-Add-capability-to-burn-a-
> user-selected-i.patch
>
> This patch adds support for storage groups to mytharchive:
> mythpatches-0.24/mythtv-0.25/0070-mytharchive-Add-support-for-Storage-
> Groups.patch
>
> The last patch allows mytharchive to be run on a remote frontend and
> build a DVD using material from any BE.
>
> In the archive there are versions of the patches against fixes/0.24,
> fixes/0.25 and master from today's git repo. I try to update the
> patches weekly or better.
>
> HTH
>
> -- Lawrence
>

This is a great set of patches that has restored my ability to playback
encrypted DVD iso images sadly lost when I upgraded from 0.21 to 0.25.1
fixes and switched my video collection over to use storage groups without
realizing the ramifications. Thanks for maintaining this Lawrence!

There is however a minor bug in
mythpatches-0.24/mythtv-0.25//0034-Mythvideo-restore-DVD-ripping.patch.

With the patch installed I found that intermittently the playback of any iso
image regardless of being encrypted or not would fail. Indeed the same image
might play one time and then fail to play subsequently due to seek errors
when reading the iso image.

Fortunately the issue is easy to resolve. In class dvdstream.cpp variable
m_start is not being initialized at instantiation by the constructor which
means it is initially set to whatever happened to be on the heap when the
class is instantiated. As this variable is being used as an offset for seeks
within the iso image this quickly leads to problems unless you get lucky and
m_start happened to be randomly set to zero.

To fix simply change the constructor to set m_start to zero. If this is done
then this patch works everytime - well for me at least!
As an example the DVDStream constructor could be changed from this:

DVDStream::DVDStream(const QString& filename)
: RingBuffer(kRingBuffer_File), m_reader(0), m_pos(0), m_title(-1)
{
OpenFile(filename);
}

To this:
DVDStream::DVDStream(const QString& filename)
: RingBuffer(kRingBuffer_File), m_reader(0), m_pos(0), m_title(-1),
m_start(0)
{
OpenFile(filename);
}

I noticed that the trunk version of the patch appears to have the same
issue.

Cheers

Peter

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


lvr at softsystem

Jul 12, 2012, 12:11 AM

Post #8 of 9 (1739 views)
Permalink
Re: Playback of encrypted dvd iso images from storage group [In reply to]

On Wed, 2012-07-11 at 22:52 +0100, Peter Mitchell wrote:
[snip]
> This is a great set of patches that has restored my ability to playback
> encrypted DVD iso images sadly lost when I upgraded from 0.21 to 0.25.1
> fixes and switched my video collection over to use storage groups without
> realizing the ramifications. Thanks for maintaining this Lawrence!
>
> There is however a minor bug in
> mythpatches-0.24/mythtv-0.25//0034-Mythvideo-restore-DVD-ripping.patch.

You must mean
mythtv-0.25/0043-libmythtv-Play-encrypted-dvd-s-and-iso-images-from-s.patch

> With the patch installed I found that intermittently the playback of any iso
> image regardless of being encrypted or not would fail. Indeed the same image
> might play one time and then fail to play subsequently due to seek errors
> when reading the iso image.
>
> Fortunately the issue is easy to resolve. In class dvdstream.cpp variable
> m_start is not being initialized at instantiation by the constructor which
> means it is initially set to whatever happened to be on the heap when the
> class is instantiated. As this variable is being used as an offset for seeks
> within the iso image this quickly leads to problems unless you get lucky and
> m_start happened to be randomly set to zero.
>
> To fix simply change the constructor to set m_start to zero. If this is done
> then this patch works everytime - well for me at least!
> As an example the DVDStream constructor could be changed from this:
>
> DVDStream::DVDStream(const QString& filename)
> : RingBuffer(kRingBuffer_File), m_reader(0), m_pos(0), m_title(-1)
> {
> OpenFile(filename);
> }
>
> To this:
> DVDStream::DVDStream(const QString& filename)
> : RingBuffer(kRingBuffer_File), m_reader(0), m_pos(0), m_title(-1),
> m_start(0)
> {
> OpenFile(filename);
> }
>

Well spotted and thanks ever so much for taking the time to test and
find a fix. Much appreciated.

That will teach me to double check my patches with valgrind before
posting them. It's a pity that gcc doesn't pick this out with a warning
for an uninitialised variable - must look into that.

> I noticed that the trunk version of the patch appears to have the same
> issue.

I'll fix that too.

Hopefully sometime soon these patches will find their way into git
master.

--
Lawrence
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


spikeygg.mythbox at gmail

Aug 24, 2012, 6:10 PM

Post #9 of 9 (1595 views)
Permalink
Re: Playback of encrypted dvd iso images from storage group [In reply to]

On Thu, Jul 12, 2012 at 1:11 AM, Lawrence Rust <lvr [at] softsystem> wrote:

> On Wed, 2012-07-11 at 22:52 +0100, Peter Mitchell wrote:
> [snip]
> > This is a great set of patches that has restored my ability to playback
> > encrypted DVD iso images sadly lost when I upgraded from 0.21 to 0.25.1
> > fixes and switched my video collection over to use storage groups without
> > realizing the ramifications. Thanks for maintaining this Lawrence!
> >
> > There is however a minor bug in
> > mythpatches-0.24/mythtv-0.25//0034-Mythvideo-restore-DVD-ripping.patch.
>
> You must mean
> mythtv-0.25/0043-libmythtv-Play-encrypted-dvd-s-and-iso-images-from-s.patch
>
> > With the patch installed I found that intermittently the playback of any
> iso
> > image regardless of being encrypted or not would fail. Indeed the same
> image
> > might play one time and then fail to play subsequently due to seek errors
> > when reading the iso image.
> >
> > Fortunately the issue is easy to resolve. In class dvdstream.cpp variable
> > m_start is not being initialized at instantiation by the constructor
> which
> > means it is initially set to whatever happened to be on the heap when the
> > class is instantiated. As this variable is being used as an offset for
> seeks
> > within the iso image this quickly leads to problems unless you get lucky
> and
> > m_start happened to be randomly set to zero.
> >
> > To fix simply change the constructor to set m_start to zero. If this is
> done
> > then this patch works everytime - well for me at least!
> > As an example the DVDStream constructor could be changed from this:
> >
> > DVDStream::DVDStream(const QString& filename)
> > : RingBuffer(kRingBuffer_File), m_reader(0), m_pos(0), m_title(-1)
> > {
> > OpenFile(filename);
> > }
> >
> > To this:
> > DVDStream::DVDStream(const QString& filename)
> > : RingBuffer(kRingBuffer_File), m_reader(0), m_pos(0), m_title(-1),
> > m_start(0)
> > {
> > OpenFile(filename);
> > }
> >
>
> Well spotted and thanks ever so much for taking the time to test and
> find a fix. Much appreciated.
>
> That will teach me to double check my patches with valgrind before
> posting them. It's a pity that gcc doesn't pick this out with a warning
> for an uninitialised variable - must look into that.
>
> > I noticed that the trunk version of the patch appears to have the same
> > issue.
>
> I'll fix that too.
>
> Hopefully sometime soon these patches will find their way into git
> master.
>
>
Did these patches ever make it into git master? I have libdvdcss2 installed
(along with all the necessary dvdnav and dvdread pkgs) and it's not getting
picked up by mythvideo when I play an ISO file. I see these messages from
the frontend:
libdvdnav: Using dvdnav version svnR1215
libdvdread: Encrypted DVD support unavailable.

When I use mplayer to play the same file before the video starts playing it
automatically launches libdvdcss and I see it create files inside
~/.dvdcss.

Is there some way to have mythtv/mythvideo do this? Lawrence's links are
broken, anyone have an updated version?

Thanks,
-Greg

MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.