Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (71)

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

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (11413)

  • Decoded YUV shows green edge when rendered with OpenGL

    2 février 2023, par Alex

    Any idea, why decoded YUV -> RGB(shader conversion) has that extra green edge on the right side ?
    
Almost any 1080X1920 video seems to have this issue.

    


    enter image description here

    


    A screen recording of the issue is uploaded here https://imgur.com/a/JtUZq4h

    


    Once I manually scale up the texture width, I can see it fills up to the viewport, but it would be nice if I could fix the actual cause. Is it some padding that's part of YUV colorspace ? What else could it be ?

    


    My model is -1 to 1, filling the entire width
    
The texture coordinates are also 0 to 1 ratio

    


    float vertices[] = {
    -1.0, 1.0f, 0.0f, 0.0,     // top left
     1.0f, 1.0f, 1.0, 0.0,      // top right
    -1.0f, -1.0f, 0.0f, 1.0f,  // bottom left
     1.0f, -1.0f, 1.0f, 1.0f    // bottom right
};


    


    Fragment Shader

    


    #version 330 core

in vec2 TexCoord;

out vec4 FragColor;
precision highp float;
uniform sampler2D textureY;
uniform sampler2D textureU;
uniform sampler2D textureV;
uniform float alpha;
uniform vec2 texScale;


void main()
{
    float y = texture(textureY, TexCoord / texScale).r;
    float u = texture(textureU, TexCoord / texScale).r - 0.5; 
    float v = texture(textureV, TexCoord / texScale).r - 0.5;
    
    vec3 rgb;
    
    //yuv - 709
    rgb.r = clamp(y + (1.402 * v), 0, 255);
    rgb.g = clamp(y - (0.2126 * 1.5748 / 0.7152) * u - (0.0722 * 1.8556 / 0.7152) * v, 0, 255);
    rgb.b = clamp(y + (1.8556 * u), 0,255);

    FragColor = vec4(rgb, 1.0);
} 


    


    Texture Class

    


    class VideoTexture {
   public:
    VideoTexture(Decoder *dec) : decoder(dec) {
        glGenTextures(1, &texture1);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glBindTexture(GL_TEXTURE_2D, texture1);
        glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, decoder->frameQueue.first().linesize[0], decoder->frameQueue.first().height, 0, format, GL_UNSIGNED_BYTE, 0);
        glGenerateMipmap(GL_TEXTURE_2D);

        glGenTextures(1, &texture2);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glBindTexture(GL_TEXTURE_2D, texture2);
        glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, decoder->frameQueue.first().linesize[1], decoder->frameQueue.first().height / 2, 0, format, GL_UNSIGNED_BYTE, 0);
        glGenerateMipmap(GL_TEXTURE_2D);

        glGenTextures(1, &texture3);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glBindTexture(GL_TEXTURE_2D, texture3);
        glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, decoder->frameQueue.first().linesize[2], decoder->frameQueue.first().height / 2, 0, format, GL_UNSIGNED_BYTE, 0);
        glGenerateMipmap(GL_TEXTURE_2D);
    }

    void Render(Shader *shader, Gui *gui) {
        if (decoder->frameQueue.isEmpty()) {
            return;
        }

        glActiveTexture(GL_TEXTURE0);
        glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, decoder->frameQueue.first().linesize[0], decoder->frameQueue.first().height, format, GL_UNSIGNED_BYTE, decoder->frameQueue.at(currentFrame).data[0]);
        glBindTexture(GL_TEXTURE_2D, texture1);
        shader->setInt("textureY", 0);

        glActiveTexture(GL_TEXTURE1);
        glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, decoder->frameQueue.first().linesize[1], decoder->frameQueue.first().height / 2, format, GL_UNSIGNED_BYTE, decoder->frameQueue.at(currentFrame).data[1]);
        glBindTexture(GL_TEXTURE_2D, texture2);
        shader->setInt("textureU", 1);

        glActiveTexture(GL_TEXTURE2);
        glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, decoder->frameQueue.first().linesize[2], decoder->frameQueue.first().height / 2, format, GL_UNSIGNED_BYTE, decoder->frameQueue.at(currentFrame).data[2]);
        glBindTexture(GL_TEXTURE_2D, texture3);
        shader->setInt("textureV", 2);
    }

    ~VideoTexture() {
        printf("\nVideo texture destructor");
        glDeleteTextures(1, &texture1);
        glDeleteTextures(1, &texture2);
        glDeleteTextures(1, &texture3);
    }

   private:
    GLuint texture1;
    GLuint texture2;
    GLuint texture3;
    GLint internalFormat = GL_RG8;
    GLint format = GL_RED;
    int currentFrame = 0;
    Decoder *decoder;
}


    


  • How to generate a GIF thumbnail from a video without saving individual frames to disk ?

    12 mars 2023, par Rabie Daddi

    I have a Node.js script that uses fluent-FFmpeg to generate a GIF thumbnail from a video for the first 4 seconds. Currently, the script saves individual frames as PNG images to disk, and then reads them back in to generate the GIF. However, this creates a lot of unnecessary I/O.

    


    Is there a way to modify the script to generate the GIF directly from the video frames, without saving them to disk first ? Ideally, I would like to do this while still using FFmpeg for the processing.

    


    Here's the current code for generating the frames and the GIF :

    


    function generateFrames(videoUrl) {
  return new Promise((resolve, reject) => {
    ffmpeg(videoUrl)
      .setStartTime(0) // start at 0 seconds
      .setDuration(4) // cut 4 seconds
      .videoFilters('scale=if(gte(iw\\,ih)\\,min(600\\,iw)\\,-2):if(lt(iw\\,ih)\\,min(600\\,ih)\\,-2)')
      .fps(4)
      .output('output/img%04d.png') // output file pattern with %04d indicating a sequence number with four digits
      .on('end', () => {
        console.log('GIF generated successfully!');
        resolve()
      })
      .on('error', (err) => {
        console.log('Error generating GIF: ' + err.message);
        reject()
      })
      .run();
  });
}

