Le blog de Jean David TECHER, un Réunionnais à Saint-Priest/Lyon

Aller au contenu | Aller au menu | Aller à la recherche


1 2 3 >

dimanche 29 août 2010

FFmpeg: Performance de conversion pour WebM et nombre de CPU

On dispose pour ce test

  1. d'une petite machine avec Processeur Intel Core 2 Quad Q8200
  2. d'une version de ffmpeg compilée avec WebM

Test normal

On lance dans un script shell le contenu
begin_times=`date '+%s'`;
time /opt/multimedia-prod/bin/ffmpeg -y -i janadefi-daywith03.wmv -f webm -vcodec libvpx janadefi-daywith03.webm;
end_times=`date '+%s'`;duration_times=`expr $end_times - $begin_times`;
echo "Ecoulement approximatif de $duration_times secondes..."
On exécute le script. Pendant la converson, on lance depuis un autre shell
top -p $(pidof ffmpeg)
top - 16:45:13 up 6 days, 16:48,  2 users,  load average: 0.89, 0.61, 0.48
Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
Cpu0  :  0.3%us,  0.7%sy,  0.3%ni, 98.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu1  :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu2  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu3  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3115472k total,  3022124k used,    93348k free,   252360k buffers
Swap:  9124880k total,   137516k used,  8987364k free,  1991428k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND          
28815 root      20   0 42496  19m 3136 R  100  0.7   1:51.73 ffmpeg           
Ce qui se solde par
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Aug 16 2010 21:38:36 with gcc 4.3.2
  configuration: --prefix=/opt/multimedia --enable-libvpx --enable-libdirac --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-libfaad --enable-libfaadbin --enable-libfaac --enable-gpl --enable-nonfree --enable-pthreads --extra-cflags='-I$TOOLS_MULTIMEDIA_DIR/include/ -I$TOOLS_MULTIMEDIA_DIR/include/a52dec/ -I$TOOLS_MULTIMEDIA_DIR/include/lame/ -I$TOOLS_MULTIMEDIA_DIR/include/ -I$TOOLS_MULTIMEDIA_DIR/include/ao -I$TOOLS_MULTIMEDIA_DIR/include/libyasm -I$TOOLS_MULTIMEDIA_DIR/include/ogg -I$TOOLS_MULTIMEDIA_DIR/include/SDL -I$TOOLS_MULTIMEDIA_DIR/include/speex -I$TOOLS_MULTIMEDIA_DIR/include/vorbis -I$TOOLS_MULTIMEDIA_DIR/include/theora -I$TOOLS_MULTIMEDIA_DIR/include/schroedinger-1.0 -I$TOOLS_MULTIMEDIA_DIR/include/dirac -I$TOOLS_MULTIMEDIA_DIR/include/opencore-amrnb/ -I$TOOLS_MULTIMEDIA_DIR/include/opencore-amrwb/ -I/opt/multimedia/include/vpx' --extra-ldflags=-L/opt/multimedia/lib
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
[wmv3 @ 0x92b8760]Extra data: 8 bits left, value: 0

Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.97 (30000/1001)
Input #0, asf, from 'janadefi-daywith03.wmv':
  Metadata:
    WM/ToolName     : Flip4Mac WMV Export Component for QuickTime (Mac)
    WM/ToolVersion  : 2326馀᐀둷櫴櫰券떶櫰嘘㤲ꦠꦰ흎착隨ք櫰
    title           : 
    author          : 
    copyright       : 
    comment         : 
  Duration: 00:06:08.03, start: 5.000000, bitrate: 3999 kb/s
    Stream #0.0: Audio: wmav2, 44100 Hz, 2 channels, s16, 64 kb/s
    Stream #0.1: Video: wmv3, yuv420p, 640x480, 29.97 tbr, 1k tbn, 1k tbc
[libvpx @ 0x92ba250]v0.9.1
[wmv3 @ 0x92b8760]Extra data: 8 bits left, value: 0
Output #0, webm, to 'janadefi-daywith03.webm':
  Metadata:
    encoder         : Lavf52.64.2
    Stream #0.0: Video: libvpx, yuv420p, 640x480, q=2-31, 200 kb/s, 1k tbn, 29.97 tbc
    Stream #0.1: Audio: libvorbis, 44100 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
  Stream #0.0 -> #0.1
