Recherche avancée

Médias (2)

Mot : - Tags -/rotation

Autres articles (62)

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • 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 (...)

Sur d’autres sites (11398)

  • Scaling an image according to audio (threshold, frequencies)

    11 juillet 2022, par UnlockeerFromFrance

    I am looking for scaling a PNG file according to an audio provided, a frequency range (20hz-1000hz for example) and a threshold, for a smooth effect.
For example, when there is a kick, scale go to 120% smoothly, I would like to make those audio visualizers such as dubstep, etc... where when kicks comes in, their image are "pumping".
First, is it doable with ffmpeg ?
Where to start ?
I found showcqt that takes frequencies in input etc., but its output is a video so I don't think I can use it in my case. Any help appreciated.

    


  • FFMPEG Image to video zoompan starting position

    4 août 2018, par lchn

    In creating mp4 slideshows out of images, I’ve taken some examples online for zoompan, but I still haven’t quite grasped how to make them start from a certain location in an image. Here’s the typical command :

    ffmpeg -i image-000.jpg -filter_complex "color=c=black:r=60:s=1920x1080[demo] ;[0:v]format=pix_fmts=yuva420p,scale=8000 :-1,zoompan=z=’min(zoom+0.0005,1.2)’:s=2000x1333:d=360:x=’if(gte(zoom,0.9),x,x+1/a)’:y=’if(gte(zoom,0.9),y,y+1)’,fade=in:0:25:alpha=1,setpts=PTS-STARTPTS+0.0/TB[v0] ;[demo][v0]overlay=format=yuv420"
    - t 6 -c:v libx264 -y out000.mp4

    Photos I use are typically 3x2 or 4x3 in aspect ratio, so I get that they’d have to be cut off somewhere in a 16x9 video. The thing with the above code (and many other "Ken Burns effect" samples) is that they start with the bottom portion of the images cut off, then either zoom in more or zoom out, never showing the bottom.

    How do I get the animation to start further down on the image ? Nothing I do in the y=’...’ section affects it. Not even putting in constant numbers between 0 and 100000 instead of adjusting values in that formula y=’if(gte(zoom,0.9),y,y+1)’.

    Note : I’ve had some success using crop or pad for the original image, but I’d rather understand how to better position zoompan inside of the image.

  • Swscale - image patch (NV12) color conversion - invalid border

    6 juin 2019, par dajuric

    The goal is to convert NV12 to BGR24 image, more exactly an image patch (x:0, y:0, w:220, h:220).
    The issue is the undefined pixel column on the right of the converted patch as shown :
    enter image description here

    The question is why is this happening (even though the coordinates and the dimensions of the patch have even values) ?
    (Interestingly enough for an odd width value, that issue is not present)


    The patch has the following bounding box : (x:0, y:0, w:220, h:220).
    The behavior should be reproducible with any image. Conversion can be done using the ppm conversion page.

    The following code creates a nv12 image from a bgr24 image and then converts a nv12 patch back to bgr24 patch. If everything worked properly the output should have been identical to a source image.

    #include <libswscale></libswscale>swscale.h>
    #include <libavutil></libavutil>imgutils.h>

    void readPPM(const char* filename, uint8_t** bgrData, int* stride, int* w, int* h)
    {
       FILE* fp = fopen(filename, "rb");
       fscanf(fp, "%*s\n"); //skip format check

       fscanf(fp, "%d %d\n", w, h);
       fscanf(fp, "%*d\n"); //skip max value check

       *stride = *w * 3;
       *bgrData = av_malloc(*h * *stride);

       for (int r = 0; r &lt; *h; r++)
       {
           uint8_t* rowData = *bgrData + r * *stride;
           for (int c = 0; c &lt; *w; c++)
           {
               //rgb -> bgr
               fread(&amp;rowData[2], 1, 1, fp);
               fread(&amp;rowData[1], 1, 1, fp);
               fread(&amp;rowData[0], 1, 1, fp);

               rowData += 3;
           }
       }

       fclose(fp);
    }

    void writePPM(const char* filename, uint8_t* bgrData, int stride, int w, int h)
    {
       FILE* fp = fopen(filename, "wb");
       fprintf(fp, "P6\n");
       fprintf(fp, "%d %d\n", w, h);
       fprintf(fp, "%d\n", 255);

       for (int r = 0; r &lt; h; r++)
       {
           uint8_t* rowData = bgrData + r * stride;
           for (int c = 0; c &lt; w; c++)
           {
               //bgr -> rgb
               fwrite(&amp;rowData[2], 1, 1, fp);
               fwrite(&amp;rowData[1], 1, 1, fp);
               fwrite(&amp;rowData[0], 1, 1, fp);

               rowData += 3;      
           }
       }

       fclose(fp);
    }


    void bgrToNV12(uint8_t* srcData[4], int srcStride[4],
                  uint8_t* tgtData[4], int tgtStride[4],
                  int w, int h)
    {
       struct SwsContext* context = sws_getContext(w, h, AV_PIX_FMT_BGR24,
                                                   w, h, AV_PIX_FMT_NV12, SWS_POINT, NULL, NULL, NULL);
       {
           sws_scale(context,
                     srcData, srcStride, 0, h,
                     tgtData, tgtStride);
       }
       sws_freeContext(context);
    }

    void nv12ToBgr(uint8_t* srcData[4], int srcStride[4],
                  uint8_t* tgtData[4], int tgtStride[4],
                  int w, int h)
    {
       struct SwsContext* context = sws_getContext(w, h, AV_PIX_FMT_NV12,
                                                   w, h, AV_PIX_FMT_BGR24, SWS_POINT, NULL, NULL, NULL);
       {
           sws_scale(context,
                     srcData, srcStride, 0, h,
                     tgtData, tgtStride);
       }
       sws_freeContext(context);
    }


    int main()
    {
       //load BGR image
       uint8_t* bgrData[4]; int bgrStride[4]; int bgrW, bgrH;
       readPPM("sample.ppm", &amp;bgrData[0], &amp;bgrStride[0], &amp;bgrW, &amp;bgrH);

       //create NV12 image from the BGR image
       uint8_t* nv12Data[4]; int nv12Stride[4];
       av_image_alloc(nv12Data, nv12Stride, bgrW, bgrH, AV_PIX_FMT_NV12, 16);
       bgrToNV12(bgrData, bgrStride, nv12Data, nv12Stride, bgrW, bgrH);

       //convert nv12 patch to bgr patch
       nv12ToBgr(nv12Data, nv12Stride, bgrData, bgrStride, 220, 220);   //invalid result (random column stripe)
       //nv12ToBgr(nv12Data, nv12Stride, bgrData, bgrStride, 221, 220); //valid result

       //save bgr image (should be exactly as original BGR image)
       writePPM("sample-out.ppm", bgrData[0], bgrStride[0], bgrW, bgrH);

       //cleanup
       av_freep(bgrData);
       av_freep(nv12Data);
       return 0;
    }