The Thrill of the Rip

I've got a new obsession over the past year - Ripping my DVD and Blu-Ray collection. I take media I already own, and store it on my local NAS server - ready to be served up anywhere in the world on any client device using Jellyfin.

The future is bright - my wife has even started using it over big-name streaming services because there's no advertisements! She might have also picked up on my excitement at seeing her use something from my homelab stack... so it might just be for my benefit as well, bless her heart :).

With this blog post, I'd like to walk through some of the stages that I've been through on this newfound hobby. It ranges from software struggles to hardware troubleshooting and firmware flashing.

The Automated Beginning

My wife brought around 100 DVDs into our marriage, so I excitedly dove into this tote of 2000's era memories to get started. However, much to my surprise, there's little that is standard about physical disk media. They can range from straightforward single-track movies to convoluted, intentionally obfuscated disasters with little intent for humans to understand them.

If I wanted any hope of getting all of these DVD's ripped, I needed to find something that would automate the process. Enter an awesome project, automated ripping machine (ARM). You can find it here at the Github Repo. I was able to shoehorn it into NixOS using this configuration:

{
 # Enable docker, it probably works with Podman too.
  virtualisation = {
      docker.enable = true;
      oci-containers.backend = "docker";
    };

  # Load the 'sg' kernel module to allow the container to see disk drives
  boot.kernelModules = [ "sg" ];

  # Enable udev to allow the container to see disk drives and other devices
  services.udev.enable = true;

  # Open port 8080 for the web UI of the container
  networking.firewall.allowedTCPPorts = [ 8080 ];

  # Create a user 'arm' for the container; set the password with `passwd`
  users.users.arm = {
    isNormalUser = true;
    description = "arm";
    group = "arm";
    extraGroups = [ "arm" "cdrom" "video" "render" "docker" ];
  };

  # Create a group 'arm' for the container
  users.groups.arm = { };

  # Configure the ARM container
  virtualisation.oci-containers.containers."arm-rippers" = {
    autoStart = true; # Automatically start the container on boot
    image = "automaticrippingmachine/automatic-ripping-machine"; # custom ARM image with handbrake built with intelQSV support. After building the image run docker commit <container_id> custom-arm.
    ports = [ "8080:8080" ];
    environment = {
      ARM_UID = "1001"; # UID of the 'arm' user on the host system
      ARM_GID = "993"; # GID of the 'arm' group on the host system
    };
    # Mount 'host directory' to 'container directory'
    volumes = [
      "/home/arm:/home/arm"
      "/home/arm/Music:/home/arm/Music"
      "/home/arm/logs:/home/arm/logs"
      "/home/arm/media:/home/arm/media"
      "/home/arm/config:/etc/arm/config"
    ];
    extraOptions = [
      "--device=/dev/sr0:/dev/sr0" # Pass through the CD/DVD drive
      "--device=/dev/dri:/dev/dri" # For IntelQSV support, add the GPU device to the container and follow [the IntelQSV instructions in the ARM wiki](https://github.com/automatic-ripping-machine/automatic-ripping-machine/wiki/intel-qsv).
      "--privileged" # Run the container in privileged mode
    ];
  };
}

You can run this on a normal flavor of distribution MUCH easier, however I usually like to nixify things if possible...

This project helped me to get a start at bulk-ripping a lot of disks - it's as easy as just opening the disk drive, inserting your disk, and waiting until the disk drive opens again.. It's that easy. The project has figured out a way to get almost all of the metadata correct on the first pass, however there is some manual intervention needed if your disk or the video title is someething that isn't clearly defined in an online registry that drives the automatic matching. Overall though, it's worlds better than doing it all 100% manually.

After going through the standard DVD disks, that brought me to the next bump in the road... drive hardware.

Diskovery

I had installed ARM on an old full-sized ATX tower PC I'd received second-hand from a coworker - it came with a traditional SATA-connected optical disk drive (ODD) that read CD's and DVDs. However, I quickly exhausted my DVD's and had to move onto some of the newer media formats like standard and 4K-UHD Blu-Ray disks.

After some research online, I found that the community had found some clever ways to install custom firmware on many different ODDs. After a quick google, I found this model of drive should likely work to flash to custom firmware that could read 4K-UHD Blu-Ray: LG WH16NS40 Super Multi Blue Internal SATA 16x Blu-ray Disc Rewriter. However, I missed the important caveat that the firmware had to be below a certain version in order to succesfully flash it. After receiving my unit, I was frustrated to find that I had a "newer" model that had the flashing ability patched out. This left me with a SATA ODD that could read traditional 1080p Blu-Rays only. This could have deterred me, but... why stop there?

At this point, I realized that using a SATA-connected ODD limited my options for "ripping" machines to host the drive. I decided to instead switch to a USB-connected drive for my 4K ODD. This led me to these: Verbatim Ultra HD 4K USB 3.2 Gen 1 Blu-ray Writer. While not cheap, I was able to get them flashed with Libredrive and voilà! 4K-UHD Blu-Rays were now within my sights!

The Credits

With all the hardware ready to rip, this left me drowning in a sea of other technical items I had not expected to encounter. Things like quickly diminishing storage, media codec confusion, hardware and software encoding/decoding/re-encoding, and metadata cleanup are all things I willl need to cover in another blog post. It really is a learning curve - but it's so worth it.

Like I mentioned above, I've got family buy-in for this process. If we find something we like to watch, we buy it and have it forevor. The sales pitch doesn't take much convincing in the current state of online streaming. If we ignore the hardware runaround, this has been a fun project to dive into - especially now that I've ripped off the band-aid and gone all in!