mikerr
Posts: 2745
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Playing DVD (or Blu-Ray)

Mon Sep 17, 2012 10:44 am

So now we have MPEG2 (DVD) and VC1/MPEG4 (blu-ray) on the GPU,
has anyone made any progress towards DVD or bluray disk playback ?

I know dvdnav isn't in Raspi XBMC:
http://forum.xbmc.org/showthread.php?tid=140451

and XBMC DVD code is done in software anyway.

A project to start, or has anyone got anywhere yet?

omxplayer can play individual .vob files (in chunks of 1GB)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 21868
Joined: Sat Jul 30, 2011 7:41 pm

Re: Playing DVD (or Blu-Ray)

Mon Sep 17, 2012 11:11 am

Has BluRay been cracked to work on Linux (not just Raspi) yet?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

mikerr
Posts: 2745
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Mon Sep 17, 2012 1:54 pm

Yes, but not quite as comprehensively as DVD

makemkv or dumphd can stream direct from the disk into vlc or mplayer.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

mikerr
Posts: 2745
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Tue Sep 18, 2012 3:13 pm

Decided to move forward:

Code: Select all

wget http://www.videolan.org/pub/libdvdcss/1.2.12/libdvdcss-1.2.12.tar.bz2
bzip2 libdvdcss-1.2.12.tar.bz2
tar -xvf libdvdcss-1.2.12.tar

cd libdvdcss-1.2.12
./configure
make
make install
(quick compile, only took a minute)

Copy over the libs

Code: Select all

sudo cp /usr/local/lib/libdvdcss* /lib

Code: Select all

mplayer dvd://1 
Success !

of a sort.. it plays but mplayer is not GPU accelerated, so 8 fps ;)

You can dump the whole 4GB with

Code: Select all

mplayer dvd://1 -dumpstream -dumpfile dvd.mpg
OMXplayer is GPU accelerated mpeg2 (if you have a licence) but it won't work directly with that file (or stream...)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

mikerr
Posts: 2745
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Tue Sep 18, 2012 3:44 pm

OMXplayer DOES work fine on the resulting file - I hadn't got the licence on that SD card

- fixed and all working full frame rate now ;)

Next up is to get it working without needing to store the file on disk first (streaming from disk) !
Android app - Raspi Card Imager - download and image SD cards - No PC required !

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 21868
Joined: Sat Jul 30, 2011 7:41 pm

Re: Playing DVD (or Blu-Ray)

Tue Sep 18, 2012 4:29 pm

Nice work so far!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

ghans
Posts: 7849
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Playing DVD (or Blu-Ray)

Tue Sep 18, 2012 4:58 pm

Is that a "real" external ODD ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

mikerr
Posts: 2745
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Tue Sep 18, 2012 5:22 pm

ghans wrote:Is that a "real" external ODD ?
Yep a physical DVD drive connected via USB.
Real live encrypted DVD disk too ;)

Got it streaming direct from DVD disk working now

Using a named pipe:

Code: Select all

mkfifo  /tmp/dvdpipe
mplayer dvd://1 -dumpstream -dumpfile /tmp/dvdpipe &
omxplayer -r /tmp/dvdpipe 
Though I think the exact commandlines could do with work, as I was bringing them into and out of background (ctrl-z ...bg...fg)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

ghans
Posts: 7849
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Playing DVD (or Blu-Ray)

Tue Sep 18, 2012 5:49 pm

Nice !

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2841
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Tue Sep 18, 2012 6:54 pm

mikerr wrote:omxplayer can play individual .vob files (in chunks of 1GB)
I've got as far as that, but only for unencrypted stuff I recorded myself.

http://raspi.tv/2012/play-a-dvd-on-rasp ... peg2-codec

You can also use Openelec to do the same thing, but it doesn't seem to come out full screen (omxplayer needs the -r to make it full screen - I think you told me that last week didn't you Mike? :lol: )

Now I've read the rest of the thread I see you've already got further than that. Well done. :D
Alex Eames RasPi.TV, RasP.iO

mikerr
Posts: 2745
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Tue Sep 18, 2012 8:14 pm

Ok, I've done some more testing, and it seems mplayer needed a bit more silencing to run in the background,
so I've included a better sequence of commands below.


To recap - first get the libdvdcss compiled on your Pi:

Code: Select all

wget http://www.videolan.org/pub/libdvdcss/1.2.12/libdvdcss-1.2.12.tar.bz2
bzip2 libdvdcss-1.2.12.tar.bz2
tar -xvf libdvdcss-1.2.12.tar

cd libdvdcss-1.2.12
./configure
make
make install
(quick compile, only took a minute)

Copy over the libs

Code: Select all

sudo cp /usr/local/lib/libdvdcss* /lib
That's the decrypting library installed, now here's how to play DVD direct from the DVD drive:

Code: Select all

mkfifo  /tmp/dvdpipe
mplayer dvd://1 -dumpstream -dumpfile /tmp/dvdpipe 1>/dev/null 2>/dev/null </dev/null &
omxplayer -r /tmp/dvdpipe 
Normal OMXplayer keys to control
http://www.raspberrypi.org/phpBB3/viewt ... 63&t=13328

Note: this is streaming direct from the DVD disk, no SD space is required.

Enjoy !

[Now moving to getting bluray to work ...]
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2841
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Tue Sep 18, 2012 8:30 pm

Hi Mike.

tried your first set of instructions, but errored out on the make install. Only worked with sudo.

Then tried to install mplayer and that gave lots of errors. It installed, but didn't work.
I'll try it on a clean install of the latest Raspbian tomorrow. Perhaps it's better to have installed mplayer first?
Alex Eames RasPi.TV, RasP.iO

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2841
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Tue Sep 18, 2012 10:08 pm

