I wrote a bash script for automated, parallelized ripping

The place to discuss linux version of MakeMKV
Post Reply
Message
Author
Quafi
Posts: 6
Joined: Sat Nov 24, 2018 7:49 am

I wrote a bash script for automated, parallelized ripping

#1 Post by Quafi » Sun Jan 10, 2021 6:40 pm

Hey there,

I hope it's okay if I'm "promoting" my work here.

After destroying my last movie storage server and now being confronted by the fact that I'll have to rip a couple hundred BluRays again, I wrote a bash script automation for it.

All you have to do after starting the script is throwing in DVDs and taking them out once they're finished. Everything else is done automatically.
Also it works with as many drives as you want, tho you should calculate about 1GB of memory for every BluRay and about 500MB for a DVD, according to a (pretty outdated) information from this forum.

It has been developed and tested on Ubuntu 20.04, tho it'll probably work with other distributions aswell.

https://github.com/ThisIsTenou/makemkv-autorip-script

Let me know what you think!

keithhelms
Posts: 38
Joined: Sat Apr 16, 2016 10:34 am

Re: I wrote a bash script for automated, parallelized ripping

#2 Post by keithhelms » Tue Jan 12, 2021 1:03 am

My first question would be, why is your wrapper script copying the Makemkv license into the config file? You should only have to do that once.

Second question, where did you come up with the 1GB of storage for a blu ray and 500MB for a DVD? Makemkv just copies the data as is and, as far as I could see, there is no reencode step in your scripts that calls handbrake or ffmpeg. Copying an entire blu ray to the hard drive is going to eat up as much as 50GB of storage and a DVD as much as 8.5GB.

Quafi
Posts: 6
Joined: Sat Nov 24, 2018 7:49 am

Re: I wrote a bash script for automated, parallelized ripping

#3 Post by Quafi » Tue Jan 12, 2021 8:13 am

Hey there! The wrapper is copying the license from the scripts settings file into MakeMKVs settings file.
Since MakeMKV is currently free with a license code that has to be renewed every two months it's just one path less to remember, as everything you need to run this script is in one place.

Regarding your second question, I found an old post in this forum stating these values, however I don't remember exactly which one it was. I haven't verified these values myself, so they can definitely be of by quite a bit.

rygle
Posts: 1
Joined: Sat Dec 11, 2021 12:38 am

Re: I wrote a bash script for automated, parallelized ripping

#4 Post by rygle » Sat Dec 11, 2021 12:54 am

Hi, thanks for writing this script! It is very useful.

For some reason it has started pausing for me. At first I thought it might be a license issue, or that my build of makemkv had expired (was using 1.16.4) so I updated to 1.16.5 and checked the license, but still kept having some issues. Sometimes it would rip but would take a long time, sometimes it would rip but would just make an empty destination folder.

When I checked for running processes after a rip has finished, sometimes there are two lots of wrapper.sh and two lots of makemkvcon running.

I have found that to get it to rip, I run "wrapper.sh &" to background it (or run then CTRL-Z and bg to send it to the background), then insert the disc, wait for it to check and say the disc is ready (and I think it runs makemkvcon to get information about the disc name and adds this to a variable) and then it will pause, but if I run "pkill makemkvcon" about 5-10 seconds after it says the disc is ready, it will immediately rip successfully. If I do it before waiting the 5-10 secs, it will fail and quit.

I believe that wrapper.sh calls autorun.sh, and if I run autorun.sh on its own I don't think it has the same problem. I have tried inserting "pkill makemkvcon" into the autorun.sh script just before it says it is starting the rip, but haven't yet gotten it to work automatically.

I have always run the script as root from the root directory, on a debian system (a stock OpenMediaVault stable release). I don't think running it as sudo would make any difference, or running it as "bash wrapper.sh", since if I run "echo "$SHELL"" it reports the shell I am using as "/bin/bash".

Any thoughts anyone?

Quafi
Posts: 6
Joined: Sat Nov 24, 2018 7:49 am

Re: I wrote a bash script for automated, parallelized ripping

#5 Post by Quafi » Sat Dec 11, 2021 12:26 pm

I've noticed similar issues myself, which I assumed were caused by either the disk being unreadable or the device becoming unavailable. Unfortunately, I'm too low on free time at the moment to look into this in much more detail.

What drives are you using and did it happen with any specific discs all the time?

Post Reply