Recherche avancée

Médias (0)

Mot : - Tags -/objet éditorial

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

Autres articles (28)

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

Sur d’autres sites (6553)

  • Fill patterns

    26 avril 2008, par Mikko Koppanen — Imagick, PHP stuff

    My work life has been quite busy lately and I haven’t had a chance to sit down and blog. I have been touring around London and some parts of the northern England consulting and organizing some training here and there. Luckily I have had the chance to do some work on Imagick and the 2.2.0 beta release is getting closer. The internal structure was completely restructured and broken down into several smaller files. During this time Imagick was adapted to follow the PHP Coding Standards more closely. Still a work in progress :)

    I committed slightly modified version of this example to PHP Manual http://uk.php.net/manual/en/imagick.examples.php page a few days ago. The example illustrates using an image as a part of a named fill pattern. The fill pattern is used to annotate text but the named pattern could also be used to fill any shapes that allow fill to be specified (include circles, ellipses, rectangles, polygons etc etc). The code itself is pretty straight forward : Read the image, create the pattern and use the pattern as a fill.

    The ice formations image is from http://www.photoeverywhere.co.uk/west/winterholiday/slides/iceformations5679.htm.

    1. < ?php
    2.  
    3. /* Create a new imagick object */
    4. $im = new Imagick( ’iceformations5679.JPG’ ) ;
    5.  
    6. /* Create imagickdraw object */
    7. $draw = new ImagickDraw() ;
    8.  
    9. /* Start a new pattern called "ice" */
    10. $draw->pushPattern( ’ice’ , 0 , 0 , 50 , 50 ) ;
    11.  
    12. /* Composite the image on the pattern */
    13. $draw->composite( Imagick: :COMPOSITE_OVER, 0, 0, 50, 50, $im ) ;
    14.  
    15. /* Close the pattern */
    16. $draw->popPattern() ;
    17.  
    18. /* Use the pattern called "ice" as the fill */
    19. $draw->setFillPatternURL( ’#ice’ ) ;
    20.  
    21. /* Set font size to 52 */
    22. $draw->setFontSize( 52 ) ;
    23.  
    24. /* Annotate some text */
    25. $draw->annotation( 5, 50, "Hello World !" ) ;
    26.  
    27. /* Create a new canvas and white image */
    28. $canvas = new Imagick() ;
    29. $canvas->newImage( 310, 70, "white" ) ;
    30.  
    31. /* Add black border around the resulting image */
    32. $canvas->borderImage( ’black’, 1, 1 ) ;
    33.  
    34. /* Draw the ImagickDraw on to the canvas */
    35. $canvas->drawImage( $draw ) ;
    36.  
    37. /* Set the format to PNG */
    38. $canvas->setImageFormat( ’png’ ) ;
    39.  
    40. /* Output the image */
    41. header( "Content-Type : image/png" ) ;
    42. echo $canvas ;
    43.  ?>

    And the result is here :

  • FFmpeg : Jpeg file to AVFrame

    24 octobre 2012, par darja

    I need to join several jpg files into video using FFmpeg library. But I have a problem with reading this files. Here is a function which reads image file and makes AVFrame :

    AVFrame* OpenImage(const char* imageFileName)
    {
       AVFormatContext *pFormatCtx;

       if(av_open_input_file(&amp;pFormatCtx, imageFileName, NULL, 0, NULL)!=0)
       {
           printf("Can&#39;t open image file &#39;%s&#39;\n", imageFileName);
           return NULL;
       }      

       dump_format(pFormatCtx, 0, imageFileName, false);

       AVCodecContext *pCodecCtx;

       pCodecCtx = pFormatCtx->streams[0]->codec;
       pCodecCtx->width = W_VIDEO;
       pCodecCtx->height = H_VIDEO;
       pCodecCtx->pix_fmt = PIX_FMT_YUV420P;

       // Find the decoder for the video stream
       AVCodec *pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
       if (!pCodec)
       {
           printf("Codec not found\n");
           return NULL;
       }

       // Open codec
       if(avcodec_open(pCodecCtx, pCodec)&lt;0)
       {
           printf("Could not open codec\n");
           return NULL;
       }

       //
       AVFrame *pFrame;

       pFrame = avcodec_alloc_frame();

       if (!pFrame)
       {
           printf("Can&#39;t allocate memory for AVFrame\n");
           return NULL;
       }

       int frameFinished;
       int numBytes;

       // Determine required buffer size and allocate buffer
       numBytes = avpicture_get_size(PIX_FMT_YUVJ420P, pCodecCtx->width, pCodecCtx->height);
       uint8_t *buffer = (uint8_t *) av_malloc(numBytes * sizeof(uint8_t));

       avpicture_fill((AVPicture *) pFrame, buffer, PIX_FMT_YUVJ420P, pCodecCtx->width, pCodecCtx->height);

       // Read frame

       AVPacket packet;

       int framesNumber = 0;
       while (av_read_frame(pFormatCtx, &amp;packet) >= 0)
       {
           if(packet.stream_index != 0)
               continue;

           int ret = avcodec_decode_video2(pCodecCtx, pFrame, &amp;frameFinished, &amp;packet);
           if (ret > 0)
           {
               printf("Frame is decoded, size %d\n", ret);
               pFrame->quality = 4;
               return pFrame;
           }
           else
               printf("Error [%d] while decoding frame: %s\n", ret, strerror(AVERROR(ret)));
       }
    }

    This causes no error but creates only black frame, no image. What is wrong ?

  • How to create video with border in android

    2 novembre 2013, par Dinesh Raj

    Want to add border to video like this

    i already tried using ffmpeg not working correctly

    "ffmpeg -i input.avi -vf pad=w:h:x:y:black output.avi"

    "w" is the width of your border, "h" is the height of your border, and "x" and "y" are the border's origin coordinates.

    can anyone suggest the width,height,x and y value please

    enter image description here