Recherche avancée

Médias (0)

Mot : - Tags -/organisation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (98)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Utilisation et configuration du script

    19 janvier 2011, par

    Informations spécifiques à la distribution Debian
    Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
    Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
    Récupération du script
    Le script d’installation peut être récupéré de deux manières différentes.
    Via svn en utilisant la commande pour récupérer le code source à jour :
    svn co (...)

Sur d’autres sites (6998)

  • Memcached protocol support

    15 novembre 2013, par Mikko Koppanen — Imagick

    For the past few days I’ve been adding Memcached binary protocol support to PECL memcached extension. The protocol handler provides a high-level abstraction for acting as a memcached server. There are quite a few things still missing and only binary protocol is supported at the moment, but the code seems to work reasonably well in small-scale testing.

    I am not sure whether this is useful for anyone, but at least it allows things such as quick prototyping of network servers, exposing sqlite database over memcached protocol etc.

    The code is quite simple and implementing a simple server responding to get and set would look roughly like the following :

    1. < ?php
    2. // Create new server instance
    3. $server = new MemcachedServer() ;
    4.  
    5. // Create a simple storage class
    6. class Storage {
    7.   private $values = array () ;
    8.   
    9.   public function set ($key, $value, $expiration) {
    10.     $this->values [$key] = array (’value’ => $value,
    11.                    ’expires’ => time () + $expiration) ;
    12.   }
    13.  
    14.   public function get ($key) {
    15.     if (isset ($this->values [$key])) {
    16.       if ($this->values [$key] [’expires’] < time ()) {
    17.         unset ($this->values [$key]) ;
    18.         return null ;
    19.       }
    20.       return $this->values [$key] [’value’] ;
    21.     }
    22.     else
    23.       return null ;
    24.   }
    25. }
    26.  
    27. $storage = new Storage () ;
    28.  
    29. // Set callback for get command
    30. $server->on (Memcached: :ON_GET,
    31.        function ($client_id, $key, &$value, &$flags, &$cas) use ($storage) {
    32.          echo "Getting key=[$key]" . PHP_EOL ;
    33.          if (($value = $storage->get ($key))  != null)
    34.            return Memcached: :RESPONSE_SUCCESS ;
    35.  
    36.          return Memcached: :RESPONSE_KEY_ENOENT ;
    37.        }) ;
    38.  
    39. // Set callback for set command
    40. $server->on (Memcached: :ON_SET,
    41.        function ($client_id, $key, $value, $flags, $expiration, $cas, &$result_cas) use ($storage) {
    42.          echo "Setting key=[$key] value=[$value]" . PHP_EOL ;
    43.          $storage->set ($key, $value, $expiration) ;
    44.          return Memcached: :RESPONSE_SUCCESS ;
    45.        }) ;
    46.  
    47. // Run the server on localhost, port 3434. Will block
    48. $server->run ("127.0.0.1:3434") ;
    49.  ?>

    And the client that communicates with the server :

    1. < ?php
    2.  
    3. $cache = new Memcached() ;
    4. $cache->setOption(Memcached: :OPT_BINARY_PROTOCOL, true) ;
    5. $cache->setOption(Memcached: :OPT_COMPRESSION, false) ;
    6. $cache->addServer(’localhost’, 3434) ;
    7.  
    8. $cache->set (’set_key1’, ’This is the first key’, 10) ;
    9. var_dump ($cache->get (’set_key1’)) ;
    10.  
    11. $cache->set (’set_key2’, ’This is the second key’, 2) ;
    12. var_dump ($cache->get (’set_key2’)) ;
    13.  ?>

    The code is still work in progress but it’s available in github : https://github.com/mkoppanen/php-memcached/tree/feature-server. Note that you need to compile libmemcached with –enable-libmemcachedprotocol and the PECL memcached extension with –enable-memcached-protocol.

  • Perspective transformations

    4 février 2009, par Mikko Koppanen — Imagick, PHP stuff

    Finally (after a long break) I managed to force myself to update the PHP documentation and this time it was distortImage code example. Things have been hectic lately but that does not quite explain the 6 months(?) break between this and the previous post. As a matter of a fact there is no excuse for such a long silence so I will try to update this blog a bit more often from now on.

    Back in the day I used to blog the examples and update the documentation if I remembered but I am trying to fix this bad habit. Most of the latest examples have been updated in to the manual. In the case of the two last examples I updated the documentation first and then blogged on the subject.

    I took some time to actually understand the perspective transformations properly using the excellent ImageMagick examples (mainly created by Anthony Thyssen) as a reference. The basic idea of perspective distortion seems simple : to distort the control points to new locations. Grabbing the syntax for Imagick was easy, an array of control point pairs in the form of :

    1. array(source_x, source_y, dest_x, dest_y ... )

    The following example uses the built-in checkerboard pattern to demonstrate perspective distortion :

    1. < ?php
    2. /* Create new object */
    3. $im = new Imagick() ;
    4.  
    5. /* Create new checkerboard pattern */
    6. $im->newPseudoImage(100, 100, "pattern:checkerboard") ;
    7.  
    8. /* Set the image format to png */
    9. $im->setImageFormat(’png’) ;
    10.  
    11. /* Fill background area with transparent */
    12. $im->setImageVirtualPixelMethod(Imagick: :VIRTUALPIXELMETHOD_TRANSPARENT) ;
    13.  
    14. /* Activate matte */
    15. $im->setImageMatte(true) ;
    16.  
    17. /* Control points for the distortion */
    18. $controlPoints = array( 10, 10,
    19.             10, 5,
    20.  
    21.             10, $im->getImageHeight() - 20,
    22.             10, $im->getImageHeight() - 5,
    23.  
    24.             $im->getImageWidth() - 10, 10,
    25.             $im->getImageWidth() - 10, 20,
    26.  
    27.             $im->getImageWidth() - 10, $im->getImageHeight() - 10,
    28.             $im->getImageWidth() - 10, $im->getImageHeight() - 30) ;
    29.  
    30. /* Perform the distortion */ 
    31. $im->distortImage(Imagick: :DISTORTION_PERSPECTIVE, $controlPoints, true) ;
    32.  
    33. /* Ouput the image */ 
    34. header("Content-Type : image/png") ;
    35. echo $im ;
    36.  ?>

    Here is the source image :
    checker before

    And the result :
    after

  • Revision 76d166e413 : Removing foreach_predicted_block_uv function. Adding function build_inter_predi

    12 août 2013, par Dmitry Kovalev

    Changed Paths :
     Modify /vp9/common/vp9_blockd.h


     Modify /vp9/common/vp9_reconinter.c



    Removing foreach_predicted_block_uv function.

    Adding function build_inter_predictors_for_planes to build inter
    predictors for specified planes. This function allows to remove
    condition "#if CONFIG_ALPHA" and use MAX_MB_PLANE for general case.
    Renaming 'which_mv' local var to 'ref', and 'weight' argument to 'ref'.

    Change-Id : I1a97160c9263006929d38953f266bc68e9c56c7d