#!/bin/bash
SIZE="$2"
if [ "$SIZE" == "" ];then
SIZE="640x360"
fi
ffmpeg -i $1 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -preset slower -crf 18 -vf "scale=trunc(in_w/2)*2:trunc(in_h/2)*2" -movflags +faststart -s $SIZE $1.mp4
ffmpeg -i $1 -c:v libvpx -c:a libvorbis -pix_fmt yuv420p -quality good -b:v 2M -crf 5 -vf "scale=trunc(in_w/2)*2:trunc(in_h/2)*2" -s $SIZE $1.webm
ffmpeg -i $1 -q 5 -pix_fmt yuv420p -acodec libvorbis -vcodec libtheora -s $SIZE $1.ogv
ffmpeg -i $1 -ss 00:10 -vframes 1 -r 1 -s 640x360 -f image2 $1.jpg
Dans un terminal :
./ffmpeg fichier_original.ext taille
Sources :
https://blog.mediacru.sh/2013/12/23/The-right-way-to-encode-HTML5-video.html
http://www.brendanmckeown.com/html5/2014/06/06/move-mp4-metadata.html