[FFmpeg-user] Batch Join multimono to multichannel Auido (wav / aif)

Luigi Rensinghoff soundgigi at freenet.de
Wed Jul 9 22:52:26 CEST 2014


Thanks


i found the solution:

#!/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 -i $R -i $C -i $LFE -i $Ls -i $Rs -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]amerge=inputs=6[aout]" -map "[aout]" ${f%-C.aif}_6ch.wav

rm $L
rm $R
rm $C
rm $LFE
rm $Ls
rm $Rs

done

But i am sure it can be achieved more elegant - Suggestions ???

THX


Am 09.07.2014 um 22:36 schrieb James Darnley <james.darnley at gmail.com>:

> On 2014-07-09 21:47, Luigi Rensinghoff wrote:
>> I just don't know, how to use variables 
>> 
>> $f, f% and that shit - when to use what..
> 
> man bash will answer some of these questions.
> 
> $ is for variables.
> $f is for the variable "f".
> % can be used to remove text at the end of a variable.
> {} these braces wrap the expansion you want bash to do, but are optional
> in simple cases.
> 
>> -i „$f“.L.aif
>> -i "$f“.R.aif 
>> -i "$f“.C.aif 
>> -i "$f“.LFE.aif 
>> -i "$f“.Ls.aif 
>> -i "$f“.Rs.aif 
> 
> Here is where you probably want: ${f%.C.aif}
> 
> This means: expand the variable "f" and remove ".C.aif" from the end.
> 
>> ${f%.aif}_6ch.wav
> 
> Here as well.
> 
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list