Recherche avancée

Médias (91)

Autres articles (67)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (6449)

  • Révision 18908 : Il est d’usage que les langues soient écrites dans leur alphabet ...

    10 janvier 2012, par kent1 -

    Résolu pour le kurde کوردی (cf : http://en.wikipedia.org/wiki/Kurdish_language) et le pachto (ou pashto ou pachtoune) پښتو (cf : http://en.wikipedia.org/wiki/Pashto) Ces deux langues posaient problèmes pour le menu de langue car RTL, peut être qu’il y en a (...)

  • Anomalie #3495 : Il manque peut-être un accent à icône

    3 juillet 2015

    wikipedia préfère icône
    https://fr.wikipedia.org/wiki/Ic%C3%B4ne

    je serais pour laisser le chapeau pour éviter la confusion avec l’anglais

  • FFmpeg - negative value returned from avcodec_receive_frame when open another video

    24 avril 2019, par Jinx

    I’ve been trying to extract frames from a video then convert them to images saved on the disk. My code always works perfectly for the first video opened, which means if I open another video or the same video again something happen will happen. I’m sure that I’ve cleared and closed format context and codec context.

    When I opened a new video, avcodec_receive_frame() returned -11 and avio_open() returned -2. What’s more, it does’t point out why avcodec_receive_frame() returns a negative value and so is avio_open().

    avcodec_receive_frame()

    other negative values : legitimate decoding errors

    avio_open()

    @return >= 0 in case of success, a negative value corresponding to an * AVERROR code in case of failure

    ImageExtractor.cpp

    clear and close everything

    void ImageExtractor::unload()
    {
       QMutexLocker LOCKER(&mutex);
       if (!format_ctx)
           return;
       avformat_flush(format_ctx);
       if (!format_ctx)
           return;
       avformat_close_input(&format_ctx);

       if (!codec_ctx)
           return;

       avcodec_flush_buffers(codec_ctx);
       avcodec_free_context(&codec_ctx);
       avcodec_close(codec_ctx);
       av_free(codec_ctx);

       loaded = false;
    }

    open format context

    void ImageExtractor::load()
    {
       unload();
       QMutexLocker LOCKER(&mutex);
       int ret;
       format_ctx = avformat_alloc_context();
       ret = avformat_open_input(&format_ctx, source.toLocal8Bit(), nullptr, nullptr);
       // some other code here
       codec_par = avcodec_parameters_alloc();
       avcodec_parameters_copy(codec_par, format_ctx->streams[vsi]->codecpar);
    }

    open codec context

    bool ImageExtractor::openCodec()
    {
       if (!codec_par)
           return false;
       QMutexLocker LOCKER(&mutex);
       AVCodec* codec = avcodec_find_decoder(codec_par->codec_id);
       if (!codec) {
           unload();
           // some other code
       }
       codec_ctx = avcodec_alloc_context3(codec);
       avcodec_parameters_to_context(codec_ctx, codec_par);
       avcodec_parameters_free(&codec_par);

       int ret = avcodec_open2(codec_ctx, codec, 0);
       if (ret != 0) {
           unload();
           // some other code
       }
       return true;
    }

    decode

    void ImageExtractor::decode()
    {
       if (!format_ctx || !codec_ctx)
           return;
       QMutexLocker LOCKER(&mutex);
       char buf[1024];
       AVPacket* packet = av_packet_alloc();
       AVFrame* frame = av_frame_alloc();
       int ret;

       int count = 1;
       while (true) {
           ret = av_read_frame(format_ctx, packet);

           if (ret == AVERROR_EOF) {
              // some other code
           }

           if (packet->stream_index == vsi) {
               ret = avcodec_send_packet(codec_ctx, packet);
               if (ret < 0) {
                   continue;
               }
               ret = avcodec_receive_frame(codec_ctx, frame);
               if (ret == 0) {
                   snprintf(buf, sizeof(buf), "%s/%d.jpg", destination.toLocal8Bit().data(), count);
                   saveImage(frame, buf);
               }
               count++;
           }
           av_packet_unref(packet);
       }
       source = "";
       destination = "";
       unload();
    }

    write images to disk

    int ImageExtractor::saveImage(AVFrame *frame, char *destination) {
       AVCodecContext *pCodeCtx = NULL;
       AVFormatContext *pFormatCtx = avformat_alloc_context();
       pFormatCtx->oformat = av_guess_format("mjpeg", NULL, NULL);
       int ret = avio_open(&pFormatCtx->pb, destination, AVIO_FLAG_READ_WRITE);
       if ( ret < 0) {
           unload();
           return -1;
       }
       //some other code
    }