[FFmpeg-user] strange ffmpeg effect on bash
Lars Täuber
lars.taeuber at gmx.net
Mon Apr 4 21:50:09 CEST 2011
Hi,
I've got a problem with ffmpeg in a shell script.
It's a bash script to be precise.
The script looks like this:
===================
#!/bin/bash
LOG=${0%.sh}.log
ERR=${0%.sh}.err
JOBS=jobs.lst
>"$LOG"
>"$ERR"
while read LINE
do
FILE=""
NAME=""
eval $LINE
test -z "$NAME" -o ! -r "$FILE" && continue
ffmpeg -an -sn -i "$FILE" -vcodec ffvhuff -t 30 -f matroska -y "$NAME.mkv" >>"$LOG" 2>>"$ERR"
# mencoder -ovc copy -oac pcm -o "$NAME.avi" -endpos 30 "$FILE" >>"$LOG" 2>>"$ERR"
echo $? >> "$LOG"
done < "$JOBS"
echo "Ende" >> "$LOG"
===================
With the ffmpeg command the script ends after the first line read from "$JOBS". Somehow bash interpretes its completion like a »break« command.
When you replace the ffmpeg command with the (commented out) mplayer command (or any other programm) all lines from "$JOBS" are read and interpreted as expected.
The "$JOBS" file looks like this:
===================
FILE=a.avi;NAME=b
FILE=c.avi;NAME=d
FILE=e.avi;NAME=e
===================
How comes?
What's the special thing here with ffmpeg?
Maybe I should ask this on a bash mailing list?
Thanks
Lars
PS:
GNU bash, Version 4.2.8(1)-release (x86_64-pc-linux-gnu)
FFmpeg version git-N-28820-g7f125c3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: e.sh
Type: text/x-sh
Size: 433 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20110404/0b5ec4d0/attachment-0001.bin>
More information about the ffmpeg-user
mailing list