Page 1 of 1

I wrote a bash script for automated, parallelized ripping

Posted: Sun Jan 10, 2021 6:40 pm
by Quafi
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!

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

Posted: Tue Jan 12, 2021 1:03 am
by keithhelms
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.

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

Posted: Tue Jan 12, 2021 8:13 am
by Quafi
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.

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

Posted: Sat Dec 11, 2021 12:54 am
by rygle
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?

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

Posted: Sat Dec 11, 2021 12:26 pm
by Quafi
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?