Recherche avancée

Médias (1)

Mot : - Tags -/portrait

Autres articles (58)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Emballe Médias : Mettre en ligne simplement des documents

    29 octobre 2010, par

    Le plugin emballe médias a été développé principalement pour la distribution mediaSPIP mais est également utilisé dans d’autres projets proches comme géodiversité par exemple. Plugins nécessaires et compatibles
    Pour fonctionner ce plugin nécessite que d’autres plugins soient installés : CFG Saisies SPIP Bonux Diogène swfupload jqueryui
    D’autres plugins peuvent être utilisés en complément afin d’améliorer ses capacités : Ancres douces Légendes photo_infos spipmotion (...)

Sur d’autres sites (5615)

  • 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
  • sandboxed electron app cant use ffmpeg (mac apple store)

    3 janvier 2021, par Martin

    I am trying to build an electron application for the mac apple store that uses ffmpeg.

    


    I can use fluent-ffmpeg locally fine and It continues to work when I build my app for windows/mac/linux, but when I build a sandoxed Mac Apple Store (MAS) .app file and sign the .app file, fluent-ffmpeg does not work anymore, and throws an ffmpeg was killed with signal SIGILL error in console :

    


    enter image description here

    


    Fluent-ffmpeg gets setup with this javscript code :

    


            //begin get ffmpeg info
        const ffmpeg = require('fluent-ffmpeg');
        //Get the paths to the packaged versions of the binaries we want to use
        var ffmpegPath = require('ffmpeg-static-electron').path;
        ffmpegPath = ffmpegPath.replace('app.asar', 'app.asar.unpacked')
        var ffprobePath = require('ffprobe-static-electron').path;
        ffprobePath = ffprobePath.replace('app.asar', 'app.asar.unpacked')
        //tell the ffmpeg package where it can find the needed binaries.
        
        ffmpeg.setFfmpegPath(ffmpegPath)//("./src/ffmpeg/ffmpeg");
        ffmpeg.setFfprobePath(ffprobePath)//("./src/ffmpeg/ffprobe");
        
        //end set ffmpeg info


    


    I have looked into this issue some and found similar questions, like this stackoverflow answer (link here) which says to compile a static ffmpeg executable and use that.

    


    So I learned how to compile ffmpeg from the command line using these commands on my mac terminal :

    


    git clone https://git.ffmpeg.org/ffmpeg.git 

./configure --pkg-config-flags="--static" --libdir=/usr/local/lib --extra-version=ntd_20150128 --disable-shared --enable-static --enable-gpl --enable-pthreads --enable-nonfree  --enable-libass --enable-libfdk-aac  --enable-libmp3lame  --enable-libx264 --enable-filters --enable-runtime-cpudetect

make



    


    After a while, I get an ffmpeg folder, which I move to my electron project's src folder /src/

    


    I place this ffmpeg folder inside my electron /src folder and change my ffmpeg setup code to use my statically built folder like so :

    


            //begin get ffmpeg info
        const ffmpeg = require('fluent-ffmpeg');
        //Get the paths to the packaged versions of the binaries we want to use
        var ffmpegPath = require('ffmpeg-static-electron').path;
        ffmpegPath = ffmpegPath.replace('app.asar', 'app.asar.unpacked')
        var ffprobePath = require('ffprobe-static-electron').path;
        ffprobePath = ffprobePath.replace('app.asar', 'app.asar.unpacked')
        //tell the ffmpeg package where it can find the needed binaries.
        
        ffmpeg.setFfmpegPath(ffmpegPath)//("./src/ffmpeg/ffmpeg");
        ffmpeg.setFfprobePath(ffprobePath)//("./src/ffmpeg/ffprobe");
        
        //end set ffmpeg info


    


    And then build / sign my app with these commands :

    


    $ electron-builder build --mac

$ sudo codesign --deep --force --verbose --sign '##(my dev id)####' dist/mas/Digify-mac.app


    


    But the final built .app file has the same error when trying to launch ffmpeg :

    


    ffmpeg was killed with signal SIGILL


    


    I've been trying to solve this issue myself but with no luck, there have been some recent posts about this on the apple developer forums :
https://developer.apple.com/forums/thread/87849

    


    but most of the other guides online are outdated.

    


    Can anyone please help me get ffmpeg working in an sandboxed electron app for the Mac Apple Store ? Any help would be much appreciated