Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a pretty simple shell script and after doing the first two jobs, it just stops and sits there, doesnt do anything, it doesnt seem to matter what the third job is, if I switch the order etc, it will not finish it.

Any ideas would be great...

Here is my shell script

for f in "$@"
do
name=$(basename "$f")
dir=$(dirname "$f")
/opt/local/bin/ffmpeg -i "$f" -y -b 250k -deinterlace -vcodec vp8 -acodec libvorbis -nostdin "$dir/webm/${name%.*}.webm"
/opt/local/bin/ffmpeg -i "$f" -y -b 250k -strict experimental -deinterlace -vcodec h264 -acodec aac -nostdin "$dir/mp4/${name%.*}.mp4"
/opt/local/bin/ffmpeg -i "$f" -y -ss 00:00:15.000 -deinterlace -vcodec mjpeg -vframes 1 -an -f rawvideo -s 720x480 "$dir/img/${name%.*}.jpg"
done

This may help, as I am running this script within Automator, which may be part of the issue...it seems like it is timing out and then just sits there...

enter image description here

share|improve this question

closed as too localized by slhck Feb 15 '13 at 13:29

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
What's the purpose of the backticks? –  Dennis Feb 14 '13 at 19:36
    
Saw it in another script, thought it may help...but other than that, there is non...they are actually removed now –  Chris James Champeau Feb 14 '13 at 19:37
    
Where exactly does it stop? Does it actually call ffmpeg? Does it work if you use something other than ffmpeg? (Note that the order of your FFmpeg options is a little off in your case. It probably doesn't matter, but global options like -y, -nostdin should always come first.) What happens when you put all the commands in a subshell (i.e. in parentheses (ffmpeg -i … ))? –  slhck Feb 14 '13 at 20:07
    
I moved -y and -nostdin to the beginning, but putting each subshell in parentheses throws an error, syntax error near unexpected token ')' –  Chris James Champeau Feb 14 '13 at 20:17
    
Please update your post with the syntax you were using for subshells. What about other commands than FFmpeg? –  slhck Feb 14 '13 at 21:26

Browse other questions tagged or ask your own question.