Run a function from while read line
I'm trying to run a function from while read line, the function contains
ffmpeg commands to marge two files. but for some reason it's running the
first $line and than breaks from loop.
"$filesList" contains three lines. I'm not sure what's wrong, but i can
confirm that opener function runs three times with echo "$OFILE" without
the ffmpeg commands, and only once with ffmpeg.
opener(){
OFILE="$1"
echo "$OFILE"
ffmpeg -i $opener_path -c copy -bsf:v h264_mp4toannexb -f mpegts
intermediate1.ts
ffmpeg -i $OFILE -c copy -bsf:v h264_mp4toannexb -f mpegts
intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy
-bsf:a aac_adtstoasc merge_$OFILE
mv merge_$OFILE $OFILE
rm intermediate1.ts intermediate2.ts
}
while read line; do
if [ -e "$line" ]; then
opener "$line"
fi
done <<< "$filesList"
No comments:
Post a Comment