Press [q] to stop encoding
frame=11035 fps= 29 q=0.0 Lsize=   18911kB time=368.20 bitrate= 420.8kbits/s    
video:15810kB audio:2881kB global headers:3kB muxing overhead 1.160188%

real	6m26.927s
user	6m26.480s
sys	0m0.360s
Ecoulement approximatif de 387 secondes...

Test avec nombre cpu=4

Cette fois-ci, on précise le paramètre threads fixé à 4
begin_times=`date '+%s'`;
time /opt/multimedia-prod/bin/ffmpeg -y -i janadefi-daywith03.wmv -threads 4 -f webm -vcodec libvpx janadefi-daywith03.webm;
end_times=`date '+%s'`;duration_times
`expr $end_times - $begin_times`;
echo "Ecoulement approximatif de $duration_times secondes..."
On surveille la répartition
root@monroe:~# top -p $(pidof ffmpeg)

top - 16:57:51 up 6 days, 17:01,  2 users,  load average: 1.28, 0.71, 0.56
Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
Cpu0  : 19.3%us,  4.1%sy,  0.0%ni, 76.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu1  : 21.8%us,  0.7%sy,  0.0%ni, 77.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu2  : 33.5%us,  1.9%sy,  0.0%ni, 64.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu3  : 74.5%us,  1.0%sy,  0.0%ni, 24.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3115472k total,  3017096k used,    98376k free,   254076k buffers
Swap:  9124880k total,   137568k used,  8987312k free,  1985200k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
28942 root      20   0  129m  20m 3164 R  159  0.7   4:14.33 ffmpeg            

On obtient à la fin
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Aug 16 2010 21:38:36 with gcc 4.3.2
  configuration: --prefix=/opt/multimedia --enable-libvpx --enable-libdirac --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-libx264 --enable-libxv
d --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-libfaad --enable-libfaadbin --enable-libfaac --enable-gpl --enable-nonfree --enable-pthreads --extra-cflags='-I$TOOLS_MULTIME
IA_DIR/include/ -I$TOOLS_MULTIMEDIA_DIR/include/a52dec/ -I$TOOLS_MULTIMEDIA_DIR/include/lame/ -I$TOOLS_MULTIMEDIA_DIR/include/ -I$TOOLS_MULTIMEDIA_DIR/include/ao -I$TOOLS_MULTIMEDIA_DIR/include/libyasm -I$TOO
S_MULTIMEDIA_DIR/include/ogg -I$TOOLS_MULTIMEDIA_DIR/include/SDL -I$TOOLS_MULTIMEDIA_DIR/include/speex -I$TOOLS_MULTIMEDIA_DIR/include/vorbis -I$TOOLS_MULTIMEDIA_DIR/include/theora -I$TOOLS_MULTIMEDIA_DIR/inc
ude/schroedinger-1.0 -I$TOOLS_MULTIMEDIA_DIR/include/dirac -I$TOOLS_MULTIMEDIA_DIR/include/opencore-amrnb/ -I$TOOLS_MULTIMEDIA_DIR/include/opencore-amrwb/ -I/opt/multimedia/include/vpx' --extra-ldflags=-L/opt
multimedia/lib
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
[wmv3 @ 0x92b8760]Extra data: 8 bits left, value: 0

Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.97 (30000/1001)
Input #0, asf, from 'janadefi-daywith03.wmv':
  Metadata:
    WM/ToolName     : Flip4Mac WMV Export Component for QuickTime (Mac)
    WM/ToolVersion  : 2326馀᐀둷櫴櫰券떶櫰嘘㤲ꦠꦰ흎착隨ք櫰
    title           : 
    author          : 
    copyright       : 
    comment         : 
  Duration: 00:06:08.03, start: 5.000000, bitrate: 3999 kb/s
    Stream #0.0: Audio: wmav2, 44100 Hz, 2 channels, s16, 64 kb/s
    Stream #0.1: Video: wmv3, yuv420p, 640x480, 29.97 tbr, 1k tbn, 1k tbc
