Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Silverback803

macrumors newbie
Sep 23, 2012
1
0
U.S.A
Brand newbee

I've downloaded HandbrakeCLI, but have never worked with automator or using scripts. Can anyone dumbify this for me. Maybe give me a script and explain what each part is for? Any help would really be appreciated.
 

RaceTripper

macrumors 68030
May 29, 2007
2,867
178
I've downloaded HandbrakeCLI, but have never worked with automator or using scripts. Can anyone dumbify this for me. Maybe give me a script and explain what each part is for? Any help would really be appreciated.

Did you read Post #1? Seriously, it's well documented. I don't see how it can be improved or dumbed down any more. Follow that and come back here for help and answers to questions if you get stuck at any part. Honestly, if the instructions and utilizing this thread for help are too much for you, you might be getting in over your head anyway. :)
 

gunthermic

macrumors 6502
Sep 15, 2010
262
2
I cant speak to what is going on, I dont do much with BluRay anything, but are you just hacking that off via hazel rule to fix it and move on?

Still fo rthe life of me cant figure out why with mkv they all end with t100 instead of the year when it's being ripped. I have updated to newest MakeMKV always the same... Is no-one else havign isue?
 

jmfinn9

macrumors newbie
Sep 26, 2012
8
0
sed errors and missing audio info

I think both of the problems below are related - sed needs the -E flag to use the '+' (I think). I made the changes below to batchEncode.sh (make a backup before doing this - and no warranty is implied...)

Also batchEncode.sh is located in:
Code:
/Applications/Batch Rip Actions for Automator.app/Contents/Library/Automator/Batch Encode.action/Contents/Resources


Code:
$ diff orig.sh batchEncode.sh 
1151c1151
< 	audioInfo=`echo "$scanFile" | egrep "\+ [0-9],.*$nativeLanguage.*Hz" | egrep '(DTS|AC3)' | grep "5.1" | egrep -m1 "" | sed 's|^.*\+ ||'`
---
> 	audioInfo=`echo "$scanFile" | egrep "\+ [0-9],.*$nativeLanguage.*Hz" | egrep '(DTS|AC3)' | grep "5.1" | egrep -m1 "" | sed -E 's|^.*\+ ||'`
1153c1153
< 		audioInfo=`echo "$scanFile" | egrep "\+ [0-9],.*$nativeLanguage.*Hz" | egrep -m1 "" | sed 's|^.*\+ ||'`
---
> 		audioInfo=`echo "$scanFile" | egrep "\+ [0-9],.*$nativeLanguage.*Hz" | egrep -m1 "" | sed -E 's|^.*\+ ||'`
1157c1157
< 		audioInfo=`echo "$scanFile" | egrep "\+ [0-9],.*$trackLanguage.*Hz" | egrep '(DTS|AC3)' | grep "5.1" | egrep -m1 "" | sed 's|^.*\+ ||'`
---
> 		audioInfo=`echo "$scanFile" | egrep "\+ [0-9],.*$trackLanguage.*Hz" | egrep '(DTS|AC3)' | grep "5.1" | egrep -m1 "" | sed -E 's|^.*\+ ||'`
1160c1160
< 		audioInfo=`echo "$scanFile" | egrep -A 1 'audio tracks' | egrep "\+ [0-9],.*iso639-2:" | sed 's|^.*\+ ||'`
---
> 		audioInfo=`echo "$scanFile" | egrep -A 1 'audio tracks' | egrep "\+ [0-9],.*iso639-2:" | sed -E 's|^.*\+ ||'`


mac.jedi,

I noticed another issue I think is caused by Mountain Lion.

The ${audioTrack} variable doesn't seem to get set correctly. So when my job runs I end up seeing "-a , " instead of "-a 1,1" in the HandBrakeCLI preset. I use custom presets.

This ends up causing HandBrake to convert DTS to AC3 with a bitrate of 192Kb/s, which sounds really bad. It took me a while to figure out what was causing it... :)

BS

The batchEncode script is throwing a sed error with Mountain Lion. It still seems to work though. Just a heads up MacJedi.

*Extracting PGS Subtitle Tracks from temp file…
Progress: 100%
Converting PGS subtitle tracks to VOBSUB…

*Muxing Main Video, Audio (A_AC3-eng) and Subtitle Tracks from temp files
Progress: 100%

sed: 1: "s|^.*\+ ||": RE error: repetition-operator operand invalid
sed: 1: "s|^.*\+ ||": RE error: repetition-operator operand invalid
sed: 1: "s|^.*\+ ||": RE error: repetition-operator operand invalid
sed: 1: "s|^.*\+ ||": RE error: repetition-operator operand invalid

BS
 

gunthermic

macrumors 6502
Sep 15, 2010
262
2
Still fo rthe life of me cant figure out why with mkv they all end with t100 instead of the year when it's being ripped. I have updated to newest MakeMKV always the same... Is no-one else havign isue?

Nobody? it happenes when I rip a blue ray. MakeMKV or the batch is not sendign or renaming movie rip correctly. I use the Rename Movie to fix it after ripping.. but with havign to do this. i can't automate it anymore.
 

desonos

macrumors newbie
Oct 2, 2012
1
0
More Mountain Lion issues

The above post regarding sed & -E was helpful; fixed my DVD encoding issues. But I still have issues encoding BluRay rips; when it goes to do the subtitle extraction, I get the following:

*Extracting PGS Subtitle Tracks from temp file…
/Applications/Batch Rip Actions for Automator.app/Contents/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: eval: line 981: syntax error near unexpected token `('
/Applications/Batch Rip Actions for Automator.app/Contents/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: eval: line 981: `/Applications/Mkvtoolnix.app/Contents/MacOS/mkvextract tracks "/Volumes/MacOS Storage/Users/jrice/Movies/Batch Rip TV/The Walking Dead - S2D1-1/The Walking Dead - S2D1-1.mkv" 4:"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-4.sup" (track:"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-(track.sup" ID:"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-ID.sup" for:"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-for.sup" mkvmerge:"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-mkvmerge.sup" &:"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-&.sup" mkvextract::"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-mkvextract:.sup" 3):"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-3).sup" > /tmp/batchEncode_7730/TheWalkingDeadS2D11/1-mkvextract.txt'
cat: /tmp/batchEncode_7730/TheWalkingDeadS2D11/1-mkvextract.txt: No such file or directory

*Muxing Main Video, Audio (A_AC3-eng) and Subtitle Tracks from temp files
/Applications/Batch Rip Actions for Automator.app/Contents/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: eval: line 1049: syntax error near unexpected token `('
/Applications/Batch Rip Actions for Automator.app/Contents/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: eval: line 1049: `"/Applications/Mkvtoolnix.app/Contents/MacOS/mkvmerge" -o "/Volumes/MacOS Storage/Users/jrice/Movies/Batch Rip TV/The Walking Dead - S2D1-1/The Walking Dead - S2D1-1-1.mkv" -a 1,2 (track ID for mkvmerge & mkvextract: 1) -S "/Volumes/MacOS Storage/Users/jrice/Movies/Batch Rip TV/The Walking Dead - S2D1-1/The Walking Dead - S2D1-1.mkv" > /tmp/batchEncode_7730/TheWalkingDeadS2D11/1-mkvmerge.txt'
cat: /tmp/batchEncode_7730/TheWalkingDeadS2D11/1-mkvmerge.txt: No such file or directory

I'm not exactly sure what's going on here; anyone have any ideas?

Thanks,
 

jmfinn9

