Hairyloon
Posts: 96
Joined: Wed Jan 20, 2016 10:42 am

DVD Playback on RPi4

Tue Sep 27, 2022 9:36 am

I read that the Pi4 cannot play DVD videos. Is that right? Is there a sensible reason why not, and is there any way around it?
Always code as if the chap who ends up maintaining your code will be a violent psychopath who knows where you live.

gordon77
Posts: 6885
Joined: Sun Aug 05, 2012 3:12 pm

Re: DVD Playback on RPi4

Tue Sep 27, 2022 10:15 am

This is a couple of years old but may still be valid...

https://youtu.be/GD2RlAg4DCI

tvjon
Posts: 839
Joined: Mon Jan 07, 2013 9:11 am

Re: DVD Playback on RPi4

Tue Sep 27, 2022 10:37 am

Hairyloon wrote:
Tue Sep 27, 2022 9:36 am
I read that the Pi4 cannot play DVD videos. Is that right?...
Where did you read that?

I've just plugged in my dvd reader/writer into this RPi4, & typed:

$ mplayer dvd://

and here's a low resolution screenshot of the result
Attachments
mp-som2.jpg
mp-som2.jpg (102.44 KiB) Viewed 1663 times

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6231
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: DVD Playback on RPi4

Tue Sep 27, 2022 11:18 am

I've played physical DVDs (e.g. The Matrix) using kodi installed on RPiOS Bullseye and with LibreELEC on a Pi4 recently.

On RPiOS as well as installing kodi you want to run "sudo apt install libdvdcss2"
(which I think will then ask you to run "sudo dpkg-reconfigure libdvd-pkg").

LibreELEC should just work out of the box.

cleverca22
Posts: 6828
Joined: Sat Aug 18, 2012 2:33 pm

Re: DVD Playback on RPi4

Tue Sep 27, 2022 12:55 pm

Hairyloon wrote:
Tue Sep 27, 2022 9:36 am
I read that the Pi4 cannot play DVD videos. Is that right? Is there a sensible reason why not, and is there any way around it?
tvjon wrote:
Tue Sep 27, 2022 10:37 am
Where did you read that?
the only thing i can think of, is that mpeg2 hw accel is disabled on the pi4
but the cpu is plenty fast to do it without that

Hairyloon
Posts: 96
Joined: Wed Jan 20, 2016 10:42 am

Re: DVD Playback on RPi4

Tue Sep 27, 2022 1:45 pm

tvjon wrote:
Tue Sep 27, 2022 10:37 am
Hairyloon wrote:
Tue Sep 27, 2022 9:36 am
I read that the Pi4 cannot play DVD videos. Is that right?...
Where did you read that?
Here: https://codecs.raspberrypi.com/mpeg-2-license-key/
I've just plugged in my dvd reader/writer into this RPi4, & typed:

$ mplayer dvd://

and here's a low resolution screenshot of the result
Mine says:

Code: Select all

Playing dvd://.
libdvdread: Encrypted DVD support unavailable.
************************************************
**                                            **
**  No css library available. See             **
**  /usr/share/doc/libdvdread4/README.css     **
**  for more information.                     **
**                                            **
************************************************
libdvdread: Can't stat /dev/dvd
No such file or directory
libdvdread: Could not open /dev/dvd
Couldn't open DVD device: /dev/dvd (No such file or directory)
No stream found to handle url dvd://
I am currently seeing the website for more information, but I thought I'd post while it's busy on it.
Always code as if the chap who ends up maintaining your code will be a violent psychopath who knows where you live.

cleverca22
Posts: 6828
Joined: Sat Aug 18, 2012 2:33 pm

Re: DVD Playback on RPi4

Tue Sep 27, 2022 1:52 pm

yep, thats what i mentioned, hw mpeg2 accel has been disabled on the pi4
but software mpeg2 decode is still perfectly usable
Hairyloon wrote:
Tue Sep 27, 2022 1:45 pm
Mine says: No css library available.
dom wrote:
Tue Sep 27, 2022 11:18 am
On RPiOS as well as installing kodi you want to run "sudo apt install libdvdcss2"

