How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

HandBrake for Mac support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
rhester
Veteran User
Posts: 2888
Joined: Tue Apr 18, 2006 10:24 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by rhester » Fri Nov 20, 2009 8:44 pm

Output from a CLI title scan (-t 0) would be very useful to see.

Rodney

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Sat Nov 21, 2009 1:07 am

Hi Again,
th3_m45t3r wrote:I've never experienced a situation where the batch encode only does a single track when multiple are present. Perhaps I've missed a setting somewhere in the workflow?
As discussed in the tutorial, "If the input source resides in your Batch Rip Movies folder, or its Spotlight comment is set to "Movie", only one track is selected, provided it's between the min/max duration you set in the script for movies."

The code that determines the tracks to encode is in the getTrackListWithinDuration() function. As you can see in the code below, if the video kind is set to Movie only the first track is returned if there are multiple tracks between the min/max duration.

Code: Select all

if [ "$videoKind" = "Movie" ]; then
	aReturn=`echo "$titleList" | egrep -m1 ".*"`
elif [ "$videoKind" = "TV Show" ]; then
	aReturn="$titleList"
fi
th3_m45t3r wrote:Even if the process were to only encode the longest track, I've seen a few cases where the longest track actually isn't the right one.
Yes, there are many discs where the longest track isn't the main title. This is the main reason for having an editable max duration setting. It's important to note that for Movies, the action doesn't get the longest track on the disc, it gets the longest track between the min/max duration. You can and probably should adjust the setting if you think it will work better for the sources you're working with at the time.
th3_m45t3r wrote:I'm betting that there's something set up on the Finding Nemo DVD that's causing some confusion, as I've seen no other DVDs with this invalid track configuration.
This would be probably be a special case. Unfortunately, there will always be situations where the automation will fail. For example, I just encoded the Bruno blu-ray and the automation selected the title which included the directors commentary cut scenes interspersed with the main video. This is a case where I will have to do some manual work to encode the title. It's a pain, but I'd rather do 1 out of 50 manually than all of them.
th3_m45t3r wrote:Most of the other DVDs either include widescreen/standard or original/extended editions. In the case of the extended editions, encoding only the longest track does apply, but in the case of widescreen/standard it would not (since the tracks would/should be the same length).
Again, the action should only return one track for movies. In the case of widescreen vs. standard, it will return whichever is first in DVDs title list. I've thought about including an option for selecting a preference for widescreen or 4:3, but haven't gotten into it yet. Why anyone would want 4:3 is beyond me, but if I do it I might as well make it a choice.
th3_m45t3r wrote:I'm not at my primary machine at the moment, but if you'd like to see some logs or the terminal output, I would be happy to post them when I can get to them.
That would probably be good, but I'm not sure if it would solve your problem. We need to figure out why the video kind variable is being set to TV Show for your source. This is the only way I can see why it would encode more than one track. First, check the spotlight comment for your source folder and also make sure your source resides in the folder you've designated as your batch rip movies folder in the action. Let me know what you find.

Thanks, mac.jedi

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Sat Nov 21, 2009 3:41 am

th3_m45t3r wrote:I've never experienced a situation where the batch encode only does a single track when multiple are present.
I did a little more digging and found that there is a problem with the code on line 436. At some point I changed the titleList from a list with each title as a line to a space delimited string. The grep command was getting the first line which was the entire string. It'll be fixed in the next update, but if you want to make the change yourself, you can use the new line below.

Thanks for helping me to find this, mac.jedi

Original

Code: Select all

if [ "$videoKind" = "Movie" ]; then
	aReturn=`echo "$titleList" | egrep -m1 ".*"`  # this is the original line
elif [ "$videoKind" = "TV Show" ]; then
	aReturn="$titleList"
fi
Fixed

Code: Select all

if [ "$videoKind" = "Movie" ]; then
	aReturn=`echo "$titleList" | awk -F\  '{print $1}'` # this is the fixed line
elif [ "$videoKind" = "TV Show" ]; then
	aReturn="$titleList"
fi

th3_m45t3r
Posts: 8
Joined: Fri Oct 30, 2009 4:31 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by th3_m45t3r » Sat Nov 21, 2009 1:10 pm

Hello,
mac.jedi wrote:The grep command was getting the first line which was the entire string. It'll be fixed in the next update, ...
Thanks for digging into this. I hope I didn't come across as accusatory in my post. To be totally honest with you, I actually prefer the configuration where it encodes all tracks of valid length. I end up with much less manual work to determine the correct encoded file once it's all done, rather than finding out that it was the wrong track and having to do some re-config to get the correct one (and then encode again).

