Log in

View Full Version : Playing HD-DVD discs


skygod
19th January 2008, 01:39
HD-DVD on Linux

1. Hardware
I use a XBOX360 drive that I got on ebay, plug it in and it will work. On my Ubuntu system, it automajicly appears at /dev/scd0. As a bonus, it appears to ignore SD DVD regions.


# lsusb
Bus 005 Device 008: ID 045e:029c Microsoft Corp.
Bus 005 Device 007: ID 045e:029e Microsoft Corp.

# mount -o ro /dev/scd0 /mnt - For a DVD
# ls /mnt
AUDIO_TS VIDEO_TS



2. UDF2.5 Filesystem Kernel patch
HD-DVD's use a UDF filesystem @ version 2.5, which is a higher than my Linux distro ships with. Apply a kernel patch from http://sourceforge.net/tracker/?atid=300295&group_id=295&func=browse I use 2.26.3.1 kernel and patch for 2.6.23 and it works well.

update: Patch for 2.6.24 now released.


# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.23.1.tar.bz2
# bunzip2 --stdout linux-2.6.23.1.tar.bz2 | tar -xvf -
# cd linux-2.6.23.1
# wget -O UDF_2.50-linux-2.6.23-rc6.patch.bz2 "http://sourceforge.net/tracker/download.php?group_id=295&atid=300295&file_id=245895&aid=1795804"
# bunzip2 UDF_2.50-linux-2.6.23-rc6.patch.bz2
# cat UDF_2.50-linux-2.6.23-rc6.patch | patch --dry-run -p1
# cat UDF_2.50-linux-2.6.23-rc6.patch | patch -p1


Recompile and install your Kernel. For Ubuntu I follow this: http://ubuntuforums.org/showthread.php?t=311158&highlight=recompile+kernel

If the files aren't encrypted (not all studios encrypt all files on every disc) and your lucky with the codecs used for encoding you might be able to play something! Probably an 'extra' or Studio logo. The movie files are under HVDVD_TS.


# mount -o ro /dev/scd0 /mnt
# ls /mnt
AACS AACS_BAK ADV_OBJ HVDVD_TS
# ls -al /mnt/HVDVD_TS





