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

lldubbs

macrumors newbie
Original poster
Apr 12, 2013
2
0
Hello,

I have a lot of family videos that I want to extract stills from. I use VLC to do this manually by using the following command in the terminal. But I get tired of typing in the command every time.

/Applications/VLC.app/Contents/MacOS/VLC /Users/mac/Downloads/1.mp4 --video-filter=scene --scene-prefix=movie --scene-ratio=48 --scene-path=/Users/mac/Desktop/images

I was wondering if there is a way to make an automator application so that I drop my video file on the automator application icon, then it reads the filename (ex "1.mp4") and puts in the terminal command above with the appropriate filename. For example, if I dropped a video named 32.mp4 on there, it would change the "1.mp4" in the line above to "34.mp4" and put that into terminal.

I've only done basic stuff with automator. Can someone show me the way, if this is possible.
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
You can use the Run Shell Script action, and set the option Pass input: as arguments. This will set up a script that loops through the items passed to the action - the default script just echoes the individual items, but you can put in your own script, for example:

Code:
for f in "$@"
do
  /Applications/VLC.app/Contents/MacOS/VLC "$f" --video-filter=scene --scene-prefix=movie --scene-ratio=48 --scene-path=/Users/mac/Desktop/images
done
 

lldubbs

macrumors newbie
Original poster
Apr 12, 2013
2
0
Good god, that was easy and painless. Worked beautifully! Thanks for your help! :)
 

ytk

macrumors 6502
Jul 8, 2010
252
5
FWIW, you can also make your script into a standalone application, bypassing Automator, using Platypus. You'd do it basically the same way, but I find Automator to be a bit slow and kludgy, and this way you can easily have the script output appear in a window if you like.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.