Recherche avancée

Médias (0)

Mot : - Tags -/signalement

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

Autres articles (99)

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

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

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

  • How to prevent the video generated by ffmpeg from flickering when converting from RGB to YUV using sws_scale() ?

    30 mai 2019, par LeFrosch

    I am generating images and loading them as a RGBA Bitmaps into my c++ program. Then I want to generate a video with ffmpeg using those images. As far as I found out I need to convert them to YUV using sws_scale(). Everything works fine except the generated video is flickering.

    I already tried to change the sws_getContext() flag. SWS_BILINEAR | SWS_ACCURATE_RND are preventing some of the flickering but not all. I also tried to change my EncodeVideo method but this also did effect the result.

    // creating the SwsContext
    this->data->convertContext = sws_getContext(
               data->outputCodecContext->width,
               data->outputCodecContext->height,
               IN_PXEL_FORMAT, // libffmpeg::AV_PIX_FMT_RGB24
               data->outputCodecContext->width,
               data->outputCodecContext->height,
               PIXEL_FORMAT, // libffmpeg::AV_PIX_FMT_YUV420P
               SWS_BILINEAR | SWS_ACCURATE_RND,
               NULL, NULL, NULL);

    // the bitmap which contains the rgb image
    Bitmap^ frame = generateImage();

    // copying the bitmap to the libffmpeg::AVFrame
    for (int x = 0; x < width; x++)
    {
       for (int y = 0; y < height; y++)
       {
           Color c = frame->GetPixel(x, y);
           data->outputFrameRGB->data[0][y * data->outputFrameRGB->linesize[0] + 3 * x] = c.R;
           data->outputFrameRGB->data[0][y * data->outputFrameRGB->linesize[0] + 3 * x + 1] = c.G;
           data->outputFrameRGB->data[0][y * data->outputFrameRGB->linesize[0] + 3 * x + 2] = c.B;
       }
    }

    // converting the rgb frame to the yuv frame
    libffmpeg::sws_scale(data->convertContext, data->outputFrameRGB->data, data->outputFrameRGB->linesize, 0, height, data->outputFrameYUV->data, data->outputFrameYUV->linesize);

    for (int i = 0; i < time.TotalSeconds * frameRate; i++)
    {
       data->outputFrameYUV->pts = data->frameCount++;

       Helper::EncodeVideo(data->outputCodecContext, data->outputFrameYUV, data->packet, data->outputFile);
    }

    The Methode which encodes the video :

    void EncodeVideo(libffmpeg::AVCodecContext *context, libffmpeg::AVFrame *frame, libffmpeg::AVPacket *packet, libffmpeg::FILE *file)
    {
       int ret = 0;

       /* Send the frame to the encoder */
       ret = libffmpeg::avcodec_send_frame(context, frame);
       if (ret < 0)
       {
           ThrowError("Could not send frame to the encoder.", ret);
       }

       while (ret >= 0)
       {
           ret = libffmpeg::avcodec_receive_packet(context, packet);
           if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
           {
               return;
           }
           else if (ret < 0)
           {
               ThrowError("Error during encoding.", ret);
           }

           libffmpeg::fwrite(packet->data, 1, packet->size, file);
           libffmpeg::av_packet_unref(packet);
       }
    }

    The original image and this is a screenshot of the video. In the screenshot the area around the text is blurry which causes a flickering effect when played. How can I prevent this from happening ?

  • Reliably get PTS values in ffmpeg ?

    21 novembre 2013, par karl_

    I'm trying to write a method that will provide the next frame and presentation time stamp when queried. The code currently looks something like this :

    while( getNextFrame(image, pts) )
    {
       // show current image
       drawImage(currentImage);
       sleep(pts);
       currentImage = image;
    }

    I've been following the Dranger tutorials to this point, but have stalled on reliably getting a PTS value for frames (http://www.dranger.com/ffmpeg/tutorial05.html). The PTS values returned are always 0.

    Also, get_buffer() has been deprecated, so I'm now using the get_buffer2() method to set the global pts value. However, the release_buffer method has also been deprecated and I can't seem to find it's replacement. This leads me to believe that the method laid out in the tutorials may no longer be the best way of accomplishing this task.

    In short, using up to date ffmpeg, what's the best way to grab frame pts values reliably ?

  • How to use multiple map values in ffmpeg-python ?

    27 février, par kamoloff

    How can I use multiple map values for different resolutions in ffmpeg-python ?

    


        -map [v1out] -c:v:0 libx264 -b:v:0 1900k -bufsize 3800k \
    -map [v2out] -c:v:1 libx264 -b:v:0 900k -bufsize 1800k \