[libvpx @ 0x92ba250]v0.9.1
[wmv3 @ 0x92b8760]Extra data: 8 bits left, value: 0
Output #0, webm, to 'janadefi-daywith03.webm':
  Metadata:
    encoder         : Lavf52.64.2
    Stream #0.0: Video: libvpx, yuv420p, 640x480, q=2-31, 200 kb/s, 1k tbn, 29.97 tbc
    Stream #0.1: Audio: libvorbis, 44100 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
  Stream #0.0 -> #0.1
Press [q] to stop encoding
frame=11035 fps= 42 q=0.0 Lsize=   18917kB time=368.20 bitrate= 420.9kbits/s    
video:15815kB audio:2881kB global headers:3kB muxing overhead 1.159740%

real	4m19.877s
user	6m49.020s
sys	0m19.650s
Ecoulement approximatif de 260 secondes...

samedi 28 août 2010

Hobbit-client 4.3 et Serveur Hobbit 4.2

A la maison, j'ai mon serveur Hobbit qui tourne sous 4.2. Sur gemini (une des machines clientes), je viens tout juste d'installer hobbit-client.

Malheureusement c'est un hobbit-client version 4.3 car gemini est une Ubuntu Lucid Lynx 10.04

Installlation du client

apt-get install hobbit-clientl hobbit-plugins
Lors de l'installation, il faudra préciser l'IP du serveur Hobbit

Ensuite, il faut modifier le fichier pour supprimer le sufixe davidgis.fr à la ligne CLIENTHOSTNAME="gemini" au lieu de CLIENTHOSTNAME="gemini.davidgis.fr"

root@gemini:~# cat /etc/default/hobbit-client
# Configure the Hobbit client settings.

# You MUST set the list of Hobbit servers that this
# client reports to.
# It is good to use IP-adresses here instead of DNS
# names - DNS might not work if there's a problem.
# (Internally this will be translated to BBDISP and BBDISPLAYS
# variables in /var/run/hobbit/bbdisp-include.cfg)
#
# E.g. (a single Hobbit server)
#   HOBBITSERVERS="192.168.1.1"
# or (multiple servers)
#   HOBBITSERVERS="10.0.0.1 192.168.1.1"

HOBBITSERVERS="192.168.2.242"

# Hostname used by the client for its reports.
# Must match the name for this host in the Hobbit servers'
# bb-hosts file.

root@gemini:~# cat /etc/default/hobbit-client
# Configure the Hobbit client settings.

# You MUST set the list of Hobbit servers that this
# client reports to.
# It is good to use IP-adresses here instead of DNS
# names - DNS might not work if there's a problem.
# (Internally this will be translated to BBDISP and BBDISPLAYS
# variables in /var/run/hobbit/bbdisp-include.cfg)
#
# E.g. (a single Hobbit server)
#   HOBBITSERVERS="192.168.1.1"
# or (multiple servers)
#   HOBBITSERVERS="10.0.0.1 192.168.1.1"

HOBBITSERVERS="192.168.2.242"

# Hostname used by the client for its reports.
# Must match the name for this host in the Hobbit servers'
# bb-hosts file.

CLIENTHOSTNAME="gemini"

Configuration côté serveur

On ajoute la ligne suivante dans le fichier /etc/hobbit/bb-hosts
melina-xen06:~# head -n35 /etc/hobbit/bb-hosts 
###############################################################################################
# $Id: bb-hosts 55 2010-08-28 18:19:20Z david $
###############################################################################################
# Master configuration file for Hobbit
#
# This file defines several things:
#
# 1) By adding hosts to this file, you define hosts that are monitored by Hobbit
# 2) By adding "page", "subpage", "group" definitions, you define the layout
#    of the Hobbit webpages, and how hosts are divided among the various webpages 
#    that Hobbit generates.
# 3) Several other definitions can be done for each host, see the bb-hosts(5)
#    man-page.
#
# You need to define at least the Hobbit server itself here.

#0.0.0.0        .default.       # NOPROPRED:+apt,+libs