Couldn't wait until tomorrow. Tried it on a clean install.
Everything installed beautifully.

But now the darned OS can't see my DVD drive when it all automounted perfectly before. (although it spotted it on boot - I saw it) GRRRRRRRRRRRRRRR. Busy day tomorrow as well. :lol:
Alex Eames RasPi.TV, RasP.iO

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2841
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Wed Sep 19, 2012 4:46 pm

I got your streaming technique working on an unencrypted dvd this morning Mike. It looks like the latest Raspbian with updates/upgrades sees my USB DVD drive differently. It doesn't appear in df -h as a mounted drive, or in lsusb. I've also got occasional keyboard repeaaaaaaats/dropots :lol: again - even on the Pi with shorted polyfuses. :o

I'll have another go with (maybe different) encrypted ones this evening. I've only tried BBC ones so far. Maybe a different one will work? Really want to get this working - not because I need it, but because it's annoying me that it ought to work. :lol:

[Update]
Well blow me down. I just tried a different commercial disk and it worked a treat. The only other thing I did differently was send the mplayer and omxplayer commands by ssh because I couldn't be bothered to type them out with a sticky keyboard :lol:

Mike, you're a genius :idea: 8-)

[2nd Update]
Just retried one of my BBC DVDs (The Blue Planet) sending the mplayer and omxplayer commands via ssh, and guess what? That works too. Goodness knows why, but who cares? IT WORKS :lol:
Last edited by alexeames on Wed Sep 19, 2012 5:09 pm, edited 1 time in total.
Alex Eames RasPi.TV, RasP.iO

mikerr
Posts: 2745
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Wed Sep 19, 2012 5:06 pm

Great, glad to hear you got it working - and it verifies my instructions are correct ;)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2841
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Wed Sep 19, 2012 5:22 pm

mikerr wrote:Great, glad to hear you got it working - and it verifies my instructions are correct ;)
They're bang on except for the sudo and the bunzip.

I notice the output is a bit "interlacey", but I don't care, that could just be the upscaling of 720x576 for HD TV.

I do have issues with omxplayer controls not working very well and crashing on quit, but that's not a DVD issue. Just glad to get it working on encrypted disks at all.
Alex Eames RasPi.TV, RasP.iO

mikerr
Posts: 2745
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Wed Sep 19, 2012 6:34 pm

Yes, omxplayer can pause (with p or space) fine, but seek controls are not too good,
due to the fact that mplayer is just blindly dumping the movie sequentially in the background.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2841
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Wed Sep 19, 2012 7:15 pm

I've blogged the full sequence of how I got this working based on your instructions Mike, with a link back to this thread, so people can stay abreast of developments.

http://raspi.tv/2012/watch-encrypted-dv ... -omxplayer

Hopefully the instructions are complete and reasonably "friendly".

Still got no idea why it works via ssh but not right there on the console :?:
Alex Eames RasPi.TV, RasP.iO

mikerr
Posts: 2745
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Wed Sep 19, 2012 7:42 pm

Ahem... I now have it working in XBMC GUI :) :)

Yes, I can play commercial DVDs on XBMC entirely with my MCE remote, no SSH or keyboard needed !
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2841
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Wed Sep 19, 2012 7:57 pm

mikerr wrote:Ahem... I now have it working in XBMC GUI :) :)

Yes, I can play commercial DVDs on XBMC entirely with my MCE remote, no SSH or keyboard needed !
Hark at Mr smug. :lol: Great work Mike! :!:

Which version of XBMC? Have you built it into Raspbian or used one of the distros?
Alex Eames RasPi.TV, RasP.iO

mikerr
Posts: 2745
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Wed Sep 19, 2012 8:24 pm

Nope, I didn't recompile XMBC, just a nasty hack:

compile libdvdcss
install mplayer
mkdir /dvd
run infinte script on startup (call it from /etc/rc.local)

Code: Select all

mkfifo /dvd/dvd.mpg
while :
do
        mplayer dvd://1 -dumpstream -dumpfile /dvd/dvd.mpg 1>null 2>null
        sleep 5
done
Add /dvd as a video folder in XBMC

When you want to play a dvd, play the dvd.mpg file (which is really a named pipe)


The script running in the background will take care of dvd changes.
Last edited by mikerr on Wed Sep 19, 2012 8:47 pm, edited 1 time in total.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2841
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Wed Sep 19, 2012 8:46 pm

It's not a nasty hack, it's tricking the bleedin' thing into doing what you want it to. :lol:

Where did you learn about this stuff Mike?
Alex Eames RasPi.TV, RasP.iO

mikerr
Posts: 2745
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Wed Sep 19, 2012 9:10 pm

It's very similar to TiVo hacking that I used to do a few years back
- I've actually had a few PMs from people recognizing my username on here - hello to all the TiVo S1'ers !
Android app - Raspi Card Imager - download and image SD cards - No PC required !

mikerr
Posts: 2745
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Playing DVD (or Blu-Ray)

Thu Sep 20, 2012 12:23 pm

I started from scratch with a fresh RaspBMC image to check steps,
and made a new thread with instructions on how to do it in RaspBMC:
http://www.raspberrypi.org/phpBB3/viewt ... 35&t=17877
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
Salamander
Posts: 49
Joined: Fri Mar 30, 2012 1:41 pm

Re: Playing DVD (or Blu-Ray)

Mon Sep 24, 2012 7:34 am

Wonder if this technique could also be used (in XBMC GUI) to play streams using codecs not supported by OMXplayer/RPi, like flash (or MPEG2 without a license). That would be a rocket jump from current situation and would allow anybody to play any media. Then one could opt for a license when hardware acceleration is really needed.

Return to “Media centres”