You are not logged in.

#1 2010-01-25 23:45:42

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,799
Website

Handbrake can't be scripted?

i have a simple script to batch convert some ISO's to mp4.  something like this:

find $RIPS -name '*.iso' | while read rip; do
  handbrake -i $rip -o ${rip//iso/mp4}
done

there's some more things going on, functions, logging, more options, etc.  that can all be viewed here if you'd like.

what i'm noticing is that regardless of the exit status of handbrake the while loop quits after the first record.  if i replace the handbrake command with a simple echo all works as intended.

so what gives?

i remember running into this before with a simple `for file in ./*; do handbrake... ; done`.  exact same quit-after-first-record behavior.

can anyone reproduce this?

EDIT:

well that's dumb.  this seems to work:

while whatever; do

  nice -n 15 handbrake -i "$1" -L -o "$mov" -f mp4 -q 1.0 2>/dev/null &
  pid=$!

  while ps -A | grep -q ^$pid; do sleep 1; done

done

weird.  i'll leave this open for a bit in case anyone has a "fix".  then i'll [SOLVED] it.

Last edited by brisbin33 (2010-01-26 00:49:28)

Offline

Board footer

Powered by FluxBB