MY HDA Project: Automatic Disc Detection, Ripping & Encoding

User avatar
flickeringsight
Posts: 41
Joined: Fri Nov 06, 2009 3:46 pm
Location: Ventura, Ca

MY HDA Project: Automatic Disc Detection, Ripping & Encoding

Postby flickeringsight » Mon Jun 07, 2010 4:37 pm

I've been working for a long time on a set of scripts to make my file server as appliance-like as possible in regards to loading media: Pop a disc in, everything gets moved over, disc gets ejected, media put into encoding queue. At this time I feel conformable enough with their usability to share them with the rest of you. Hopefully this can help some people.

Some parts of this project are fairly well developed, others less-so but still useful. I have also used several well-known applications and scripts available online in this setup and I'll try to touch on each of them.

THE BIG PICTURE
Here's a break-down of the workflow.

[UDEV Rule Detects Disc Mount] => Launch disc identification script. (detectdisc)
Pops up a dialog box asking if you want to cancel automatic ripping, times out in 15 seconds and continues with rip.
-[Video DVD detected] => Launch DVD ripping script. (Qripdvd)
Rip entire DVD to scratch partition, create queue file, eject disc.
-[Audio CD detected] => Launch audio CD ripping/encoding script. (abcde)
ID album, rip, encode and sort into archive, eject disc.
-[Data Disc Detected] => Launch media file copy/sort script. (ripdata)
Media files are found and copied into archive, eject disc.

[Crontab schedules encoding queue manager] => Queue manager script. (Qmanager)
-[Qmanager] => Checks if encoder is already working via a job file, if not, it finds queue
file(s), creates job file (to indicate job is in-progress), launch encoder. (Qencode)
--[Qencode] => Encodes video from disc rip, moves finished file to archive, deletes scratch files.
-[Qmanager] => Removes queue file, job file.

Third-party software and scripts used in this work flow:
HandBrakeCLI
vobcopy
abcde
zenity
Of course, each of these may have their own dependencies and such. You'll have to get all the goodies to compile HandBrakeCLI, I won't go into that right now, maybe later.

MY SCRIPTS!
detectdisc_prompt & detectdisc
The first script "detectdisc_prompt" is the one actually launched by UDEV and in turn it launches the actual script "detectdisc". This is the only way I could make it work.

Qripdvd
Rips video DVD discs and creates a queue file for the manager.

Qmanager
Manages encoding of DVD rips, is scheduled via crontab.

Qencode
This is my baby, the one I've worked on for months now. It has two major functions.
1. By gathering data about the titles on the DVD it attempts to determine if the disc contains a movie, T.V. series episodes or some variation of those. Trust me, it's harder than it sounds.
2. Encodes the movie(s) or episode(s) as a very high quality mkv file with bells and whistles including: original audio pass-thru and stereo mixdown (for small T.V.s), subtitles, English language track detection on foreign language movies, chapters and seek. It's also easily configurable.

ripdata
Admittedly, this is my weakest effort but it seems to do the job. It searches a disc for set groups of file types and copies them into the archive. The search identification function needs some work, but the actual process of copying the files is quite robust. Still, it could use a little help.

EXTRA SCRIPTS
These aren't part of the workflow, but may come in handy.

DVDeval
This is the DVD-type detection coding from the Qencode script (above) as a standalone script. It comes in handy if you want to test the detection output and can also be referenced in your own encoding script since it store it results in tidy variables.

ripdvd
Not to be confused with the Qripdvd (above). This is the actual encoding portion of Qencode, plus the ripping portion of Qripdvd as a standalone script. It references DVDeval to get the info it needs to do the job. As long as it and DVDeval are in the same directory you can use this to rip and encode a mounted DVD.

Also remember, most of these scripts have a bunch of variables that need to be set, like path names and file owners, in order for them to work right. All of those variables are located in at the top of the script so they're easy to find.
Last edited by flickeringsight on Thu Jul 08, 2010 10:57 am, edited 1 time in total.
HDA: 2.6GHz Dual Core, Gigabyte MB, 2GB RAM, Blu-Ray, 320GB+1.0TB+2.0TB+4.0TB, Amahi 8

pjcrux
Moderator
Posts: 123
Joined: Sun Jan 04, 2009 11:40 am
Location: San Antonio, TX

Re: MY HDA Project: Automatic Disc Detection, Ripping & Enco

Postby pjcrux » Fri Jun 11, 2010 10:42 am

How comfortable are you with packaging applications for Amahi? Do you think you could make this into one?
Community Advocate
HP Proliant Micro Server N40L, AMD Turion II Neo x2 1.5GHz;
8GB ECC-DDR3; 250GB for OS, 3x1TB.

"Experience has taught mankind the necessity of auxiliary precautions"
-James Madison, Federalist Paper No. 51

User avatar
flickeringsight
Posts: 41
Joined: Fri Nov 06, 2009 3:46 pm
Location: Ventura, Ca

Re: MY HDA Project: Automatic Disc Detection, Ripping & Enco

Postby flickeringsight » Mon Jul 19, 2010 1:01 pm

I could certainly try, but will need a bit of help and a lot of time. After looking over the guide on packaging apps it seems fairly straightforward but I have several questions, most of which are probably basic. Should I post my questions in the Developer forum?
HDA: 2.6GHz Dual Core, Gigabyte MB, 2GB RAM, Blu-Ray, 320GB+1.0TB+2.0TB+4.0TB, Amahi 8

rednus
Posts: 29
Joined: Wed Jan 12, 2011 4:17 pm

Re: MY HDA Project: Automatic Disc Detection, Ripping & Enco

Postby rednus » Thu Jun 09, 2011 8:51 am

Hey flickeringsight.. your scripts sound great..

have you created an app for this in Amahi? if so what is the name..

If not could you please give a bit of detailed installation procedure?

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: MY HDA Project: Automatic Disc Detection, Ripping & Enco

Postby bigfoot65 » Fri Jun 10, 2011 7:04 am

Awesome stuff. Documentation would be better in the wiki. Would you mind creating a wiki page and including all the steps and such to make this work?
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

User avatar
sgtfoo
Posts: 419
Joined: Sun Jul 18, 2010 8:27 pm

Re: MY HDA Project: Automatic Disc Detection, Ripping & Enco

Postby sgtfoo » Sat Jun 11, 2011 8:10 am

This idea reminds me and it pretty much identical to "VortexBox" which is a Fedora distro designed specifically for appliance use, and does a great job at it too.

I've been running vortexbox within a Virtual machine to get its abilities. I've not yet tried it from my HDA yet, but it's worth referencing the vortexbox model for your project.
SgtFoo
HDA: VM inside oVirt FX-8300 95w (2 cores for HDA), 32GB RAM (2GB for HDA)
My PC: FX-8300, 16GB RAM, 3x 1TB HDDs, Radeon HD6970 2GB video; Win10 Pro x64
Other: PC, Asus 1215n (LXLE), Debian openZFS server (3x(2x2tb) mirrors)
Modem&Network: Thomson DCM475; Asus RT-AC66U; HP 1800-24G switch

ccondrup
Posts: 12
Joined: Sat Jan 01, 2011 8:01 pm

Re: MY HDA Project: Automatic Disc Detection, Ripping & Enco

Postby ccondrup » Tue Jun 21, 2011 6:00 am

Wow, this project sounds great. Have you made any progress regarding packaging it as an Amahi app?

elxiliath
Posts: 1
Joined: Sun Jul 03, 2011 1:33 pm

Re: MY HDA Project: Automatic Disc Detection, Ripping & Enco

Postby elxiliath » Sun Jul 03, 2011 1:40 pm

If there's anything I can do to try and help you with this project, let me know.

I've been wanting to start a project like this myself.

theawesomes
Posts: 5
Joined: Tue Jun 07, 2011 12:52 pm

Re: MY HDA Project: Automatic Disc Detection, Ripping & Enco

Postby theawesomes » Tue Jul 12, 2011 12:10 pm

I also echo the excitement of this project. It sounds like a great idea.

User avatar
radioz
Posts: 406
Joined: Tue Nov 24, 2009 1:07 pm

Re: MY HDA Project: Automatic Disc Detection, Ripping & Enco

Postby radioz » Tue Jul 12, 2011 4:56 pm

Quick question: When you insert a media disk, does it automatically start ripping or does it wait for the user to click 'OK'?

Who is online

Users browsing this forum: No registered users and 14 guests