encodage d'une suite de 3500 images TGA au format 16/9
taille pixel original TGA :720x480
taille pixel format video : 512x288
installer sur fedora le dépôt RPM FUSION
http://doc.fedora-fr.org/wiki/Dépôt_RPM_Fusion
puis les codecs propriétaires
yum install gstreamer-ffmpeg gstreamer-plugins-bad gstreamer-plugins-ugly
installer ffmpeg2theora
yum install ffmpeg2theora
installer ffmpeg
yum install ffmpeg
ffmpeg2theora -f tga fin_%04d.tga -o ../my_theora_video.ogv --videoquality 5 --audioquality 6 --croptop 0 --cropbottom 0 --cropleft 0 --cropright 0 --width 512 --height 288 --title titrevideo --artist nomauteur --date 1997-12-31
ffmpeg -i %04d.tga -vcodec libx264 -s 512x288 -vpre hq -b 800k fichier_sortie.mp4
ffmpeg en détail :
-i mavideo.avi //le fichier video d'entrée
-s 320x240 // la taille
Pour permettre le streaming progressif du fichier mmp4 il faut deplacer son entete grâce à qt fast start (fichier attaché à cet article)
voici la ligne de commande :
qt-faststart ma_video.mov ma_video_fast.mov
resultat pour ogg theora --> 2min 58 - 14.2 mo
Input #0, image2, from '%04d.tga': Duration: 00:02:20.00, start: 0.000000, bitrate: N/A Stream #0.0: Video: targa, bgr24, 720x480, 25.00 tb(r) Resize: 720x480 => 512x288 0:02:20.00 audio: 0kbps video: 1138kbps, time elapsed: 00:02:58
resultat pour h264 --> 2min33 - 12,5 mo
built on Aug 25 2009 12:23:28, gcc: 4.4.1 20090725 (Red Hat 4.4.1-2)
Input #0, image2, from '%04d.tga':
Duration: 00:02:20.00, start: 0.000000, bitrate: N/A
Stream #0.0: Video: targa, bgr24, 720x480, 25 tbr, 25 tbn, 25 tbc
Output #0, mp4, to '../test.mp4':
Stream #0.0: Video: libx264, yuv420p, 512x288, q=10-51, 800 kb/s, 90k tbn, 25 tbc
Stream mapping:
Stream #0.0 -> #0.0
[libx264 @ 0x9cb1ce0]using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x9cb1ce0]profile High, level 2.1
Press [q] to stop encoding
frame= 3500 fps= 6 q=-1.0 Lsize= 12774kB time=139.92 bitrate= 747.9kbits/s
sources :
pour les notions générales sur l'encodage vidéo notamment sur les blocs
http://grand-angle.iguane.org/blog/article/compression-videos-pour-le-web-un
pour la description sur l'encodage h264 avec ffmpeg
http://www.deblogtoi.com/index.php?post/2008/12/27/Convertir-vidéo-MOV-en-FLV-avec-FFmpeg
un bon nombre d'exemples (voir tous !)
http://howto-pages.org/ffmpeg/
la page de référence sur l'encodage h264
http://blog.dahanne.net/2008/03/20/diffusez-vos-videos-hd-en-h264-sur-le-web/
le dépôt RPM FUSION sur fedora
http://doc.fedora-fr.org/wiki/Lecture_de_fichiers_multimédia