Changeset 7340 in spip-zone
- Timestamp:
- Nov 15, 2006, 3:08:22 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/_dev_/spipmotion/script_bash/spipmotion.sh
r7337 r7340 9 9 10 10 ################ LOCALISATION ##################### 11 12 ################### English ########################13 messageaide="14 spipmotion $version15 16 Usage: ./spipmotion args17 where args must include source video (--e) and output video (--i) and possibly18 * the conversion mode (--m) : m will use mplayer and f will use ffmpeg only19 m is slow, but light. Accepted sizes are the sizes supported by your version of mplayer20 f is quick but heavy. Accepted sizes are the sizes which ffmpeg was compiled21 -> default is m22 * the path to the binary ffmpeg (--p). default is /usr/local/bin/ffmpeg.23 24 Example :25 ./spipmotion --e input-video.avi --s output-video.flv --mode m --p /usr/local/bin/ffmpeg26 27 ####################################################28 ## This program need a ffmpeg version ##29 ## compiled with mp3lame support ! ##30 ## See http://kent1.sklunk.net/spip.php?article71 ##31 ####################################################32 "33 formatsortie="spipmotion: outfile name must end in .flv"34 mauvaisarg="spipmotion: unrecognised argument ${1}35 For a proper use try : \"./spipmotion --help\""36 pasvideoentree="spipmotion: no source video specified.37 For a proper use try : \"./spipmotion --help\""38 pasvideosortie="spipmotion: no output video specified.39 For a proper use try : \"./spipmotion --help\""40 extractvid="Extracting Video"41 extractson="Extracting Sound"42 assemblage="Converting to flv"43 titredejala="Output file already exists"44 textedejala="The output file you specified already exists.45 Do you want to overwrite it ?46 If no, it will be renamed."47 oui="yes"48 non="no"49 succes="Success! Video has been converted in flv format!"50 nonamr="It seems that your version of ffmpeg was not compiled with AMR support. This program needs AMR support to work properly.51 For a proper use try : \"./spipmotion --help\""52 53 case $LANG in54 ################### Français ######################55 fr* )56 11 messageaide=" 57 12 spipmotion $version … … 59 14 Utilisation : ./spipmotion arguments 60 15 ou arguments doit inclure la vidéo source et la vidéo de sortie au format flv et éventuellement : 61 * le mode de conversion : m se servira de mplayer et f n'utilisera que ffmpeg 62 m est lent mais donne des fichiers légers. Les formats acceptés sont ceux supportés par votre version de mplayer 63 f est plus rapide mais donne des fichiers plus lourd. Les formats acceptés sont ceux avec lesquels vous avez compilé ffmpeg 64 -> par défaut, m est selectionné 16 * la taille de la video ex : --size 320x240 17 * le bitrate de la video ex : --bitrate 448 18 * le nombre d'image par seconde ex : --fps 15 19 * le bitrate audio ex : --audiobitrate 64 20 * la fréquence d'echantillonnage sonnore ex : --bitrate 22050 65 21 * le chemin vers l'executable ffmpeg (--p). /usr/local/bin/ffmpeg est la valeur par défaut. 66 22 67 23 68 24 Exemple : 69 ./spipmotion --e video-entree.avi --s video-sortie.flv -- mode m --p /opt/ffmep/bin/ffmpeg25 ./spipmotion --e video-entree.avi --s video-sortie.flv --size 320x240 --bitrate 448 --fps 15 --audiobitrate 64 --audiofreq 22050 --p /usr/local/bin/ffmpeg 70 26 71 27 ##################################################### … … 94 50 nonamr="Il apparaît que votre version de ffmpeg n'a pas été compilée avec le support d'AMR. Ce programme en a besoin pour fonctionner correctement 95 51 Pour visualiser le manuel de spipmotion, faîtes : \"./spipmotion --help\"" 96 esac97 52 98 53 ################################################# … … 113 68 esac 114 69 shift;; 115 --mode) mode="${2}" 70 --size) size="${2}" 71 shift;; 72 --bitrate) bitrate="${2}" 73 shift;; 74 --audiobitrate) audiobitrate="${2}" 75 shift;; 76 --audiofreq) audiofreq="${2}" 77 shift;; 78 --fps) fps="${2}" 116 79 shift;; 117 80 --p) chemin="${2}" … … 132 95 esac 133 96 134 case "$mode" in135 "") "$mode" = "m"136 esac137 138 97 case "$chemin" in 139 98 "") chemin="/usr/local/bin/ffmpeg" 140 99 esac 141 100 142 143 ################# AMR OU PAS ? ##################144 amroupas=`$chemin -version 2>&1`145 146 if echo $amroupas | grep -v amr147 then148 echo "###################################################"149 echo $nonamr;150 echo "###################################################"151 exit;152 fi153 154 101 ########### SI LA SORTIE EXISTE DÉJÀ ############# 155 102 156 103 if [ -f $sortie ]; 157 104 then 158 105 PS3='> ' … … 172 119 esac 173 120 done 174 fi175 176 177 ############# SI ON UTILISE FFMPEG ################178 if [ "$mode" = "f" ]179 then180 echo "181 #######################182 ## "$assemblage" ##183 #######################184 "185 echo "ah$chemin$mode"186 "$chemin" -i $entree -acodec amr_nb -s 176x144 -ar 8000 -b 80 -vcodec h263 -ac 1 -y $sortie187 else188 189 ################# SINON, MPLAYER ##################190 191 192 echo "193 #######################194 ## "$extracvid" ##195 #######################196 "197 mencoder $entree -nosound -ovc lavc -lavcopts vcodec=mpeg4 -vop expand=176:144,scale=176:-2 -o sortie.avi -ofps 12198 echo "199 #######################200 ## "$extractson" ##201 #######################202 "203 mplayer -vo null -ao pcm -af resample=8000,volume=+4db:sc $entree204 echo "205 #######################206 ## "$assemblage" ##207 #######################208 "209 "$chemin" -i sortie.avi -i audiodump.wav -b 48 -ac 1 -ab 12 -map 0.0 -map 1.0 -y $sortie210 rm sortie.avi211 rm audiodump.wav212 121 fi 213 122 123 ############# ON UTILISE FFMPEG ################ 124 125 echo "ah$chemin" 126 "$chemin" -i $entree -acodec mp3 -f flv -s $size -b $bitrate.kb -ab $audiobitrate -ar $audiofreq -r $fps -y $sortie 127 214 128 echo "$succes" 215 echo "http://www.aozeo.com/"
Note: See TracChangeset
for help on using the changeset viewer.