AppleScript Help Needed
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.
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.
AppleScript Help Needed
Hi,
I have setup an AppleScript to convert EYETV files to smaller versions using HandbrakeCLI. I'm having a problem with 1 part - I cannot send the commands to handbrake properly. What I want to send to handbrake is ...
HandBrakeCLI -i inputfile -o outputfile --preset="AppleTV"
The code I am using is ...
set inputFile to currentFileName
set outputFile to text item 1 of currentFileName & ".mp4"
set shellCommand to "HandBrakeCLI -i " & inputFile & " -o " & outputFile & " --preset=" & quoted form of "AppleTV"
do shell script shellCommand
I have tried using "\ and quoted form of but still not getting it right, looking at the Events window, I'm not getting the right info being sent to HandBrake.
HandBrakeCLI & the input file are in the same folder.
Any help appreciated.
rgds mcdirt
I have setup an AppleScript to convert EYETV files to smaller versions using HandbrakeCLI. I'm having a problem with 1 part - I cannot send the commands to handbrake properly. What I want to send to handbrake is ...
HandBrakeCLI -i inputfile -o outputfile --preset="AppleTV"
The code I am using is ...
set inputFile to currentFileName
set outputFile to text item 1 of currentFileName & ".mp4"
set shellCommand to "HandBrakeCLI -i " & inputFile & " -o " & outputFile & " --preset=" & quoted form of "AppleTV"
do shell script shellCommand
I have tried using "\ and quoted form of but still not getting it right, looking at the Events window, I'm not getting the right info being sent to HandBrake.
HandBrakeCLI & the input file are in the same folder.
Any help appreciated.
rgds mcdirt
Re: AppleScript Help Needed
What exactly are the error messages you're seeing from (a) HandBrakeCLI and (b) AppleScript?
Cheers, Chris
Cheers, Chris
Last edited by Chris_BBR on Thu Feb 10, 2011 2:12 pm, edited 1 time in total.
Re: AppleScript Help Needed
Hi Chris,
Nothing from HandBrakeCLI that I can see, error from AppleScript is
do shell script "HandBrakeCLI -i '60 Minutes.eyetv' -o '60 Minutes.mp4' --preset='AppleTV'"
--> error number -1708
«event ascrgdut»
--> error number -1708
do shell script "HandBrakeCLI -i '60 Minutes.eyetv' -o '60 Minutes.mp4' --preset='AppleTV'"
--> error number -10004
Nothing from HandBrakeCLI that I can see, error from AppleScript is
do shell script "HandBrakeCLI -i '60 Minutes.eyetv' -o '60 Minutes.mp4' --preset='AppleTV'"
--> error number -1708
«event ascrgdut»
--> error number -1708
do shell script "HandBrakeCLI -i '60 Minutes.eyetv' -o '60 Minutes.mp4' --preset='AppleTV'"
--> error number -10004
Re: AppleScript Help Needed
Does "HandBrakeCLI -i '60 Minutes.eyetv' -o '60 Minutes.mp4' --preset='AppleTV'" work if you run it directly from the command line?
Cheers, Chris
Cheers, Chris
Re: AppleScript Help Needed
And is that folder in your PATH? Try specifying the full path to HandBrakeCLI.mcdirt wrote:HandBrakeCLI & the input file are in the same folder.
Re: AppleScript Help Needed
That was going to be my next question! Step by step... :DRodeo wrote:And is that folder in your PATH? Try specifying the full path to HandBrakeCLI.
Cheers, Chris
Re: AppleScript Help Needed
EYETV files, HandBrake & script all in same folder. At airport waiting for flight - will try Handbrake directly tomorrow, thanks.
rgds mcdirt
rgds mcdirt
Re: AppleScript Help Needed
But that's not the folder that AppleScript itself runs from, and therefore calls 'do shell script' from.mcdirt wrote:EYETV files, HandBrake & script all in same folder.
As a result, you'll have to either add your working folder to PATH as Rodeo suggests, or pass the full POSIX '/path/to/HandBrakeCLI' to 'do shell script', before AppleScript can find HandBrakeCLI.
Either way, you'll also need to cite the full POSIX paths to your input and output files for all activity to take place in your working folder.
Get the process working with a sample encode from the command line first, and then patch that back into your script and progressively drop in your variables until you're where you need to be.
Cheers, Chris
Re: AppleScript Help Needed
Very helpful, many thanks - I'll try all that soon as I can.
Thanks again.
rgds mcdirt
Thanks again.
rgds mcdirt
Re: AppleScript Help Needed
I checked my previous code and that had all the path names etc in it - moving everything into the one folder was an attempt to try and simplify things. I think the problem is with my commands to Handbrake - in Terminal, if I type in ...
/Applications/HandBrakeCLI -i "/users/mcdirt/documents/eyetv archive/60 Minutes.eyetv" -o "/users/mcdirt/documents/eyetv archive/60 Minutes.mp4" --preset="AppleTV"
then I get this text message from Handbrake ...
[10:35:20] hb_init: checking cpu count
[10:35:20] hb_init: starting libhb thread
HandBrake 0.9.5 (2011010300) - Darwin x86_64 - http://handbrake.fr
2 CPUs detected
Opening /users/mcdirt/documents/eyetv archive/60 Minutes.eyetv...
[10:35:20] hb_scan: path=/users/mcdirt/documents/eyetv archive/60 Minutes.eyetv, title_index=1
libbluray/bdnav/index_parse.c:157: indx_parse(): error opening /users/mcdirt/documents/eyetv archive/60 Minutes.eyetv/BDMV/index.bdmv
libbluray/bluray.c:960: nav_get_title_list(/users/mcdirt/documents/eyetv archive/60 Minutes.eyetv) failed (0x10182aa00)
[10:35:20] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdread: Couldn't find device name.
libdvdnav:DVDOpenFilePath:findDVDFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFilePath:findDVDFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[10:35:20] dvd: not a dvd - trying as a stream/file instead
[10:35:20] hb_stream_open: open /users/mcdirt/documents/eyetv archive/60 Minutes.eyetv/000000001233a8f1.eyetvp failed
[10:35:20] libhb: scan thread found 0 valid title(s)
No title found.
HandBrake has exited.
Can anyone tell from this what is wrong?
Thankb
rgds mcdirt
/Applications/HandBrakeCLI -i "/users/mcdirt/documents/eyetv archive/60 Minutes.eyetv" -o "/users/mcdirt/documents/eyetv archive/60 Minutes.mp4" --preset="AppleTV"
then I get this text message from Handbrake ...
[10:35:20] hb_init: checking cpu count
[10:35:20] hb_init: starting libhb thread
HandBrake 0.9.5 (2011010300) - Darwin x86_64 - http://handbrake.fr
2 CPUs detected
Opening /users/mcdirt/documents/eyetv archive/60 Minutes.eyetv...
[10:35:20] hb_scan: path=/users/mcdirt/documents/eyetv archive/60 Minutes.eyetv, title_index=1
libbluray/bdnav/index_parse.c:157: indx_parse(): error opening /users/mcdirt/documents/eyetv archive/60 Minutes.eyetv/BDMV/index.bdmv
libbluray/bluray.c:960: nav_get_title_list(/users/mcdirt/documents/eyetv archive/60 Minutes.eyetv) failed (0x10182aa00)
[10:35:20] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdread: Couldn't find device name.
libdvdnav:DVDOpenFilePath:findDVDFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFilePath:findDVDFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[10:35:20] dvd: not a dvd - trying as a stream/file instead
[10:35:20] hb_stream_open: open /users/mcdirt/documents/eyetv archive/60 Minutes.eyetv/000000001233a8f1.eyetvp failed
[10:35:20] libhb: scan thread found 0 valid title(s)
No title found.
HandBrake has exited.
Can anyone tell from this what is wrong?
Thankb
rgds mcdirt
Re: AppleScript Help Needed
Try pointing HandBrakeCLI directly at the actual recording file (.mpg, .mp4, etc.) that lives inside the .eyetv package.
If that doesn't work, export the recording from EyeTV as 'MPEG Program Stream' (this should just dump out the raw recording immediately rather than take time doing any transcoding) and point HB at that.
Also, what type of EyeTV recording is this -- analogue SD, digital SD, HD etc (show 'Details' in the 'Save As' dialog above)?
Cheers, Chris
If that doesn't work, export the recording from EyeTV as 'MPEG Program Stream' (this should just dump out the raw recording immediately rather than take time doing any transcoding) and point HB at that.
Also, what type of EyeTV recording is this -- analogue SD, digital SD, HD etc (show 'Details' in the 'Save As' dialog above)?
Cheers, Chris
-
- Posts: 1
- Joined: Sun Feb 13, 2011 12:22 pm
Re: AppleScript Help Needed
Check out http://www.mos-eisley.dk/MCE/Apple%20Me ... rt.sh.aspx
PS: Currently I am working on various improvements like better quality (High-Profile preset is not good) and forced subtitles..
PS: Currently I am working on various improvements like better quality (High-Profile preset is not good) and forced subtitles..
Re: AppleScript Help Needed
moseisleydk wrote:(High-Profile preset is not good)
You're not using it. There's no preset called "High" and the defaults are FFmpeg MPEG-4 Visual at 1000 Kbps, single pass; no wonder it looks bad.http://www.mos-eisley.dk/MCE/Apple%20Media%20Center/eyetvexport.sh.aspx wrote:Code: Select all
/Applications/HandBrakeCLI […] --preset High Profile > eyetvexport.log
Code: Select all
--preset="High Profile"
Re: AppleScript Help Needed
Finally found something that works - needs the "--main-feature" at the end, thanks for all help - here's the code that works ...
--Start the conversion
set shellCommand to " /Applications/HandBrakeCLI --preset=" & quoted form of "AppleTV" & " -i " & quoted form of inputFile & " -o " & quoted form of outputFile & " --main-feature"
set results to do shell script shellCommand
rgds mcdirt
--Start the conversion
set shellCommand to " /Applications/HandBrakeCLI --preset=" & quoted form of "AppleTV" & " -i " & quoted form of inputFile & " -o " & quoted form of outputFile & " --main-feature"
set results to do shell script shellCommand
rgds mcdirt
Re: AppleScript Help Needed
Well done -- good to know for the future.
Cheers, Chris
Cheers, Chris
Re: AppleScript Help Needed
mcdirt,
Can you post your script somewhere? This is exactly what I'm trying to do. Thanks.
Can you post your script somewhere? This is exactly what I'm trying to do. Thanks.