User avatar
thagrol
Posts: 8224
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK

Re: DVD Playback on RPi4

Tue Sep 27, 2022 1:53 pm

cleverca22 wrote:
Tue Sep 27, 2022 12:55 pm
Hairyloon wrote:
Tue Sep 27, 2022 9:36 am
I read that the Pi4 cannot play DVD videos. Is that right? Is there a sensible reason why not, and is there any way around it?
tvjon wrote:
Tue Sep 27, 2022 10:37 am
Where did you read that?
the only thing i can think of, is that mpeg2 hw accel is disabled on the pi4
but the cpu is plenty fast to do it without that
But it wasn't on early models. Maybe OP has been reading out of date articles and confusing "Pi" with "Pi 4B".
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

cleverca22
Posts: 6828
Joined: Sat Aug 18, 2012 2:33 pm

Re: DVD Playback on RPi4

Tue Sep 27, 2022 1:56 pm

thagrol wrote:
Tue Sep 27, 2022 1:53 pm
But it wasn't on early models. Maybe OP has been reading out of date articles and confusing "Pi" with "Pi 4B".
Screenshot_2022-09-27_10-55-59.png
Screenshot_2022-09-27_10-55-59.png (6.71 KiB) Viewed 1549 times
from what i can tell, the pi4 is capable of mpeg2 hw decode, but the firmware doesnt allow it anymore, i think RPF wants to get out of the key sale mess

User avatar
thagrol
Posts: 8224
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK

Re: DVD Playback on RPi4

Tue Sep 27, 2022 1:57 pm

cleverca22 wrote:
Tue Sep 27, 2022 1:52 pm
yep, thats what i mentioned, hw mpeg2 accel has been disabled on the pi4
but software mpeg2 decode is still perfectly usable
It's been disabled by default on every Pi model. AIUI enabling ti would have made it difficult (or impossible) to hit the $35 pricepoint due to licensing fees.
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

Undertow
Posts: 201
Joined: Thu Feb 18, 2021 2:00 pm

Re: DVD Playback on RPi4

Tue Sep 27, 2022 1:58 pm

The error you are seeing is not due to lack of mpeg-2 decode but rather dvd decrypt support for which you need the following.

https://www.videolan.org/developers/libdvdcss.html
On Debian and Ubuntu, you can install libdvdcss via libdvd-pkg helper package:

Code: Select all

sudo apt install libdvd-pkg
And by running the following command, which will download, build and install the latest libdvdcss source to your machine:

Code: Select all

sudo dpkg-reconfigure libdvd-pkg
Last edited by Undertow on Tue Sep 27, 2022 2:00 pm, edited 1 time in total.

tvjon
Posts: 839
Joined: Mon Jan 07, 2013 9:11 am

Re: DVD Playback on RPi4

Tue Sep 27, 2022 1:59 pm

Mplayer is complaining about CSS, so install the packages mentioned by dom above.

Also refer to cleverca's post. The link you posted is of course correct, but it ought to point out that the ARM is powerful enough to do the mpeg2 decoding without gpu assistance.

cleverca22
Posts: 6828
Joined: Sat Aug 18, 2012 2:33 pm

Re: DVD Playback on RPi4

Tue Sep 27, 2022 1:59 pm

thagrol wrote:
Tue Sep 27, 2022 1:57 pm
It's been disabled by default on every Pi model. AIUI enabling ti would have made it difficult (or impossible) to hit the $35 pricepoint due to licensing fees.
but its been disabled even more on the pi4, the support has been removed from the firmware and you cant purchase a mpeg2 key for the 4

User avatar
thagrol
Posts: 8224
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK

Re: DVD Playback on RPi4

Tue Sep 27, 2022 2:05 pm

cleverca22 wrote:
Tue Sep 27, 2022 1:59 pm
thagrol wrote:
Tue Sep 27, 2022 1:57 pm
It's been disabled by default on every Pi model. AIUI enabling ti would have made it difficult (or impossible) to hit the $35 pricepoint due to licensing fees.
but its been disabled even more on the pi4, the support has been removed from the firmware and you cant purchase a mpeg2 key for the 4
Yes.

Isn't English a wonderfully imprecise language at times?

I was using "disabled" to mean "present but not enabled". I think you were using it to mean "removed".

Still, we got things cleared up in trhe end :)
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

Hairyloon
Posts: 96
Joined: Wed Jan 20, 2016 10:42 am

Re: DVD Playback on RPi4

Tue Sep 27, 2022 2:27 pm

Meanwhile, I seem to have made progress... though it seems I can't launch a DVD through ssh: I'll have to actually go and have a look...

I'll be back...
Always code as if the chap who ends up maintaining your code will be a violent psychopath who knows where you live.

Hairyloon
Posts: 96
Joined: Wed Jan 20, 2016 10:42 am

Re: DVD Playback on RPi4

Tue Sep 27, 2022 2:58 pm

Code: Select all

Playing dvd://.
There are 20 titles on this DVD.
There are 1 angles in this DVD title.

libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient

libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000157
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x00000269
<snip>

libdvdread: Elapsed time 0
libdvdread: Found 9 VTS's
libdvdread: Elapsed time 0
audio stream: 0 format: ac3 (5.1) language: en aid: 128.
audio stream: 1 format: ac3 (stereo) language: en aid: 129.
number of audio channels on disk: 2.
subtitle ( sid ): 0 language: en
number of subtitles on disk: 1
Cache fill:  0.00% (0 bytes)   

MPEG-PS file format detected.
MPEG: No audio stream found -> no sound.
VIDEO:  MPEG2  720x576  (aspect 3)  25.000 fps  6000.0 kbps (750.0 kbyte/s)
Failed to open VDPAU backend libvdpau_vc4.so: cannot open shared object file: No such file or directory
[vdpau] Error when calling vdp_device_create_x11: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 58.35.100 (external)
Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2)
==========================================================================
Audio: no sound
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [xv] 720x576 => 1024x576 Planar YV12 
[mpeg2video @ 0xb5d987b0]Invalid mb type in I-frame at 25 15
[mpeg2video @ 0xb5d987b0]Warning MVs not available
[mpeg2video @ 0xb5d987b0]concealing 945 DC, 945 AC, 945 MV errors in I frame
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [xv] 720x576 => 1024x576 Planar YV12 
V:   0.7  13/ 13 55% 14%  0.0% 0 0 0% 


Exiting... (End of file)
Always code as if the chap who ends up maintaining your code will be a violent psychopath who knows where you live.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6231
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: DVD Playback on RPi4

Tue Sep 27, 2022 3:34 pm

Code: Select all

