Working with Optical Media on Linux.

mpv is capable of playing cds, dvds, and blu-rays. In order to play dvds and blu-rays properly, you need to circumvent the copy protection. For dvds, this can be done by installing libdvdcss. For blu-rays, install libaacs, download this key file and extract it to ~/.config/aacs. The only thing mpv doesn't have is menus. Vlc has support for menus and the drm-circumvention setup is the same. You'll also need to install jre-openjdk to view blu-ray menus.

To play dvds, type mpv dvd://, and specify what device you want to use with --dvd-device=/dev/srX.

To play blu-rays, type mpv bd://, and specify what device you want to use with --bluray-device=/dev/srX.

To play cds, type mpv cdda://. If you have multiple optical drives connected, and it can't auto-detect which one to use, you can pass the --cdrom-device=/dev/srX flag to specify which drive to use. You can check what optical drive(s) you have connected by typing lsblk. It'll usually be labelled /dev/sr0, and if you have a second optical drive connected, it'll be labelled /dev/sr1, and so on, so forth. If the CD you're playing supports CD text, you can have mpv display it using the --cdda-cdtext=yes option. (You won't want to use this if you're using a CD-ROM drive where it ruins performance for unknown reasons according to the man page.)

Now this is a lot of commands to enter in whenever you want to play a disc, but you can alias them to something shorter If you're using bash, then you can put something like alias cdda="mpv cdda:// --cdrom-device=/dev/sr0 --cdda-cdtext=yes into your .bashrc file. If you're using LARBS, then aliases are stored in ~/.config/shell/aliasrc.

REEEEE how do i skip chapters???

By default, mpv has chapter skipping mapped to the PgUp and PgDn keys; this is retarded. Thankfully you can remap key functions in .config/mpv/input.conf. By default LARBS uses the "h" and "l" keys to skip backward and forward 5 seconds respectively; "j" and "k" skip backward and forward 1 minute respectively. What I did is map the capital "J" and capital "K" keys to skip backward and forward 1 chapter respectively. mpv also treats individual tracks on a CD as "chapters" as well.

Defualt mpv keybind config deployed by LARBS:

l seek 5
h seek -5
j seek -60
h seek 60
S cycle sub

My CHAD mpv keybind config:

l seek 5
h seek -5
j seek -60
k seek 60
S cycle sub
K add chapter 1
J add chapter -1
H playlist-prev
L playlist-next

The "playlist-prev" and playlist-next" entries are optional. As an example, if you run mpv on a folder with mp3s in it, mpv will cue them up in a "playlist," and you can skip backward and forward using the "<" and ">" keys respectively - which is fine - but I have them mapped to capital "H" and capital "L" to complete the vim-bindings.


I spend way too much time on the computer