Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (33)

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

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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (5136)

  • FFMPEG scaling, how to set scale so width AND height don't exceed a certain amount ?

    12 octobre 2013, par Darius

    I have 2 videos, one is 500 pixels by 100 pixels (just an example, like something recorded sideways on an iphone). And a 1980 x 400 pixels videos. I need the video to convert maintaining aspect ratios. I know of the -vf scale filter such as -vf scale=-1:320, but that only takes the width and scales the height accordingly. My 500 x 100 video would be 320px wide and 1600 pixels tall. That's bad, I need it to be max 500 pixels tall and max width of 320 (just example sizes).

    How would I configure the -vf scale function to do that ?

    Using latest ffmpeg 0.11

    Recap : scale any video to max 500 height : 320 width while keeping aspect ratio

  • FFmpeg mp4 videos load very slow outside of network

    6 juin 2014, par user3550401

    I used ffmpeg to convert my videos to mp4 using libx264 and qt fast start. Im playing my videos through the HTML tag, and when im inside my network where my website is, everything plays fast. But when i try to play the video from an outside network, I have to wait about 10 seconds before a 5 second video is played. And even when its playing, its super choppy. Any reason on why this is ? I am playing the videos in Safari on my iPhone.

    Here is how im encoding my videos :

    ffmpeg -i video.ts -i css/watermark.png -filter_complex overlay=10:main_h-overlay_h-10 -shortest -b:v 800k -vcodec libx264 -acodec libfaac -ar 44100 -ac 2 -b:a 128k -movflags faststart -map_metadata -1 video.mp4

  • Render YUV video in OpenGL of ffmpeg using CVPixelBufferRef and Shaders

    4 septembre 2012, par resident_

    I'm using to render YUV frames of ffmpeg with the iOS 5.0 method "CVOpenGLESTextureCacheCreateTextureFromImage".

    I'm using like the apple example GLCameraRipple

    My result in iPhone screen is this : iPhone Screen

    I need to know I'm doing wrong.

    I put part of my code to find errors.

    ffmpeg configure frames :

    ctx->p_sws_ctx = sws_getContext(ctx->p_video_ctx->width,
                                   ctx->p_video_ctx->height,
                                   ctx->p_video_ctx->pix_fmt,
                                   ctx->p_video_ctx->width,
                                   ctx->p_video_ctx->height,
                                   PIX_FMT_YUV420P, SWS_FAST_BILINEAR, NULL, NULL, NULL);


    // Framebuffer for RGB data
    ctx->p_frame_buffer = malloc(avpicture_get_size(PIX_FMT_YUV420P,
                                                   ctx->p_video_ctx->width,
                                                   ctx->p_video_ctx->height));

    avpicture_fill((AVPicture*)ctx->p_picture_rgb, ctx->p_frame_buffer,PIX_FMT_YUV420P,
                  ctx->p_video_ctx->width,
                  ctx->p_video_ctx->height);

    My render method :

    if (NULL == videoTextureCache) {
       NSLog(@"displayPixelBuffer error");
       return;
    }    


    CVPixelBufferRef pixelBuffer;    
      CVPixelBufferCreateWithBytes(kCFAllocatorDefault, mTexW, mTexH, kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange, buffer, mFrameW * 3, NULL, 0, NULL, &pixelBuffer);



    CVReturn err;    
    // Y-plane
    glActiveTexture(GL_TEXTURE0);
    err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault,
                                                      videoTextureCache,
                                                      pixelBuffer,
                                                      NULL,
                                                      GL_TEXTURE_2D,
                                                      GL_RED_EXT,
                                                      mTexW,
                                                      mTexH,
                                                      GL_RED_EXT,
                                                      GL_UNSIGNED_BYTE,
                                                      0,
                                                      &_lumaTexture);
    if (err)
    {
       NSLog(@"Error at CVOpenGLESTextureCacheCreateTextureFromImage %d", err);
    }  

    glBindTexture(CVOpenGLESTextureGetTarget(_lumaTexture), CVOpenGLESTextureGetName(_lumaTexture));
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);    

    // UV-plane
    glActiveTexture(GL_TEXTURE1);
    err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault,
                                                      videoTextureCache,
                                                      pixelBuffer,
                                                      NULL,
                                                      GL_TEXTURE_2D,
                                                      GL_RG_EXT,
                                                      mTexW/2,
                                                      mTexH/2,
                                                      GL_RG_EXT,
                                                      GL_UNSIGNED_BYTE,
                                                      1,
                                                      &_chromaTexture);
    if (err)
    {
       NSLog(@"Error at CVOpenGLESTextureCacheCreateTextureFromImage %d", err);
    }

    glBindTexture(CVOpenGLESTextureGetTarget(_chromaTexture), CVOpenGLESTextureGetName(_chromaTexture));
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);    

    glBindFramebuffer(GL_FRAMEBUFFER, defaultFramebuffer);

    // Set the view port to the entire view
    glViewport(0, 0, backingWidth, backingHeight);

    static const GLfloat squareVertices[] = {
       1.0f, 1.0f,
       -1.0f, 1.0f,
       1.0f,  -1.0f,
       -1.0f,  -1.0f,
    };

    GLfloat textureVertices[] = {
       1, 1,
       1, 0,
       0, 1,
       0, 0,
    };

    // Draw the texture on the screen with OpenGL ES 2
    [self renderWithSquareVertices:squareVertices textureVertices:textureVertices];


    // Flush the CVOpenGLESTexture cache and release the texture
    CVOpenGLESTextureCacheFlush(videoTextureCache, 0);    
    CVPixelBufferRelease(pixelBuffer);    

    [moviePlayerDelegate bufferDone];

    RenderWithSquareVertices method

       - (void)renderWithSquareVertices:(const GLfloat*)squareVertices textureVertices:(const GLfloat*)textureVertices
    {


     // Use shader program.
       glUseProgram(shader.program);

    // Update attribute values.
    glVertexAttribPointer(ATTRIB_VERTEX, 2, GL_FLOAT, 0, 0, squareVertices);
    glEnableVertexAttribArray(ATTRIB_VERTEX);
    glVertexAttribPointer(ATTRIB_TEXTUREPOSITON, 2, GL_FLOAT, 0, 0, textureVertices);
    glEnableVertexAttribArray(ATTRIB_TEXTUREPOSITON);

    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

    // Present
    glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer);
    [context presentRenderbuffer:GL_RENDERBUFFER];

    }

    My fragment shader :

    uniform sampler2D SamplerY;
    uniform sampler2D SamplerUV;


    varying highp vec2 _texcoord;

    void main()
    {

    mediump vec3 yuv;
    lowp vec3 rgb;

    yuv.x = texture2D(SamplerY, _texcoord).r;
    yuv.yz = texture2D(SamplerUV, _texcoord).rg - vec2(0.5, 0.5);

    // BT.601, which is the standard for SDTV is provided as a reference

    /* rgb = mat3(    1,       1,     1,
    0, -.34413, 1.772,
    1.402, -.71414,     0) * yuv;*/


    // Using BT.709 which is the standard for HDTV
    rgb = mat3(      1,       1,      1,
              0, -.18732, 1.8556,
              1.57481, -.46813,      0) * yuv;

      gl_FragColor = vec4(rgb, 1);

    }

    Very thanks,