• # Avec ffmpeg

    Posté par (site web personnel) . En réponse au message encodage mp4 pour iphone ----> script mencoder testé. Évalué à 1.

    Relativement semblable, avec ffmpeg en 2 pass, quelques filtres et codé vite fait (testé sur nombres vidéos sans soucis) :

    #!/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 ;)