Also, some of the movies I've got here are shorter and/or longer than the default range of min/max you have set, so I increased the range a wee bit. That doesn't impact the multi-primary-track DVDs, but it could impact the ones with really long special feature tracks. I'm willing to take the chance that I accidentally encode a special feature now and then. It's much easier to just delete the encoded file than to figure out some special config to skip it. (sarcasm)Or I could use the GUI tool, but who would do such a thing when the awesome CLI is available!?(/sarcasm) :)

And I'm completely with you on not knowing why anyone would want the 4:3 version if a widescreen aspect is available. Some of the older DVDs I have, though, only have 4:3 (my wife purchased those before I met her, but she knows better now).

Glad to be able to help, even as a relative newcomer to this side of development. Let me know if there's anything else I can do for you - I'm always willing to lend a hand.
rhester wrote:Output from a CLI title scan (-t 0) would be very useful to see.
Rodney, did you want to see a title scan from one of my DVDs, or are you requesting to have that added to the output of the Batch Encode script?

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Sat Nov 21, 2009 2:40 pm

th3_m45t3r wrote:I actually prefer the configuration where it encodes all tracks of valid length.
For those that want to the same but don't want to dig into the code, you can just "pretend" your movie sources are tv shows and put them in the Batch Rip TV folder. Then all the tracks will be encoded between the min/max duration. It won't add the movie tags during the encode session, but you can do it after with Add Movie Tags.action.
th3_m45t3r wrote:
rhester wrote:Output from a CLI title scan (-t 0) would be very useful to see.
Rodney, did you want to see a title scan from one of my DVDs, or are you requesting to have that added to the output of the Batch Encode script?
An option to show verbose logging from HandBrake will be in the next version (right now it's set to -v0), I'm testing it now. It will also save the Terminal output from the last session to a file in ~/Library/Logs.

Thanks again, mac.jedi

jkbuster
Posts: 12
Joined: Fri Mar 21, 2008 8:26 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by jkbuster » Sun Nov 22, 2009 8:34 pm

I finally have some time to put this together, and it works great! THANKS!!!

The one problem I have run into is for the "Encode HD Sources" button in the Batch Encode workflow. I'm not working with Blue-Ray myself and so don't have any of the HD software installed, but I do have 720p .mkv files I'd like to convert. When I enable the checkbox, the terminal window opens and closes so quickly I can't read anything when I try to run the service.

Any ideas?

--
Thanks,
JKB

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Mon Nov 23, 2009 3:47 pm

jkbuster wrote:The one problem I have run into is for the "Encode HD Sources" button in the Batch Encode workflow. I'm not working with Blue-Ray myself and so don't have any of the HD software installed, but I do have 720p .mkv files I'd like to convert. When I enable the checkbox, the terminal window opens and closes so quickly I can't read anything when I try to run the service.
Hi jkbuster, I'm on vaca, so it might take me a while to get back to you again. Can you give me a little more info to help narrow down the problem?

Does it work normally with DVD sources?
Try removing the mkv file from your batch rip folder and try running the service with encode HD enabled. Does the window still close? It should stay open. It should also give you some info, like no sources found, errors in setup or not being able to find certain apps. It should also list the options you set in the action panel. Does it say encode HD sources is yes?
Make sure you have the latest snapshot of HandBrakeCLI installed in /Applications. There should be a link to the latest snapshot at the top of the Mac Forum.
Try running a HandBrake scan on the MKV and post it here, to see if it reports any problems. You can also try the GUI (latest snapshot) to troubleshoot the encode and copy the activity log.

Let me know what you find. Thanks, mac.jedi

mrwiggles
Posts: 3
Joined: Tue Nov 24, 2009 3:04 am

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mrwiggles » Tue Nov 24, 2009 3:13 am

Love the this tutorial. Excellent work Mr. Jedi. A quick question however...

Is there any way I can set the Batch Encode action to encode HD content differently based on whether it is a TV show or Movie? I did an encode today on a bluray version of 'The Universe' TV series and I noticed that when I got home it had encoded BOTH 720p and 1080p versions of each episode. I had changed the options in the action to 720p and left 1080p unchecked, but it still did a 1080p version. What I want is to be able to tell it to encode all HD movies at 1080p (since I don't usually keep them around for very long and storage is not a problem), and all HD TV Shows at 720p (because I do keep these and the 720p files at 1/8 the size). Can this be done?

Many thanks for a most excellent set of actions. Now if there was just some way to automate naming the encoded TV Show episodes so that I didn't have to check each file to confirm that it is the correct episode # and sequence. A service like Gracenote for DVDs and Bluray discs would be great!

-mw

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Wed Nov 25, 2009 11:00 pm

mrwiggles wrote:Is there any way I can set the Batch Encode action to encode HD content differently based on whether it is a TV show or Movie?
Hi mrwiggles,

Thanks for posting! The only way to setup different encode settings for TV & Movies is to create two separate Services. Have one target the TV Shows folder and the other target the Movies Folder. Make sure you are only targeting one folder. For example, if you setup a service for TV Shows, Set the path to the Batch Rip TV folder, but set the Batch Rip Movies folder to an empty folder. Then you'd do the opposite for Movies.
mrwiggles wrote:I did an encode today on a bluray version of 'The Universe' TV series and I noticed that when I got home it had encoded BOTH 720p and 1080p versions of each episode. I had changed the options in the action to 720p and left 1080p unchecked, but it still did a 1080p version.
There are a couple things you can check. First, double-check your Automator workflow to make sure that both HD (720) and HD (1080p) are not checked. I've noticed that sometimes when you change the settings they don't get saved right away for whatever reason and you need to do a Save As.

Also note that an uncompressed 1080p MKV file is ALWAYS created if you're using MakeMKV, which should only take a few minutes.
The HD (1080p) option in the action, creates a compressed h.264 1080p mkv file using the uncompressed MakeMKV MKV file as the source for HandBrake.
The HD (720p) option in the action, creates a compressed h.264 720p mkv file using the uncompressed MakeMKV MKV file as the source for HandBrake.
mrwiggles wrote:Now if there was just some way to automate naming the encoded TV Show episodes so that I didn't have to check each file to confirm that it is the correct episode # and sequence. A service like Gracenote for DVDs and Bluray discs would be great!
Yes that would be great! Unfortunately, from my experience, there are too many variables that make it impossible to determine which episode is which without inspecting them. I've looked at using hash code libraries, but if you make the files yourself with HandBrake, the hash codes are different.

I hope this helps. Thanks, mac.jedi

brakestands
Posts: 58
Joined: Sun Oct 12, 2008 10:13 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by brakestands » Thu Nov 26, 2009 5:26 pm

Mac Jedi,

Now that 0.9.4 is out, and changes for instance for MetaX (which version), etc. I just installed the 64-bit 0.9.4 GA release, and am going to be implementing your workflow, which is extremely thorough and excellently written. I look forward to it, just didn't know if any substantive changes are in order now. My main goal is streamlining my workflow, especially as it relates to tagging and getting good cover art that looks nice on AppleTV, etc.

Thanks again for what you've done here, it is one of the best resources I've ever seen on the web. Congrats for the achievement.

Cheers!

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Thu Nov 26, 2009 5:46 pm

brakestands wrote:Mac Jedi,

Now that 0.9.4 is out, and changes for instance for MetaX (which version), etc. I just installed the 64-bit 0.9.4 GA release, and am going to be implementing your workflow, which is extremely thorough and excellently written. I look forward to it, just didn't know if any substantive changes are in order now. My main goal is streamlining my workflow, especially as it relates to tagging and getting good cover art that looks nice on AppleTV, etc.

Thanks again for what you've done here, it is one of the best resources I've ever seen on the web. Congrats for the achievement.

Cheers!
Hi brakestands,
Thanks for posting! I haven't had a chance to test HB 0.9.4 yet, but this workflow has been designed to work on all the latest snapshots up to the release of 0.9.4.

What about MetaX are you asking about?

Thanks, mac.jedi

siromega
Posts: 36
Joined: Mon Jul 02, 2007 5:06 am

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by siromega » Thu Nov 26, 2009 7:20 pm

Mac.jedi,

In one of the last few changes before 0.9.4, the devs made some changes to the presets (here). It might just be something you want to be aware of (if you weren't already). The 720p output (for AppleTV) will need the pweight=0 until Apple fixes their decoding bug...

Thanks again for the workflow.

nizz
Posts: 2
Joined: Thu Nov 26, 2009 11:16 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by nizz » Thu Nov 26, 2009 11:18 pm

when I insert a dvd into my mac (10.6 all updates) nothing comes up in the volumes folder so my workflows never get triggered

I'm using all 64 bit versions of all the software involved and have tried many different dvd's none of which mount in the volumes folder.

help?

nizz
Posts: 2
Joined: Thu Nov 26, 2009 11:16 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by nizz » Thu Nov 26, 2009 11:54 pm

I set up all the workflows and installed all the programs necessary except when I insert a dvd I get this error every time


ERROR: FairMount.app command tool is not setup to execute
ERROR: attempting to use tool at /Applications/FairMount/FairMount.app

ERROR: FairMount.app command tool could not be found
ERROR: FairMount.app can be installed in ./ /usr/local/bin/ /usr/bin/ ~/ or /Applications/

logout

[Process completed]

any help would be much appreciated, thanks!

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Fri Nov 27, 2009 2:57 pm

nizz wrote:

Code: Select all

    ERROR: FairMount.app command tool is not setup to execute
    ERROR: attempting to use tool at /Applications/FairMount/FairMount.app

    ERROR: FairMount.app command tool could not be found
    ERROR: FairMount.app can be installed in ./ /usr/local/bin/ /usr/bin/ ~/ or /Applications/
Hi nizz,

I'm sorry you are having problems. It looks like the Action can't find FairMount. The FairMount installer dmg should contain a folder which contains both versions (32 & 64 bit). This folder should be installed in your /Applications folder. VLC is a stand-alone application which should be installed in your /Applications folder. Note that VLC needs to be named: VLC and not be enclosed in any other folder. FairMount expects VLC in this location. You might want to try opening FairMount to see if it sees VLC, it should tell you if it's not, or if it's seeing an incompatible bit-version. Also, the last time I checked, there wasn't a 64-bit version of VLC 1.0.3, only 1.0.2, but this may have changed. It may be best just to go with the 32-bit versions until you get it working.

Next, open the workflow in Automator and in the Action setup panel, you need to target the correct version of FairMount (depending on the version of VLC), not the folder, in the pull-down menu. Once all your other settings have been made, Choose Save As… and save your workflow. Then try running the workflow again. Also, sometimes the workflow will not save the changes for whatever reason. Open the workflow again after closing to make sure the changes saved correctly.

Note: There is also a Service named "Batch Rip • Batch Rip (Service).workflow" that you can use to troubleshoot if you are having problems getting the folder action to trigger. To use it, right-click on the mounted dvd icon and run the service.

I hope this helps. Thanks, mac.jedi
Last edited by mac.jedi on Fri Nov 27, 2009 3:11 pm, edited 2 times in total.

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Fri Nov 27, 2009 3:06 pm

nizz wrote:when I insert a dvd into my mac (10.6 all updates) nothing comes up in the volumes folder so my workflows never get triggered

I'm using all 64 bit versions of all the software involved and have tried many different dvd's none of which mount in the volumes folder.

help?
Hi Again,

If you are still having problems getting the folder action to trigger, try these steps to troubleshoot:

TEST ONE:
  1. Navigate to /Users/username/Library/LaunchAgents/
  2. Select the following files and move them to the trash:
    • com.apple.FolderActions.enabled.plist
    • com.apple.FolderActions.folders.plist
  3. Create a new folder on your desktop named "test folder"
  4. Right-click on the "test folder" and Choose: Services > Folder Actions Setup…
  5. The Folder Action Setup Utility should launch and present the "Choose a Script to Attach:" pane
  6. Select the item named "add - new item alert.scpt", and Click > Attach
  7. Next, toggle the "Enable Folder Actions" check-box at the top of the window off and on. Uncheck to disable it, then Re-check the check-box to enable it.
  8. Close the Folder Action Setup Utility window.
  9. Now let's test your action. Drag any item into the "test folder" on your Desktop.
  10. A dialog box should open indicating whether a new item was added.
  11. If successful, congratulations you have a working folder action.
TEST TWO:
Next we're going to test the folder action on your /Volumes directory.
  1. Open a new Finder window.
  2. In the Main Menu, Select > Go > Go to Folder… (CMD+SHIFT+G).
  3. A drop-down window will appear in the Finder.
  4. In the "Go to the folder" text field, type: /Volumes
  5. Choose > Go
  6. Select the Volumes folder and attach the "add new item alert.scpt" as we did in the previous test by Right-clicking on the "Volumes" folder and Choosing: Services > Folder Actions Setup…
  7. In the "Choose a Script to Attach:" pane, Select the item named "add - new item alert.scpt", and Click > Attach
  8. Now let's test your action. Insert a DVD or mount a network drive
  9. A dialog box should open indicating whether the new item was added.
  10. If successful, congratulations we're almost there.
TEST THREE:
Next we're going to test the Batch Rip folder action on your /Volumes directory.
  1. Open a new Finder window.
  2. In the Main Menu, Select > Go > Go to Folder… (CMD+SHIFT+G).
  3. A drop-down window will appear in the Finder.
  4. In the "Go to the folder" text field, type: /Volumes
  5. Choose > Go
  6. Select the Volumes folder and attach the "Batch Rip • Batch Rip (Folder Action).workflow" as we did in the previous test by Right-clicking on the "Volumes" folder and Choosing: Services > Folder Actions Setup…
  7. In the "Choose a Script to Attach:" pane, Select the item named "Batch Rip • Batch Rip (Folder Action).workflow", and Click > Attach
  8. If the workflow is not in the list, you need to be sure it is installed in: /Users/username/Library/Workflows/Applications/Folder Actions/Batch Rip • Batch Rip (Folder Action).workflow
  9. Next we're going to turn off the "add new item alert.scpt" added from the previous test.
  10. In Folder Actions Setup, Select the Volumes folder on the left side panel.
  11. Select the item "add new item alert.scpt" and un-check the check-box to deactivate it. The "Batch Rip • Batch Rip (Folder Action).workflow" should remain checked/active.
  12. Now let's test your action. Insert a DVD and pray.
  13. If successful, congratulations you should be good to go.
  14. If not, try reactivating the "add new item alert.scpt" and turning off the "Batch Rip • Batch Rip (Folder Action).workflow"
Let me know how it goes.

Thanks, mac.jedi

coggsburn
Posts: 5
Joined: Wed Feb 04, 2009 5:04 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by coggsburn » Mon Nov 30, 2009 1:18 am

mac.jedi,

Brilliant post. I've been using handbrake automation for a while now and was very happy to see it's been updated to take advantage of the newest version of handbrake.

I do have one small problem, though. I used this argument " -U -F -N eng --decomb" to check and set subtitles and to do some deinterlacing since an unusually high number of my dvds are interlaced. My problem is that I'm not sure where to put this argument in now. I tried using the "Custom DVD Settings" in the Batch Rip • Batch Encode service, but that didn't seem to accomplish my task.

Am I understanding that box correctly but entering the arguments wrong? Or am I just all out of sorts?

thanks!
dennis

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Tue Dec 01, 2009 12:50 am

coggsburn wrote:mac.jedi,

Brilliant post. I've been using handbrake automation for a while now and was very happy to see it's been updated to take advantage of the newest version of handbrake.

I do have one small problem, though. I used this argument " -U -F -N eng --decomb" to check and set subtitles and to do some deinterlacing since an unusually high number of my dvds are interlaced. My problem is that I'm not sure where to put this argument in now. I tried using the "Custom DVD Settings" in the Batch Rip • Batch Encode service, but that didn't seem to accomplish my task.

Am I understanding that box correctly but entering the arguments wrong? Or am I just all out of sorts?

thanks!
dennis
Hi Dennis,

The custom settings do Indeed go in the text box. You also need to check the check-box for the custom setting. Your problem may be that your not using a complete set of arguments. Can you post the Terminal output? Also, decomb and detelecine are already set in the defaults, but if you use custom settings, the only arguments sent by batch encode to HB are the input/output paths and whatever is inserted in the text box.

I hope this helps. Thanks, mac.jedi

drawkward
Posts: 5
Joined: Wed Oct 07, 2009 4:21 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by drawkward » Tue Dec 01, 2009 5:28 am

mac.jedi

Many thanks for the tutorial and the scripts. They have already been very useful for me - ripping my dvd collection and encoding files automatically in the early morning.

Today, when encoding seven movies, the log file seems to show that each movie was encoded two times, and the length of time taken was about double what I expected. Any suggestions to fix the double encoding?

Clip from the terminal file:

Code: Select all

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROCESSING: The Big Lebowski (1998) 

*Scanning Folder: 'The Big Lebowski (1998)'
  Will encode the following tracks: 1, 2 


*Creating The Big Lebowski (1998).m4v
Using AC3/DVD-toolArgs: -e x264  -q 20.0 -a 1,1 -E ca_aac,ac3 -B 160,160 -6 dpl2,auto -R 48,Auto -D 0.0,0.0 -f mp4 -4 -X 720 --loose-anamorphic --decomb --detelecine -m -x cabac=0:ref=2:mixed-refs=1:me=umh

Muxing: this may take awhile... (118.53 fps, avg 70.49 fps, ETA 00h00m01s)

*Adding Meta Tags to The Big Lebowski (1998).m4v
  Searching TMDb for The+Big+Lebowski... Title found

*Writing tags with AtomicParsley
 Started writing to temp file.
102030405060708090100
 Finished writing to temp file.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

*Creating The Big Lebowski (1998).m4v
Using AC3/DVD-toolArgs: -e x264  -q 20.0 -a 1,1 -E ca_aac,ac3 -B 160,160 -6 dpl2,auto -R 48,Auto -D 0.0,0.0 -f mp4 -4 -X 720 --loose-anamorphic --decomb --detelecine -m -x cabac=0:ref=2:mixed-refs=1:me=umh

Muxing: this may take awhile... (112.47 fps, avg 70.99 fps, ETA 00h00m00s)

*Adding Meta Tags to The Big Lebowski (1998).m4v
  Searching TMDb for The+Big+Lebowski... 
*Writing tags with AtomicParsley
 Started writing to temp file.
102030405060708090100
 Finished writing to temp file.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

PROCESSING COMPLETE: The Big Lebowski (1998)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Thanks for any help.

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Tue Dec 01, 2009 8:48 pm

drawkward wrote:mac.jedi

Many thanks for the tutorial and the scripts. They have already been very useful for me - ripping my dvd collection and encoding files automatically in the early morning.

Today, when encoding seven movies, the log file seems to show that each movie was encoded two times, and the length of time taken was about double what I expected. Any suggestions to fix the double encoding?

Clip from the terminal file:

Code: Select all

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROCESSING: The Big Lebowski (1998) 

*Scanning Folder: 'The Big Lebowski (1998)'
  Will encode the following tracks: 1, 2 


*Creating The Big Lebowski (1998).m4v
Using AC3/DVD-toolArgs: -e x264  -q 20.0 -a 1,1 -E ca_aac,ac3 -B 160,160 -6 dpl2,auto -R 48,Auto -D 0.0,0.0 -f mp4 -4 -X 720 --loose-anamorphic --decomb --detelecine -m -x cabac=0:ref=2:mixed-refs=1:me=umh

Muxing: this may take awhile... (118.53 fps, avg 70.49 fps, ETA 00h00m01s)

*Adding Meta Tags to The Big Lebowski (1998).m4v
  Searching TMDb for The+Big+Lebowski... Title found

*Writing tags with AtomicParsley
 Started writing to temp file.
102030405060708090100
 Finished writing to temp file.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

*Creating The Big Lebowski (1998).m4v
Using AC3/DVD-toolArgs: -e x264  -q 20.0 -a 1,1 -E ca_aac,ac3 -B 160,160 -6 dpl2,auto -R 48,Auto -D 0.0,0.0 -f mp4 -4 -X 720 --loose-anamorphic --decomb --detelecine -m -x cabac=0:ref=2:mixed-refs=1:me=umh

Muxing: this may take awhile... (112.47 fps, avg 70.99 fps, ETA 00h00m00s)

*Adding Meta Tags to The Big Lebowski (1998).m4v
  Searching TMDb for The+Big+Lebowski... 
*Writing tags with AtomicParsley
 Started writing to temp file.
102030405060708090100
 Finished writing to temp file.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

PROCESSING COMPLETE: The Big Lebowski (1998)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Thanks for any help.
Hi drawkward,

Thanks for posting! There is an error in the code that returns the tracks for movies. It should only return 1 title, but for some DVDs it is returning more. It's been fixed in v1.0.4 which should be released very soon, provided I stop messing with it. :)

I should have it up in a day or two. Sorry for the extra encodes.

Thanks, mac.jedi

coggsburn
Posts: 5
Joined: Wed Feb 04, 2009 5:04 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by coggsburn » Wed Dec 02, 2009 11:21 pm

mac.jedi wrote:
Hi Dennis,

The custom settings do Indeed go in the text box. You also need to check the check-box for the custom setting. Your problem may be that your not using a complete set of arguments. Can you post the Terminal output? Also, decomb and detelecine are already set in the defaults, but if you use custom settings, the only arguments sent by batch encode to HB are the input/output paths and whatever is inserted in the text box.

I hope this helps. Thanks, mac.jedi
Thanks for getting back to me. Below is the output from the terminal. The last section might be irrelevant since it was starting another encode and I just grabbed everything above that. The arguments I put in the "Use Custom DVD Settings" box were "--preset=\"AppleTV\" -U -F -N eng", but the movie still came through without the subtitles.

I put in the AppleTV argument in because it creates the movie at a size I enjoy. Though that may have changed with the new version since it's coming in smaller than others had before. But no matter there, I can just make a new preset with the anamorphic settings once I get the subtitles to work.

dennis

Code: Select all

Last login: Wed Dec  2 14:06:03 on ttys000
/Users/[USER]/Library/Automator/Batch\ Encode.action/Contents/Resources/batchEncode.sh ; exit;
INTERNAL-HD:~ [USER]$ /Users/[USER]/Library/Automator/Batch\ Encode.action/Contents/Resources/batchEncode.sh ; exit;
/Users/[USER]/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: line 77: -U: command not found

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROCESSING: LIFE IS BEAUTIFUL 

*Scanning Folder: 'LIFE IS BEAUTIFUL'
  Will encode the following tracks: 1 


*Creating LIFE IS BEAUTIFUL.m4v
Using Custom/DVD-toolArgs: 

Muxing: this may take awhile... (566.11 fps, avg 319.82 fps, ETA 00h00m00s)

*Adding Meta Tags to LIFE IS BEAUTIFUL.m4v
  Searching TMDb for LIFE+IS+BEAUTIFUL... Title found
tr: Illegal byte sequence
Error: Error querying file
/Users/[USER]/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: line 1046: [: : integer expression expected

*Writing tags with AtomicParsley
 Started writing to temp file.
102030405060708090100
 Finished writing to temp file.
/Users/[USER]/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: line 1066: [: : integer expression expected
  Error: Cover art failed integrity test. No artwork was added
2009-12-02 15:05:30.138 osascript[23520:903] Error loading /Users/[USER]/Library/ScriptingAdditions/Property List Tools.osax/Contents/MacOS/Property List Tools:  dlopen(/Users/[USER]/Library/ScriptingAdditions/Property List Tools.osax/Contents/MacOS/Property List Tools, 262): no suitable image found.  Did find:
	/Users/[USER]/Library/ScriptingAdditions/Property List Tools.osax/Contents/MacOS/Property List Tools: no matching architecture in universal wrapper
osascript: OpenScripting.framework - scripting addition "/Users/[USER]/Library/ScriptingAdditions/Property List Tools.osax" declares no loadable handlers.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

PROCESSING COMPLETE: LIFE IS BEAUTIFUL
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2009-12-02 15:05:30.321 osascript[23523:903] Error loading /Users/[USER]/Library/ScriptingAdditions/Property List Tools.osax/Contents/MacOS/Property List Tools:  dlopen(/Users/[USER]/Library/ScriptingAdditions/Property List Tools.osax/Contents/MacOS/Property List Tools, 262): no suitable image found.  Did find:
	/Users/[USER]/Library/ScriptingAdditions/Property List Tools.osax/Contents/MacOS/Property List Tools: no matching architecture in universal wrapper
osascript: OpenScripting.framework - scripting addition "/Users/[USER]/Library/ScriptingAdditions/Property List Tools.osax" declares no loadable handlers.

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Thu Dec 03, 2009 12:54 am

coggsburn wrote:The arguments I put in the "Use Custom DVD Settings" box were "--preset=\"AppleTV\" -U -F -N eng", but the movie still came through without the subtitles.
Hi Again,

The arguments you are using are outdated. Are you using HandBrakeCLI v0.9.4? If not, go ahead and install it first. Then try the tips listed below. Also, it might be helpful for you to check out the updated HB commands.

To see the updated commands:

Code: Select all

/Applications/HandBrakeCLI -h
To see the updated preset arguments:

Code: Select all

/Applications/HandBrakeCLI -z
In regards to the commands you posted, I see the following:
First, the preset argument has changed from previous versions. You now use:

Code: Select all

--preset \"AppleTV\"
Next, the -U (--subtitle-scan) command is no longer supported. You need to use:

Code: Select all

--subtitle "scan"
In addition, you may have to use the --subtitle-burn if the subs are bitmap. I'm not that familiar with soft-subs and subs in general, but in my testing I've found them to be a bit error prone when it comes to automation.

Your "-N eng" command is fine.
coggsburn wrote:*Creating LIFE IS BEAUTIFUL.m4v
Using Custom/DVD-toolArgs:

*Adding Meta Tags to LIFE IS BEAUTIFUL.m4v
Searching TMDb for LIFE+IS+BEAUTIFUL... Title found
tr: Illegal byte sequence
Error: Error querying file
/Users/[USER]/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: line 1046: [: : integer expression expected

*Writing tags with AtomicParsley
Started writing to temp file.
102030405060708090100
Finished writing to temp file.
/Users/[USER]/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: line 1066: [: : integer expression expected
Error: Cover art failed integrity test. No artwork was added
I see that your source folder does not have a "(ReleaseYear)". I'd turn auto-tagging off if you are not gonna use the Renamer. Also, you should see your complete custom tools args after the "Using Custom/DVD-toolArgs:". It might be helpful to check it out from time to time to make sure your commands are being entered correctly.

Code: Select all

2009-12-02 15:05:30.138 osascript[23520:903] Error loading /Users/[USER]/Library/ScriptingAdditions/Property List Tools.osax/Contents/MacOS/Property List Tools:  dlopen(/Users/[USER]/Library/ScriptingAdditions/Property List Tools.osax/Contents/MacOS/Property List Tools, 262): no suitable image found.  Did find:
	/Users/[USER]/Library/ScriptingAdditions/Property List Tools.osax/Contents/MacOS/Property List Tools: no matching architecture in universal wrapper
osascript: OpenScripting.framework - scripting addition "/Users/[USER]/Library/ScriptingAdditions/Property List Tools.osax" declares no loadable handlers.
It looks like you have some incompatible ScriptingAdditions that may have been installed by 3rd Party apps. Snow Leopard should have told you about them when you upgraded or installed the apps. It's best to move them out the ScriptingAdditions folder as they are not compatible with 10.6. If there are upgrades available for those apps, I'd update them.

FYI, I'm going to post a new version of the Actions very soon. I hope this helps!

Thanks,

mac.jedi

coggsburn
Posts: 5
Joined: Wed Feb 04, 2009 5:04 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by coggsburn » Thu Dec 03, 2009 1:39 am

I've just glanced over your reply, but from what I've seen, that does help a lot. I installed the Handbrake CLI 0.9.4 but at the time, the wiki wasn't updated with new commands. My dumb ass should have read the man page…

I'll look into those scripting additions and keep an eye out for your updates.

Thanks so much for all your help!

dennis

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

ANNOUNCEMENT: BATCH RIP ACTIONS UPDATE

Post by mac.jedi » Thu Dec 03, 2009 2:40 am

ANNOUNCEMENT: BATCH RIP ACTIONS UPDATED


Update 2009-12-02

Release Notes
Batch Rip Actions for Automator 1.0.4

Everything
  • Provides general fixes that enhance the stability, compatibility and functionality of Batch Rip Actions for Automator. In other words, I fixed a lot of stuff, but forgot write them all down.
  • Updated installer package, should provide greater compatibility for those with unique system configurations.
  • Batch Rip • Batch Rip (Folder Action).workflow has been replaced by the new Batch Rip Dispatcher LaunchAgent.
  • Tutorial has been updated to reflect the changes of v1.0.4.
Batch Rip Dispatcher.action - NEW ACTION
  • This action controls the Batch Rip Dispatcher LaunchAgent which acts like a folder action to automatically launch Batch Rip when a disc is inserted.
  • IMPORTANT: The Batch Rip Folder Action is no longer supported. You need to Enable Batch Rip Dispatcher by running the Service after it is installed.
Tag Inspector.action - NEW ACTION
  • This action displays all the iTunes metadata present in the input file.
Get Source Info from HandBrake.action - NEW ACTION
  • This action scans each source with HandBrakeCLI and saves the info to a text file.
Batch Rip.action - UPDATED
  • Updated to version 1.0.4
  • Added support for Batch Rip Dispatcher
  • Changed the way variables are passed to the shell
  • Added an option to skip discs that already exist in the output folder or append the name of new copy.
  • Added an option to save Terminal output to ~/Library/Logs.
Batch Encode.action - UPDATED
  • Updated to version 1.0.4
  • Improved compatibility with HandBrake v0.9.4.
  • Fixed min/max title selection for Movies, where movies were returning more than one title.
  • Changed the way variables are passed to the shell, improves stability when running multiple instances
  • Added ISO8859-1 character substitution in meta-tag info.
  • The HandBrakeCLI title scan is now saved as a text file to the source directory.
  • Added an option to display a verbose activity log for HandBrake.
  • Terminal output from last session is now saved in ~/Library/Logs.
Add Movie Tags.action - UPDATED
  • Added support for Search & Tag. If enabled, will display a search field and return a list of matches instead of using filename.
  • Added ISO8859-1 character substitution in meta-tag info.
  • General improvements in returning titles, handling metadata and processing cover art.
  • Added option to remove all tags from the input file when the "Add tags" option is off.
Add TV Tags.action - UPDATED
  • Added ISO8859-1 character substitution in meta-tag info.
  • General improvements in returning episode info, handling metadata and processing cover art.
  • Added option to remove all tags from the input file when the "Add tags" option is off.
Rename Movie Items.action - UPDATED
  • Added underscore replacement when using file/folder name as search criteria.
  • Added ISO8859-1 character substitution.
  • General improvements in returning matching titles.
Add Movie Poster.action - UPDATED
  • Added underscore replacement when using file name as search criteria.
  • Added ISO8859-1 character substitution.
  • General improvements in returning matching titles.
Happy Encoding!
mac.jedi

drawkward
Posts: 5
Joined: Wed Oct 07, 2009 4:21 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by drawkward » Thu Dec 03, 2009 5:07 am

mac.jedi wrote: Thanks for posting! There is an error in the code that returns the tracks for movies. It should only return 1 title, but for some DVDs it is returning more. It's been fixed in v1.0.4 which should be released very soon, provided I stop messing with it. :)

I should have it up in a day or two. Sorry for the extra encodes.
Thank you for the 1.04 update - does it install over 1.03? or should I remove the 1.03 files?

Post Reply