Page 1 of 1

Help with VLC Shell Execution... Please.

PostPosted: Thu Sep 13, 2012 11:10 pm
by Brandon
Hey there!

I am trying to hack together a Shell script that will allow Hazel to look for a MOV file, and use VLC via command line to convert it to MP3.

I have successfully been able to get VLC to work via command line with this:

Code: Select all
vlc test.mov --intf=rc --sout="#transcode{acodec=mp3,ab=64}:standard{mux=ps,dst=/Users/Me/MyFileLocation/test.mp3,access=file}"


So then, I tried to convert this code into a shell script Hazel could use via Shell like, so:

Code: Select all
Shell: /bin/sh

filename=$(basename $1)
outputdir=$(dirname $1)

/Applications/VLC.app/Contents/MacOS/VLC filename.mov --intf=rc --sout="#transcode{acodec=mp3,ab=64}:standard{mux=ps,dst=outputdir/filename.mp3,access=file}"


I have no idea what went wrong... but when ran it... all hell broke loss :evil:

I'll be the first to admit - I am way over my head on this.

So any help would be greatly appreciated.

Thanks!!!

Re: Help with VLC Shell Execution... Please.

PostPosted: Fri Sep 14, 2012 4:28 pm
by Mr_Noodle
I don't know vlc that well but I do notice in one case, you are referring to vlc (all lowercase) and in another, VLC (all uppercase). In the latter case, it looks like you are invoking the GUI app, which doesn't seem correct to me. You may want to do "which vlc" to see which vlc you were using on the commandline before and use that full path in the script.

Re: Help with VLC Shell Execution... Please.

PostPosted: Thu Sep 27, 2012 12:36 am
by Brandon
Thanks for the response.

I think I had the script path incorrect.

In any case, I finally came up with a solution that works for my using FFMPEG.

I posted it HERE for others.

Thanks again for the pointers.

BTW - this post really helped me out

It should be sticky'd to the top of the support forum :)