I found a shell script and modified it to meet my need and it looked like this:
#!/bin/bash
[ "$1" ] && cd "$1"
ls -1 *.TS
[ "$?" -ne 0 ] && echo 'Sem arquivos TS nesse diretório' && exit 0
for ARQUIVO in $(ls -1 *.TS)
do
ARQ_DESTINO="${ARQUIVO%%.TS}.avi"
echo "Convertendo $ARQUIVO para $ARQ_DESTINO"
ffmpeg -i "$ARQUIVO" -vcodec libxvid -b 2000k \
-acodec libmp3lame -ac 2 -ar 44100 -ab 128k "$ARQ_DESTINO"
done
I do not know how to do this script to get into the subdirectories and get every file .ts
and convert it to .avi
, in that case it just does it in the directory where the script is.
How can I do with this script to do this process?