Retourner au contenu associé (entrée de forum : encodage mp4 pour iphone ----> script mencoder testé)
Posté par SiB (site web personnel) le 09 décembre 2008 à 17:38. En réponse au message encodage mp4 pour iphone ----> script mencoder testé. Évalué à 1.
#!/bin/zsh if [[ ! $# == 1 ]]; then echo "Usage: 0ドル videofile" exit fi OUT=${${1%.*}##*/}.mp4 #ne semble pas fonctionner avec bash, mais marche en le faisant en 2 fois... LOG="/tmp/$OUT.txt" width=480 height=320 vcodec=libx264 vbitrate=600k #1000k acodec=libfaac abitrate=128k afreq=48000 flag1="-flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0" flag2="-maxrate 1250k -bufsize 4M -bt 256k -refs 1 -coder 0 -me umh -me_range 16 -subq 7 -partitions +parti4x4+parti8x8+partp8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -qcomp 0.6 -trellis 2 -sc_threshold 40 -i_qfactor 0.71" #pass1 ffmpeg -y -i "${1}" -r 29.97 -vcodec ${vcodec} -s ${width}x${height} -aspect 4:3 ${flag1} -b ${vbitrate} ${flag2} -acodec ${acodec} -ab ${abitrate} -ar ${afreq} -ac 2 -passlogfile "${LOG}" -pass 1 -threads auto "/tmp/${OUT}" #pass2 ffmpeg -y -i "${1}" -r 29.97 -vcodec ${vcodec} -s ${width}x${height} -aspect 4:3 ${flag1} -b ${vbitrate} ${flag2} -acodec ${acodec} -ab ${abitrate} -ar ${afreq} -ac 2 -passlogfile "${LOG}" -pass 2 -threads auto "/tmp/${OUT}" mv "/tmp/${OUT}" /mon/iphone/en/sshfs #remove log rm "${LOG}"
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
# Avec ffmpeg
Posté par SiB (site web personnel) . En réponse au message encodage mp4 pour iphone ----> script mencoder testé. Évalué à 1.
#!/bin/zsh
if [[ ! $# == 1 ]]; then
echo "Usage: 0ドル videofile"
exit
fi
OUT=${${1%.*}##*/}.mp4 #ne semble pas fonctionner avec bash, mais marche en le faisant en 2 fois...
LOG="/tmp/$OUT.txt"
width=480
height=320
vcodec=libx264
vbitrate=600k #1000k
acodec=libfaac
abitrate=128k
afreq=48000
flag1="-flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0"
flag2="-maxrate 1250k -bufsize 4M -bt 256k -refs 1 -coder 0 -me umh -me_range 16 -subq 7 -partitions +parti4x4+parti8x8+partp8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -qcomp 0.6 -trellis 2 -sc_threshold 40 -i_qfactor 0.71"
#pass1
ffmpeg -y -i "${1}" -r 29.97 -vcodec ${vcodec} -s ${width}x${height} -aspect 4:3 ${flag1} -b ${vbitrate} ${flag2} -acodec ${acodec} -ab ${abitrate} -ar ${afreq} -ac 2 -passlogfile "${LOG}" -pass 1 -threads auto "/tmp/${OUT}"
#pass2
ffmpeg -y -i "${1}" -r 29.97 -vcodec ${vcodec} -s ${width}x${height} -aspect 4:3 ${flag1} -b ${vbitrate} ${flag2} -acodec ${acodec} -ab ${abitrate} -ar ${afreq} -ac 2 -passlogfile "${LOG}" -pass 2 -threads auto "/tmp/${OUT}"
mv "/tmp/${OUT}" /mon/iphone/en/sshfs
#remove log
rm "${LOG}"
la qualité produite me convient amplement, même pour l'affichage sur ma grande tv crt via l'iphone mais ça reste un poil long à transcoder.
toute suggestion d'amélioration (filtre inutile ou autre) est la bienvenue ;)