3. Apply EAC3 patch to a SVN version of mplayer
Most but not all 'features' use EAC3 (http://en.wikipedia.org/wiki/EAC3) as the Audio format which mplayer must be patched for. http://forum.doom9.org/showthread.php?p=1088200#post1088200

Subversion (svn) is a source management system. You may need to install it on your distro.

I'm using version 11555 of mplayer. mplayer commits happen frequently to get the patch to go on clean you may have to grab that exact version ( -r 11555 ).


# svn -r 11555 co svn://svn.mplayerhq.hu/mplayer/trunk mplayer
# cd mplayer
# wget http://www.db-instable.org/misc/eac3v5.patch
# cat eac3v5.patch | patch -p0

# ./configure; make; make install

# mplayer -ac help | grep ffeac3
ffeac3 ffmpeg problems FFmpeg EAC3 [E-AC3]





4. Playback with mplayer
A typical HD-DVD has two video and half a dozen audio tracks, so you need to tell mplayer which ones to playback. You must also help mplayer select the correct video and audio codecs.

As I found out the hard way, EAC3 has been merged with AC3 so the command line options for mplayer maybe different to what you've used before.

First step is to see what you have, play some frames of your file.


# mplayer -frames 10 -quiet -demuxer lavf -vc ffvc1 -ac ffac3 sample-matrix2.evo
MPlayer dev-SVN-r25781-4.1.2 (C) 2000-2008 MPlayer Team
CPU: Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz (Family: 6, Model: 15, Stepping: 2)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

Playing sample-matrix2.evo.
libavformat file format detected.
[lavf] Video stream found, -vid 0
[lavf] Video stream found, -vid 1
[lavf] Audio stream found, -aid 2
[lavf] Audio stream found, -aid 3
[lavf] Audio stream found, -aid 4
[lavf] Audio stream found, -aid 5
[lavf] Audio stream found, -aid 6
[lavf] Audio stream found, -aid 7
[lavf] Audio stream found, -aid 8
VIDEO: [WVC1] 1920x1080 0bpp 29.970 fps 0.0 kbps ( 0.0 kbyte/s)


In this case you have two video streams and six audio, you can select the one you want by -aid x -vid y. I don't know a way to work out which one is what.

tip: In mplayer # goes to the next audio stream.


Once you've figured out the audio and video stream, you can sit back with your popcorn and watch the thing. This is what I use.

# nice --2 mplayer -aid 8 -vid 0 -cache 8192 -framedrop -autosync 30 -quiet -fps 23.976 -demuxer lavf -lavfdopts format=mpeg -vc ffvc1 -ac ffac3 sample-matrix2.evo

My system is underpowered for HD:
nice --2
-cache 8192
-framedrop

-autosync 30 I find on most movies this keeps the audio in sync.

-demuxer lavf This demuxer one works by far the best, there are others. I did have one file that wouldn't play without a + to force it ( i.e. -demuxer +lavf )

-lavfdopts format=mpeg Superfluous option, but sometimes is required.

-vc ffvc1 ffvc1 is the video codec for HD-DVD.

-ac ffac3 No longer ffeac3. Almost all 'features' on HD-DVD discs are EAC3.



When it bombs. Such is life! Not all files will play from start to finish. You can use this.


mplayer -ss hh:m:ss




5. Notes
Overall, HD-DVD playback works reasonably well on my dual core system ( 1.8G ) but it maxes out a core at 100%. There is some frame dropping and tearing - especially on fast camera pans. I have a SPDIF (http://en.wikipedia.org/wiki/SPDIF) connection to my receiver (SPDIF doesn't have the b/w for EAC3) so I only get two channels of audio.

I haven't mentioned decrypting files. You can use the resources here!
http://forum.doom9.org/showthread.php?p=1084752#post1084752
http://www.decrypthd.org/

For recent discs, there is also [for Windows] SlySoft's AnyDVD.

No idea about Blu-Ray, I believe it's somewhat similar.



6. References
HD Audio explained (http://www.highdefdigest.com/news/show/1064)

Ubuntu docco on HD discs (https://help.ubuntu.com/community/RestrictedFormats/BluRayAndHDDVD)

A nice guide in French (http://forum.hardware.fr/hfr/OSAlternatifs/Multimedia/linux-sujet_64987_1.htm)


edit just found this: Guide from MythTV wiki (http://mythtv.org/wiki/index.php/High_Definition_Disk_Formats)



7. Thanks
A big thanks to all those that donate their time to open source software. Without you guys, I can't play my discs!

qubic
26th January 2008, 09:23
Hi Skygod

Good guide.

# mplayer -ac help | grep ffeac3
ffeac3 ffmpeg problems FFmpeg EAC3 [E-AC3]

This comes from:

audiocodec ffeac3
info "FFmpeg EAC3"
status buggy
format 0x0
driver ffmpeg
dll "E-AC3"

Could be placed in /root/.mplayer/codecs.conf. If not done at compile time.

I get better performance by starting only X windows with the "xinit" command.

BTW: TrueHD is exactly the same way. The patch is found the same place. Use '-ac ffmlp' instead.

regards qub

QBasicer
3rd February 2008, 06:40
Any luck transcoding to a more same format? I'm wondering what a half decent audio codec and video codec with bitrate would be.

Thanks,
Q

qubic
10th February 2008, 01:41
Hi

Anyone managed to patch the latest kernel (2.6.24.1) with the UDF patch?

regards qub

QBasicer
10th February 2008, 04:59
Worked for me. There's a path on the UDF sourceforge project page for 2.6.24, which patched beautifully with my gentoo kernel (no idea about the .1 though, which distro?)

qubic
10th February 2008, 23:20
Worked for me. There's a path on the UDF sourceforge project page for 2.6.24, which patched beautifully with my gentoo kernel (no idea about the .1 though, which distro?)

Do you have a link? I can't find it.
It's the latest from kernel.org.

regards qub

Zotty
10th February 2008, 23:52
You might wanna try looking here ;)

http://sourceforge.net/tracker/?atid=300295&group_id=295&func=browse

qubic
13th February 2008, 22:15
thanks. It works.