help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] help - optimization wanted for little script - batch convert


From: Luigi Rensinghoff
Subject: [Help-bash] help - optimization wanted for little script - batch converting audio files
Date: Thu, 10 Jul 2014 16:28:52 +0200

Hi List

        hoping that this might be the right forum for this kind of question:

I have this little - very simple script .. which works fine in one folder, with 
files and folders without "spaces"

#!/bin/sh

for f in *C.aif;
do
#echo "Processing $f"
prefix=${f%}
pre=`echo $prefix | sed 's/.\{6\}$//'`
L=`echo $pre-\(L\).aif`
R=`echo $pre-\(R\).aif`
C=`echo $pre-C.aif`
LFE=`echo $pre-\LFE\.aif`
Ls=`echo $pre-S\(L\).aif`
Rs=`echo $pre-S\(R\).aif`
out=`${pre}_6ch.wav`

ffmpeg -i $L -acodec pcm_s24le -i $R -acodec pcm_s24le -i $C -acodec pcm_s24le 
-i $LFE -acodec pcm_s24le -i $Ls -acodec pcm_s24le -i $Rs -acodec pcm_s24le 
-filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]amerge=inputs=6[aout]" -map 
"[aout]"  ${f%-C.aif}_6ch_24bit.wav
#rm $L
#rm $R
#rm $C
#rm $LFE
#rm $Ls
#rm $Rs

# echo $L,$r,$C,$LFE,$Ls,$Rs

done

What do i need to do / where to read to adapt it in a way, that it can

a) search multiple folders and subfolders

b)  handle folder - and filenames with spaces or other special characters....

Thanks in advance

Luigi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]