Recherche avancée

Médias (91)

Autres articles (111)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

Sur d’autres sites (9503)

  • Convert individual pixel values from RGB to YUV420 and save the frame - C++

    24 mars 2014, par learner

    I have been working with RGB->YUV420 conversion for sometime using the FFmpeg library. Already tried the sws_scale functionality but its not working well. Now, I have decided to convert each pixel individually, using colorspace conversion formulae. So, following is the code that gets me few frames and allows me to access individual R,G,B values of each pixel :

    // Read frames and save first five frames to disk
       i=0;
       while((av_read_frame(pFormatCtx, &packet)>=0) && (i<5))
       {
           // Is this a packet from the video stream?
           if(packet.stream_index==videoStreamIdx)
           {  
               /// Decode video frame            
               avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);

               // Did we get a video frame?
               if(frameFinished)
               {
                   i++;
                   sws_scale(img_convert_ctx, (const uint8_t * const *)pFrame->data,
                             pFrame->linesize, 0, pCodecCtx->height,
                             pFrameRGB->data, pFrameRGB->linesize);

                   int x, y, R, G, B;
                   uint8_t *p = pFrameRGB->data[0];
                   for(y = 0; y < h; y++)
                   {  
                       for(x = 0; x < w; x++)
                       {
                           R = *p++;
                           G = *p++;
                           B = *p++;
                           printf(" %d-%d-%d ",R,G,B);
                       }
                   }

                   SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height, i);
               }
           }

           // Free the packet that was allocated by av_read_frame
           av_free_packet(&packet);
       }

    I read online that to convert RGB->YUV420 or vice-versa, one should first convert to YUV444 format. So, its like : RGB->YUV444->YUV420. How do I implement this in C++ ?

    Also, here is the SaveFrame() function used above. I guess this will also have to change a little since YUV420 stores data differently. How to take care of that ?

    void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame)
    {
       FILE *pFile;
       char szFilename[32];
       int  y;

       // Open file
       sprintf(szFilename, "frame%d.ppm", iFrame);
       pFile=fopen(szFilename, "wb");
       if(pFile==NULL)
           return;

       // Write header
       fprintf(pFile, "P6\n%d %d\n255\n", width, height);

       // Write pixel data
       for(y=0; ydata[0]+y*pFrame->linesize[0], 1, width*3, pFile);

       // Close file
       fclose(pFile);
    }

    Can somebody please suggest ? Many thanks !!!

  • ffmpeg output parse in batch script

    5 juin 2022, par vlad2005

    I am totally unfamiliar with scripts in Windows, but are forced to use such a script. I would like someone to help me with the following problem. I want to process the output from ffmpeg command to save information about access an webcam to be used later.
More precisely command is following :

    



    ffmpeg -stats -hide_banner -list_devices true -f dshow -i dummy


    



    and output is like this :

    



    [dshow @ 02cec400] DirectShow video devices (some may be both video and audio devices)
[dshow @ 02cec400]  "Microsoft LifeCam Studio"
[dshow @ 02cec400]     Alternative name "@device_pnp_\\?\usb#vid_045e&pid_0772&mi_00#6&2a15e69b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
[dshow @ 02cec400] DirectShow audio devices
[dshow @ 02cec400]  "Desktop Microphone (3- Studio -"
[dshow @ 02cec400]     Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Desktop Microphone (3- Studio -"
[dshow @ 02cec400]  "Line In (High Definition Audio "
[dshow @ 02cec400]     Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Line In (High Definition Audio "
[dshow @ 02cec400]  "Microphone (High Definition Aud"
[dshow @ 02cec400]     Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Microphone (High Definition Aud"


    



    Typically, the first two occurence for ”Alternative name” from DirectShow correspond to video and audio, so for simplicity I want these two information saved in two variables.
In this example is :

    



    @device_pnp_\\?\usb#vid_045e&pid_0772&mi_00#6&2a15e69b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global


    



    and

    



    @device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Desktop Microphone (3- Studio -


    



    Can someone more experienced to help me with this task ?
Thanks in advance !

    


  • Revision 3273 : On utilise notation et on définit un critère _dist pour notation plutot

    18 avril 2010, par kent1 — Log

    On utilise notation et on définit un critère _dist pour notation plutot