pi@pi4:~ $ vlc dvd://.
VLC media player 3.0.17.4 Vetinari (revision 3.0.13-8-g41878ff4f2)
[019d9b98] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[9e7032d0] dvdnav demux: DVD Title: THE_MATRIX
[9e7032d0] dvdnav demux: DVD Serial Number: 275A5988
[9e7032d0] dvdnav demux: DVD Title (Alternative): THE_MATRIX
[9e7032d0] dvdnav demux: DVD disk reports itself with Region mask 0x00fd0000. Regions: 02
[9e7032d0] dvdnav demux: Attempting to retrieve all CSS keys
[9e7032d0] dvdnav demux: This can take a _long_ time, please be patient
[9e740b30] avcodec decoder error: unspecified video dimensions
[mpeg2_v4l2m2m @ 0x9e7a6320] Could not find a valid device
[mpeg2_v4l2m2m @ 0x9e7a6320] can't configure decoder
[9e740b30] avcodec decoder error: cannot start codec (mpeg2_v4l2m2m)
[01a5a968] main audio output error: too low audio sample frequency (0)
[9e7aa638] main decoder error: failed to create audio output
[9e7b7bc8] gles2 gl: Initialized libplacebo v2.72.0 (API v72)
[9e7b58e8] mmal_xsplitter vout display error: Failed to open Xsplitter:mmal_vout module
[9e740b30] avcodec decoder: Using DRM Video Accel for hardware decoding
[mpeg2_v4l2m2m @ 0x9d3120f0] Could not find a valid device
[mpeg2_v4l2m2m @ 0x9d3120f0] can't configure decoder
[9e740b30] avcodec decoder error: cannot start codec (mpeg2_v4l2m2m)
[01a5a968] vlcpulse audio output error: digital pass-through stream connection failure: Not supported
[01a5a968] main audio output error: module not functional
[9e7aa638] main decoder error: failed to create audio output
[8cfc5508] gles2 gl: Initialized libplacebo v2.72.0 (API v72)
[9e7b58e8] mmal_xsplitter vout display error: Failed to open Xsplitter:mmal_vout module
[8cc7aa48] avcodec decoder error: unspecified video dimensions
[mpeg2_v4l2m2m @ 0x9e740d90] Could not find a valid device
[mpeg2_v4l2m2m @ 0x9e740d90] can't configure decoder
[8cc7aa48] avcodec decoder error: cannot start codec (mpeg2_v4l2m2m)
[01a5a968] main audio output error: too low audio sample frequency (0)
[8d1d5b08] main decoder error: failed to create audio output
[01a5a968] vlcpulse audio output error: digital pass-through stream connection failure: Not supported
[01a5a968] main audio output error: module not functional
[8d1d5b08] main decoder error: failed to create audio output
[8cc7aa48] main decoder error: Timestamp conversion failed for 28972001: no reference clock
[8cc7aa48] main decoder error: Could not convert timestamp 0 for FFmpeg
[8cc7aa48] main decoder error: Timestamp conversion failed for 50892001: no reference clock
[8cc7aa48] main decoder error: Could not convert timestamp 0 for FFmpeg
[8cc7aa48] main decoder error: Timestamp conversion failed for 71372001: no reference clock
[8cc7aa48] main decoder error: Could not convert timestamp 0 for FFmpeg
Despite complaints (vlc tends to try all possible output options and just reports the ones that failed),
The Matrix is playing on a vlc desktop window with audio.

What are you running this on? A recent RpiOS Bullseye image, that is up to date?

You mentioned ssh - if you are running through ssh you'll probably need to export "DISPLAY=:0" or it plays in ascii art...

Hairyloon
Posts: 96
Joined: Wed Jan 20, 2016 10:42 am

Re: DVD Playback on RPi4

Tue Sep 27, 2022 4:04 pm

dom wrote:
Tue Sep 27, 2022 3:34 pm
What are you running this on? A recent RpiOS Bullseye image, that is up to date?
Raspbian GNU/Linux 10 (buster)
It's doing a dist-upgrade now...
You mentioned ssh - if you are running through ssh you'll probably need to export "DISPLAY=:0" or it plays in ascii art...
I didn't actually expect it to work through ssh, but that isn't the problem: it'll open a VLC window at this end, despite the error...
The other error is the one causing trouble: "cannot open source: /dev/sr0"

Code: Select all

$ vlc dvd://.
VLC media player 3.0.12 Vetinari (revision 3.0.12-1-0-gd147bb5e7e)
[00e71b58] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
failed to get the current screen resources
qt.qpa.xcb: QXcbConnection: XCB error: 170 (Unknown), sequence: 174, resource id: 90, major code: 146 (Unknown), minor code: 20
libdvdnav: Using dvdnav version 6.0.0
libdvdread: Could not open /dev/sr0 with libdvdcss.
libdvdread: Can't open /dev/sr0 for reading
libdvdnav: vm: failed to open/read the DVD
libdvdread: Could not open /dev/sr0 with libdvdcss.
libdvdread: Can't open /dev/sr0 for reading
[b3906b60] dvdread demux error: DVDRead cannot open source: /dev/sr0
Always code as if the chap who ends up maintaining your code will be a violent psychopath who knows where you live.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6231
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: DVD Playback on RPi4

Tue Sep 27, 2022 6:29 pm

Hairyloon wrote:
Tue Sep 27, 2022 4:04 pm
Raspbian GNU/Linux 10 (buster)
It's doing a dist-upgrade now...
That may be the issue. buster is legacy, with all development on bullseye.
Try installing a bullseye image and see how you get on.

drgeoff
Posts: 13315
Joined: Wed Jan 25, 2012 6:39 pm

