Recherche avancée

Médias (0)

Mot : - Tags -/metadatas

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

Autres articles (39)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (6748)

  • Why mp4 can not shared on Facebook or Instagram on Android ?

    8 janvier 2023, par János

    This is the file : https://t44-post-cover.s3.eu-central-1.amazonaws.com/2e3s.mp4

    


    When I download and try share, it fails. Why ? This is the parameters was rendered. Downloading and sharing works from iPhone to Facebook on Messenger or Instagram, but not from Android phone to Facebook on Messenger or Instagram.

    


    What parameters ffpmpeg need to be able to share mp4 from Android to Facebook / Instagram ?

    


    await new Promise<void>((resolve, reject) => {&#xA;        ffmpeg()&#xA;            .setFfmpegPath(pathToFfmpeg)&#xA;            .input(`/tmp/input_${imgId}.gif`)&#xA;            .inputFormat(&#x27;gif&#x27;)&#xA;            .inputFPS(30)&#xA;            .input(&#x27;anullsrc&#x27;)&#xA;            .inputFormat(&#x27;lavfi&#x27;)&#xA;            .audioCodec(&#x27;aac&#x27;)&#xA;            .audioChannels(2)&#xA;            .audioFilters([&#x27;apad&#x27;])&#xA;            .videoCodec(&#x27;libx264&#x27;)&#xA;            .videoBitrate(1000)&#xA;            .videoFilters([&#xA;                &#x27;tpad=stop_mode=clone:stop_duration=2&#x27;,&#xA;                &#x27;scale=trunc(iw/2)*2:trunc(ih/2)*2:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse&#x27;,&#xA;            ])&#xA;            .fps(30)&#xA;            .duration(5)&#xA;            .format(&#x27;mp4&#x27;)&#xA;            .outputOptions([&#xA;                &#x27;-pix_fmt yuvj420p&#x27;,&#xA;                &#x27;-profile:v baseline&#x27;,&#xA;                &#x27;-level 3.0&#x27;,&#xA;                &#x27;-crf 17&#x27;,&#xA;                &#x27;-movflags &#x2B;faststart&#x27;,&#xA;                &#x27;-movflags frag_keyframe&#x2B;empty_moov&#x27;,&#xA;            ])&#xA;            .output(`/tmp/output_${imgId}.mp4`)&#xA;            .on(&#x27;end&#x27;, () => {&#xA;                console.log(&#x27;MP4 video generated&#x27;)&#xA;                resolve()&#xA;            })&#xA;            .on(&#x27;error&#x27;, (e) => {&#xA;                console.log(e)&#xA;                reject()&#xA;            })&#xA;            .run()&#xA;    })&#xA;</void>

    &#xA;

  • 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, &amp;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,
                                                      &amp;_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,
                                                      &amp;_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,

  • How can I combine HDR video with a still PNG in FFMPEG without messing up colors ?

    2 juin 2022, par Robert

    I'm trying to add a still image to the end of a video as a title-card. Normally this is simple, but the video is HDR (shot on an iPhone) and for reasons I don't understand that's causing the colors in the PNG to go nuts.

    &#xA;

    Here's the original png :&#xA;Original colors

    &#xA;

    Here's a screenshot from the end of the output video :&#xA;Changed colors

    &#xA;

    Clearly something is amiss. I made the PNG image in Photoshop from a photo, and I've tried it with and without embedding the color profile without any noticeable difference.

    &#xA;

    Here's the command for ffmpeg :

    &#xA;

    ffmpeg -y\&#xA; -t 5 -i &#x27;../inputs/video.MOV&#x27;\&#xA; -loop 1 -t 5 -i &#x27;../../common/end-youtube.png&#x27;\&#xA; -filter_complex &#x27;&#xA;[1:v] fade=type=in:duration=1:alpha=1, setpts=PTS-STARTPTS&#x2B;5/TB[end];&#xA;[0:v][end] overlay [outV]&#xA;&#x27;\&#xA; -map [outV] &#x27;../test.mp4&#x27;&#xA;

    &#xA;

    I've tried this with non-HDR videos and the colors look perfectly normal, so clearly the HDRness is somehow involved. I've also tried adding this line to set the colorspace etc of the output. It helps with the PNG (although it's not perfect) but then the video is washed out.

    &#xA;

     -colorspace bt709 -color_trc bt709 -color_primaries bt709 -color_range mpeg \&#xA;

    &#xA;

    I don't really care if the output video is HDR or not, as long as the video and png parts both look visually close to the inputs. This is something I'll need to do to many videos, so if possible a solution that doesn't involve tweaking colors for each one would be ideal.

    &#xA;