group Serveurs physiques
192.168.2.1	olivia		# http://olivia.davidgis.fr disk memory COMMENT:"Serveur 1 - principal (FireWall/Web/QMail/Samba/LDAP"
192.168.2.6	monroe		# http://monroe.davidgis.fr disk memory oratns COMMENT:"Serveur 2  - Lighttpd/Oracle"
192.168.2.8	melina		# disk memory	COMMENT:"Serveur 3 - Xen"
192.168.2.14	gemini		# cpu disk memory	COMMENT:"Serveur 4 - Multimedia (FreeBox/TV)"

group Serveurs virtuels sous Xen
192.168.2.252	melina-xen01	# disk memory COMMENT:"Bases MySQL/PostgreSQL"
192.168.2.250	melina-xen02	# disk memory COMMENT:"Squid"
192.168.2.248   melina-xen03    # disk memory COMMENT:"FreeRadius"
192.168.2.244	melina-xen04	# disk memory COMMENT:"Windows XP"
192.168.2.246	melina-xen05	# disk memory COMMENT:"P3Scan/ClamAV/SpamAssassin"
127.0.0.1       melina-xen06    # bbd http://melina-xen06/ COMMENT:"Serveurs Web internes/SVN"
192.168.2.238	melina-xen07	# disk memory COMMENT:"Bases Oracle"
Ce qui donnera donc ceci

Suppression du test pour apt

  1. Côté Client:

    Depuis gemini (client), il faut décommenter la ligne '#DISABLED' dans le fichier. Pour le coup, un petit sed interactif devrait suffire
    root@gemini:~# cat /etc/hobbit/clientlaunch.d/apt.cfg
    [apt]
    	#DISABLED
    	ENVFILE /etc/hobbit/hobbitclient.cfg
    	CMD $HOBBITCLIENTHOME/ext/apt
    	LOGFILE /var/log/hobbit/hobbitclient.log
    	INTERVAL 5m
    root@gemini:~# sed -i "s:#::g" /etc/hobbit/clientlaunch.d/apt.cfg
    root@gemini:~# cat /etc/hobbit/clientlaunch.d/apt.cfg
    [apt]
    	DISABLED
    	ENVFILE /etc/hobbit/hobbitclient.cfg
    	CMD $HOBBITCLIENTHOME/ext/apt
    	LOGFILE /var/log/hobbit/hobbitclient.log
    	INTERVAL 5m
    
  2. Côté Serveur:

    On voit que le test est toujours actif
    melina-xen06:~# /usr/lib/hobbit/server/bin/bb 127.0.0.1 "hobbitdboard test=apt fields=hostname"
    gemini
    
    Il faut donc le dropper
    TEST=apt;
    /usr/lib/hobbit/server/bin/bb 127.0.0.1 "hobbitdboard test=$TEST fields=hostname"| \
     while read H;
     do
        /usr/lib/hobbit/client/bin/bb 127.0.0.1 "drop $H $TEST";
    done
    
    On vérifie
    melina-xen06:~# /usr/lib/hobbit/server/bin/bb 127.0.0.1 "hobbitdboard test=apt fields=hostname"
    melina-xen06:~# 
    
    

SMPlayer - Activer le son

Depuis que j'ai installé SMPlayer lors de mes lectures de films, j'ai bien la vidéo mais pas le son ....En fait il suffit de remanier le fichier de configuration de smplayer

Comme mon utilisateur c'est david, il suffit donc de modifier le fichier ~/.config/smplayer/smplayer.ini en remplaçant la valeur du paramètre driver\audio_output

  1. On remplace la ligne
    driver\audio_output=null
  2. par la ligne
    driver\audio_output=alsa

mercredi 25 août 2010

Compilation de libtorrent 0.12.6 et rtorrent 0.8.6

Remarque: Ce billet est une mise à jour de mon premier billet concernant la première compilation de libtorrent/rtorrent

Les commandes sont

wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.6.tar.gz
tar xvzf libtorrent-0.12.6.tar.gz 
cd libtorrent-0.12.6
./configure && make && make install
wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.6.tar.gz -O - | tar xvz 
cd rtorrent-0.8.6/
./configure && make && make install
ldconfig && ./configure && make && make install