macrumors newbie
Sep 26, 2012
8
0
My guess is that your version of MKVtoolnix is newer than the version the author developed with - you might want to try to download 4.9.1 version (http://jonthn.free.fr/MKVtoolnix/old/) and try it again.

The above post regarding sed & -E was helpful; fixed my DVD encoding issues. But I still have issues encoding BluRay rips; when it goes to do the subtitle extraction, I get the following:

*Extracting PGS Subtitle Tracks from temp file…
/Applications/Batch Rip Actions for Automator.app/Contents/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: eval: line 981: syntax error near unexpected token `('
/Applications/Batch Rip Actions for Automator.app/Contents/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: eval: line 981: `/Applications/Mkvtoolnix.app/Contents/MacOS/mkvextract tracks "/Volumes/MacOS Storage/Users/jrice/Movies/Batch Rip TV/The Walking Dead - S2D1-1/The Walking Dead - S2D1-1.mkv" 4:"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-4.sup" (track:"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-(track.sup" ID:"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-ID.sup" for:"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-for.sup" mkvmerge:"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-mkvmerge.sup" &:"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-&.sup" mkvextract::"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-mkvextract:.sup" 3):"/tmp/batchEncode_7730/TheWalkingDeadS2D11/title01/subtitle-3).sup" > /tmp/batchEncode_7730/TheWalkingDeadS2D11/1-mkvextract.txt'
cat: /tmp/batchEncode_7730/TheWalkingDeadS2D11/1-mkvextract.txt: No such file or directory

*Muxing Main Video, Audio (A_AC3-eng) and Subtitle Tracks from temp files
/Applications/Batch Rip Actions for Automator.app/Contents/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: eval: line 1049: syntax error near unexpected token `('
/Applications/Batch Rip Actions for Automator.app/Contents/Library/Automator/Batch Encode.action/Contents/Resources/batchEncode.sh: eval: line 1049: `"/Applications/Mkvtoolnix.app/Contents/MacOS/mkvmerge" -o "/Volumes/MacOS Storage/Users/jrice/Movies/Batch Rip TV/The Walking Dead - S2D1-1/The Walking Dead - S2D1-1-1.mkv" -a 1,2 (track ID for mkvmerge & mkvextract: 1) -S "/Volumes/MacOS Storage/Users/jrice/Movies/Batch Rip TV/The Walking Dead - S2D1-1/The Walking Dead - S2D1-1.mkv" > /tmp/batchEncode_7730/TheWalkingDeadS2D11/1-mkvmerge.txt'
cat: /tmp/batchEncode_7730/TheWalkingDeadS2D11/1-mkvmerge.txt: No such file or directory

I'm not exactly sure what's going on here; anyone have any ideas?

Thanks,
 

imahawki

macrumors 6502a
Apr 26, 2011
612
8

I could be wrong but I don't believe that string accounts for forced subtitles. For example I ripped and converted my Avatar BD and when I watched it there were no subtitles. I've added -F to the string you posted and am re-doing Avatar as a test, but its going to cost me re-encoding about 12 Blu-Rays... Something others might want to watch for. I'm surprised how many movies have a few lines or a single scene with subtitles.

If I'm wrong, please let me know, but I think what I'm saying is correct.
 

imahawki

macrumors 6502a
Apr 26, 2011
612
8
Just inserting -F did not resolve the issue. Perhaps I've ripped these disks wrong. I'm continuing to work through this with Avatar as a use case.
 

Chimaera

macrumors regular
Nov 15, 2002
181
0
Just inserting -F did not resolve the issue. Perhaps I've ripped these disks wrong. I'm continuing to work through this with Avatar as a use case.

Avatar BR is impressively annoying - different versions of the Blu Ray have different subtitle setups. I would suggest using Make MKV and doing two rips - one with all subtitles and one with all subtitles AND forced only ticked. You'll end up with two MKVs, each of which will likely have a number of subtitle tracks attached. Fire them up in VLC and page through the available subtitles til you find the right one. Then either a) rerip with just that one subtitle selected or b) use MKVTOOLNIX to remove the other tracks for simplicities sake.

For what its worth on my copy (UK version of the directors cut 2D three disk BR) the subtitle track I wanted was the 2nd English Language one with forced subs only *not* selected - that was the Naa-Vi to English only subtitle track. I seem to recall the first version I had (the original theatrical-only BR) had a different subtitle track.
 

imahawki

macrumors 6502a
Apr 26, 2011
612
8
So it sounds like Avatar is just especially problematic. I'll have to go through my BD collection and look for other movies that I KNOW have subtitles to refine my workflow. I don't want to burn up my CPU on 4 hour encodes per movie only to have missing subtitles.
 

imahawki

macrumors 6502a
Apr 26, 2011
612
8
Avatar BR is impressively annoying - different versions of the Blu Ray have different subtitle setups. I would suggest using Make MKV and doing two rips - one with all subtitles and one with all subtitles AND forced only ticked. You'll end up with two MKVs, each of which will likely have a number of subtitle tracks attached. Fire them up in VLC and page through the available subtitles til you find the right one. Then either a) rerip with just that one subtitle selected or b) use MKVTOOLNIX to remove the other tracks for simplicities sake.

For what its worth on my copy (UK version of the directors cut 2D three disk BR) the subtitle track I wanted was the 2nd English Language one with forced subs only *not* selected - that was the Naa-Vi to English only subtitle track. I seem to recall the first version I had (the original theatrical-only BR) had a different subtitle track.

On my copy this strategy doesn't appear to be working. I end up with two English subtitles and when I pick them in VLC they both display both English and "Navi". In the scene where they first bring Jake to the tree, I am getting the Navi subs but when Jake says "What's he saying" that shows on the screen too. This happens with BOTH subtitle tracks. Ugh, what a pain. Any ideas?
 

imahawki

macrumors 6502a
Apr 26, 2011
612
8
I was able to resolve this by upgrading to the nightlies of Handbrake (did the CLI and the GUI just to be sure). Then I just used the batch rip tool and batch encoded and the subtitles appear to be correct.
 

jcharr1

macrumors newbie
Oct 15, 2012
1
0
Thank you SO much for this wonderful batch of scripts. I recently got a Roku for our living room which is being served by Plex on a Mac Mini. I have a little over 100 DVD ISOs of TV shows which Plex can't stream to network clients. Your batch encode action is saving me loads of time and trouble converting them to individual episodes that Plex can stream.

I already ripped many of my DVD to full complete ISO file. Is it possible to use this encoding batch with those file, just to convert them to a single (or multiple if it's a TV show) file?

Using "Handbrake" manually to convert more than 50 DVD is a real pain...!
While I don't know of a way to automatically mount/umount the ISOs (though I imagine it wouldn't be too difficult to modify the script to scan through looking for ISOs in your rip folder and mount them. I haven't tried this myself yet), what I know does work is manually mounting the ISOs, making sure batch encode scans for optical discs, and then run the batch encode. I'm not sure how many images OS X can mount at once, but what I've been doing is mounting them in groups, batch encoding, and then unmounting those and mounting a new group. It seems to be working well so far.
 

linds15

macrumors 6502a
Oct 16, 2012
535
1
Great White North
read the tutorial, and maybe i just missed it. but my question is this:
i have a vast tv collection that i've amounted over the years, and its all organized as follow (using seinfeld as example)
Folder (Seinfeld) --> Folder (Season 1) --> 101 - Pilot etc...
is there any way to metatag all my files that are like this? i manually changed all the files over time, but now want it to be properly organized in itunes as opposed to just on my hard drive

thanks
 

AppleDApp

macrumors 68020
Jun 21, 2011
2,413
45
read the tutorial, and maybe i just missed it. but my question is this:
i have a vast tv collection that i've amounted over the years, and its all organized as follow (using seinfeld as example)
Folder (Seinfeld) --> Folder (Season 1) --> 101 - Pilot etc...
is there any way to metatag all my files that are like this? i manually changed all the files over time, but now want it to be properly organized in itunes as opposed to just on my hard drive

thanks

I'm looking to do the same thing. How would it appear on the Apple tv? Can it be organized with folders as such?
 

kizandtango

macrumors newbie
Oct 22, 2012
1
0
Need to add eng Subs to ALL encodes

Sorry if this is a stupid question, but I just CANNOT get my head around adding subs to encodes, so hoped you could help.

Ive got the iPad preset in the custom area, so thats not a problem. What I need to know, is exactly what to put, (and where to put it) in that preset code to get English subtitles burnt into every encode I make. Basically I want subs on everything that passes through the workflow. Can someone help me out? Completely and utterly stuck !

On another note, thank you SO much for making this ! Ive been looking for something to batch convert for years ! Subtitles have always been the stumbling block when it comes to these things, so I really hope you guys can help!

Cheers

Pete
 

cannfoddr

macrumors newbie
Oct 28, 2012
14
3
Rename Movie Flow problems

Hi,

I have been using these flows for ages now without any issues. I am trying to do a finder Services -> Rename Movie Items workflow against a file named "Toy_Story_3_(Disc 1).mkv". I run the workflow and it prompts me for a name - "Toy Story 3" it goes off and searches for movies.

It then comes back with a list of totally unrelated movies "Eternal Sunshine of the Spotless Mind" and half a dozen others.

I have pulled the code apart and can see the curl command that accesses the movie DB. I have hand crafted a search url with "Toy+Story+3" and I get reasonable looking data back.

I dont understand why running the script through automator is failing to find the movie - I dont know enough to debug your actions.

Any thoughts????


Adrian
 

Fed

macrumors 6502
Jul 7, 2012
409
0
Liverpool.
To save the creation of a thread...

Is there a way to limit Handbrake to a specific % of CPU or physical/virtual cores to use?
 

HackerJL

macrumors regular
Sep 19, 2009
212
62
I'm looking to do the same thing. How would it appear on the Apple tv? Can it be organized with folders as such?

Maybe I need to ask a few more questions...Why do you need it organized more than itunes already does?

If you have itunes setup to organize things for you, it will sort it into that type of folder structure based on the metadata.

When I rip my tv shows, using these scripts, I just have hazel drop them into the itunes 'automatically add to itunes' or just drop them into the library manually, and itunes will move them to the library, and sorted, renamed, etc from there.

So...either that helped, or I missed completely what you were asking...
 

AppleDApp

macrumors 68020
Jun 21, 2011
2,413
45
Maybe I need to ask a few more questions...Why do you need it organized more than itunes already does?

If you have itunes setup to organize things for you, it will sort it into that type of folder structure based on the metadata.

When I rip my tv shows, using these scripts, I just have hazel drop them into the itunes 'automatically add to itunes' or just drop them into the library manually, and itunes will move them to the library, and sorted, renamed, etc from there.

So...either that helped, or I missed completely what you were asking...

Currently my tv shows are organised as such


show 1/season 1
show 1/ season 2
show 1/ season 3

I want it to be

Show 1 then I double click to see every season and from there I can chose which season adn episode I want to watch.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.