function generateGif() {
  const inputPattern = 'output/img%04d.png';
  const outputFilename = 'output/output2.gif';

  ffmpeg(inputPattern)
    .inputFPS(9)
    .output(outputFilename)
    .on('error', (err) => {
      console.log('Error generating GIF: ' + err.message);
    })
    .run();
}


execute = async () => {
  await generateFrames('video.mp4')
  generateGif()
}

execute()


    


    Any help or suggestions would be greatly appreciated. Thank you !

    


  • ImageJ / Fiji shows wrong number of frames in video (FFMPEG import)

    28 avril 2023, par locoric_polska

    I am counting the number of animals in a an area using Fiji. I import the video through the FFMPEG plug-in (videos are mp4 with mpeg-4 codec). However, I noticed that when I import the videos Fiji uploads the wrong number of frames, and I cannot understand why and how.

    


    An example. I have a video shot at 25fps which is 1582s long. If I do the calculations the video should have 39550 frames in total (1582*25). When I open it through a Computer vision package in R, I see that the video correctly contains 39550 frames. However, when loaded in Fiji, the shown number of frames is 49511. So Fiji is adding 9961 frames to the video. This is consistent across all videos that are recorded in 25fps, while it does not appear in videos shot at 24fps.

    


    Curiously, I found that the ratio between the number of frames read by Fiji and the 'real' number of frames is consistent between 0.79 and 0.80. This makes me think that Fiji is expecting the video to be 30fps and (possibly) duplicating frames to adjust the video to this assumption.

    


    Unfortunately, I discovered all this after finishing my analysis and while trying to merge this dataset with another obtained through CV. The number of frame does not match between datasets and I am not sure how to solve this.

    


    Any help would be greatly appreciated !!

    


    An idea is to multiply all the frame numbers by 0.8 to adjust them to the old assumption. This solution assumes that Fiji is duplicating frames throughout the video in a consistent way