Re: DVD Playback on RPi4

Tue Sep 27, 2022 8:04 pm

cleverca22 wrote:
Tue Sep 27, 2022 1:56 pm
thagrol wrote:
Tue Sep 27, 2022 1:53 pm
But it wasn't on early models. Maybe OP has been reading out of date articles and confusing "Pi" with "Pi 4B".
Screenshot_2022-09-27_10-55-59.png

from what i can tell, the pi4 is capable of mpeg2 hw decode, but the firmware doesnt allow it anymore, i think RPF wants to get out of the key sale mess
Are there really any MPEG-2 Video patents that have not expired by now?
Quis custodiet ipsos custodes?

cleverca22
Posts: 6828
Joined: Sat Aug 18, 2012 2:33 pm

Re: DVD Playback on RPi4

Tue Sep 27, 2022 8:12 pm

drgeoff wrote:
Tue Sep 27, 2022 8:04 pm
Are there really any MPEG-2 Video patents that have not expired by now?
last i heard, it hasnt expired in malaysia yet

so if you cant prove the pi isnt in malaysia, you must pay the patent fees

and rather then keep being the middle-man in all of that legal fun, RPF just decided no more mpeg2 accel on the pi4, the arm is plenty fast

drgeoff
Posts: 13315
Joined: Wed Jan 25, 2012 6:39 pm

Re: DVD Playback on RPi4

Thu Sep 29, 2022 3:39 pm

cleverca22 wrote:
Tue Sep 27, 2022 8:12 pm
drgeoff wrote:
Tue Sep 27, 2022 8:04 pm
Are there really any MPEG-2 Video patents that have not expired by now?
last i heard, it hasnt expired in malaysia yet

so if you cant prove the pi isnt in malaysia, you must pay the patent fees

and rather then keep being the middle-man in all of that legal fun, RPF just decided no more mpeg2 accel on the pi4, the arm is plenty fast
It would not be up to anyone to prove that the RPi was not in Malaysia. The onus would be on the plaintiff (patent holder or MPEG-LA) to prove that it was.
Quis custodiet ipsos custodes?

kip_the_elder
Posts: 143
Joined: Mon May 03, 2021 3:49 pm
Location: Third Rock from the Sun

Re: DVD Playback on RPi4

Fri Sep 30, 2022 1:15 pm

Hairyloon wrote:
Tue Sep 27, 2022 9:36 am
I read that the Pi4 cannot play DVD videos. Is that right? Is there a sensible reason why not, and is there any way around it?
I use 400s (essentially same as the pi4) as my main computers now...We play DVD's on them all the time. No problem at all.
Always be kind to beginner geeks. They will be the ones programming your ventilator. :)

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 13551
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: DVD Playback on RPi4

Wed Oct 05, 2022 10:36 am

drgeoff wrote:
Thu Sep 29, 2022 3:39 pm
cleverca22 wrote:
Tue Sep 27, 2022 8:12 pm
drgeoff wrote:
Tue Sep 27, 2022 8:04 pm
Are there really any MPEG-2 Video patents that have not expired by now?
last i heard, it hasnt expired in malaysia yet

so if you cant prove the pi isnt in malaysia, you must pay the patent fees

and rather then keep being the middle-man in all of that legal fun, RPF just decided no more mpeg2 accel on the pi4, the arm is plenty fast
It would not be up to anyone to prove that the RPi was not in Malaysia. The onus would be on the plaintiff (patent holder or MPEG-LA) to prove that it was.
https://www.mpegla.com/programs/mpeg-2- ... tent-list/
Under the MPEG-2 Systems Patent Portfolio License, royalties are payable for products Manufactured or Sold in countries with an active MPEG-2 Systems Patent Portfolio Patent at the time of Manufacture or Sale.
So the MPEG-LA go to Malaysia, buy one Pi, and then the onus is on RP to determine how many of all sales went to Malaysia to pay the patent costs on those, or they just claim the licence fee on all Pis sold.
When the ARM is powerful enough to decode the stream, it's not worth the logistical problems, or potential liability, to leave MPEG2 hw decode in there.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Media centres”