r4 - 12 May 2006 - 23:59:39 - IuriDinizYou are here: TWiki >  Personal Web  > ScriptsBash

Alguns scripts bash rápidos para referêcia

Extrair audio de um video MPEG usando o mplayer (wav)

#!/bin/sh
mkdir wav
for i in *.mpg; do 
   mplayer -vc dummy -vo null -ao pcm:file=wav/"$i".wav "$i";
done
# rename do debian
#rename 's/\.mpg\.wav$/.wav/' wav/*.wav

Recodificar MP3 em qualidade 64k usando o lame

#!/bin/sh
mkdir 64k
for i in *.mp3; do 
   lame -b 64 "$i" 64k/"$i";
   id3cp "$i" 64k/"$i";
done

Converter wma em mp3 usando o mplayer + lame

#!/bin/sh
mkdir mp3
for i in *.wma; do 
   mplayer -novideo "$i" -ao pcm:file=temp_"$i".wav; 
   lame temp_"$i".wav mp3/"$i".mp3; 
   rm -f temp_"$i".wav;
done
# opcional
# pegar tags do wma e colocar no mp3
for i in *.wma; do 
   ARTIST=`mplayer -novideo -ao dummy "$i" 2>/dev/null| grep author: | perl -pe 's/^.*author: //'`
   MUSIC=`mplayer -novideo -ao dummy "$i" 2>/dev/null| grep "^ name:" | perl -pe 's/^.*name: //'`
   
   id3tag -a"$ARTIST" -s"$MUSIC" mp3/"$i".mp3;
done

# rename do debian (comentado porque nem todo mundo usa debian)
#rename 's/\.wma\.mp3$/.mp3/' mp3/*.mp3



-- IuriDiniz - 17 Feb 2006

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r4 < r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback