Recherche avancée

Médias (0)

Mot : - Tags -/presse-papier

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

Autres articles (74)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

Sur d’autres sites (4480)

  • Why i am not able to store AVFrame* to buffer

    14 octobre 2019, par sam

    I want to store AVframe* to a buffer.
    I am reading a AVI file and would want to store the AVframe* to a std::vector Buffer.

    I am able to save AVFrame *av_frame to the buffer but i want to save AVFrame *gl_frame to the buffer and reuse it later to update GL_TEXTURE_2D.

    But nothing gets saved in the buffer when i try to save AVFrame *gl_frame.

    This is the structure for Application data.

    typedef struct {

       AVFormatContext *fmt_ctx;
       int stream_idx;
       AVStream *video_stream;
       AVCodecContext *codec_ctx;
       AVCodec *decoder;
       AVPacket *packet;
       AVFrame *av_frame;
       AVFrame *gl_frame;
       struct SwsContext *conv_ctx;
       unsigned int  frame_tex;

    }AppData;

    i Initialize the structure.

    // Do Clip Realted Stuff
       avformat_network_init();
       initializeAppData();

       // open video
       if (avformat_open_input(&data.fmt_ctx, stdstrPathOfVideo.c_str(), NULL, NULL) < 0) {
           clearAppData();
           return;
       }

       // find stream info
       if (avformat_find_stream_info(data.fmt_ctx, NULL) < 0) {
           clearAppData();
           return;
       }

       // find the video stream
       for (unsigned int i = 0; i < data.fmt_ctx->nb_streams; ++i)
       {
           if (data.fmt_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
           {
               data.stream_idx = i;
               break;
           }
       }


       if (data.stream_idx == -1)
       {
           clearAppData();
           return;
       }

       data.video_stream = data.fmt_ctx->streams[data.stream_idx];
       data.codec_ctx = data.video_stream->codec;

       // find the decoder
       data.decoder = avcodec_find_decoder(data.codec_ctx->codec_id);
       if (data.decoder == NULL)
       {
           clearAppData();
           return;
       }

       // open the decoder
       if (avcodec_open2(data.codec_ctx, data.decoder, NULL) < 0)
       {
           clearAppData();
           return;
       }

       // allocate the video frames
       data.av_frame = av_frame_alloc();
       data.gl_frame = av_frame_alloc();
       int size = avpicture_get_size(AV_PIX_FMT_RGBA, data.codec_ctx->width,
           data.codec_ctx->height);
       uint8_t *internal_buffer = (uint8_t *)av_malloc(size * sizeof(uint8_t));
       avpicture_fill((AVPicture *)data.gl_frame, internal_buffer, AV_PIX_FMT_RGBA,
           data.codec_ctx->width, data.codec_ctx->height);
       data.packet = (AVPacket *)av_malloc(sizeof(AVPacket));

    Current code works when i save data.av_frame but when i try to replace it with data.gl_frame than nothing gets saved.

    How can i save data->gl_frame to buffer.

    bool Sum_ClipPlayer::Sum_ClipPlayer::initReadFrame()
    {
       do {

           glBindTexture(GL_TEXTURE_2D, data.frame_tex);
           int error = av_read_frame(data.fmt_ctx, data.packet);

           if (error)
           {          
               av_free_packet(data.packet);
               return false;
           }


           if (data.packet->stream_index == data.stream_idx)
           {
               int frame_finished = 0;

               if (avcodec_decode_video2(data.codec_ctx, data.av_frame, &frame_finished,
                   data.packet) < 0) {
                   av_free_packet(data.packet);
                   return false;
               }

               if (frame_finished)
               {              
                   if (!data.conv_ctx)
                   {
                       data.conv_ctx = sws_getContext(data.codec_ctx->width,
                           data.codec_ctx->height, data.codec_ctx->pix_fmt,
                           data.codec_ctx->width, data.codec_ctx->height, AV_PIX_FMT_RGBA,
                           SWS_BICUBIC, NULL, NULL, NULL);
                   }
                   sws_scale(data.conv_ctx, data.av_frame->data, data.av_frame->linesize, 0,
                       data.codec_ctx->height, data.gl_frame->data, data.gl_frame->linesize);

                   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, data.codec_ctx->width,
                       data.codec_ctx->height, GL_RGBA, GL_UNSIGNED_BYTE,
                       data.gl_frame->data[0]);    


                   AVFrame *cachedValue = av_frame_alloc();
                   cachedValue->format = data.av_frame->format;
                   cachedValue->width = data.av_frame->width;
                   cachedValue->height = data.av_frame->height;
                   cachedValue->channels = data.av_frame->channels;
                   cachedValue->channel_layout = data.av_frame->channel_layout;
                   cachedValue->nb_samples = data.av_frame->nb_samples;
                   av_frame_get_buffer(cachedValue, 32);
                   av_frame_copy(cachedValue, data.av_frame);
                   av_frame_copy_props(cachedValue, data.av_frame);
                   cache.push_back(cachedValue);
               }
           }


       } while (data.packet->stream_index != data.stream_idx);
       return true;
    }
  • fftools/ffmpeg_filter : store just the link label in OutputFilter

    21 mai 2023, par Anton Khirnov
    fftools/ffmpeg_filter : store just the link label in OutputFilter
    

    Not the entire AVFilterInOut. This is simpler.

    • [DH] fftools/ffmpeg.h
    • [DH] fftools/ffmpeg_filter.c
    • [DH] fftools/ffmpeg_mux_init.c
  • Revision 2c04e85d06 : Merge "Store/read 16x16 block statistics obtained from the first pass"

    2 juillet 2014, par Pengchong Jin

    Merge "Store/read 16x16 block statistics obtained from the first pass"