Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (109)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

Sur d’autres sites (12239)

  • avs : support for AviSynth+ high bit-depth pixel formats

    18 août 2016, par Anton Mitrofanov
    avs : support for AviSynth+ high bit-depth pixel formats
    
    • [DH] extras/avisynth_c.h
    • [DH] input/avs.c
  • Generating mp4 from images with libavformat has really high framerate

    13 septembre 2016, par Taylor Southwick

    I want to generate video from still shots using libav. I’ve successfully done this when the container is .avi, but I would also like to be able to output it into .mp4. However, when I try to do this, on the initial frame is shown (the .avi version works fine. I’ve created the following repro of the pertinent code using dummy picture generation.

    If you run

    CreateVideo("test.avi", 600, 300);

    It will generate a functional video. However,

    CreateVideo("test.mp4", 600, 300);

    will generate a video, but only a single frame.

    Any thoughts on why it works for .avi but not .mp4 ? Is there a setting I’m missing ?

    extern "C" {
    #include <libavformat></libavformat>avformat.h>
    #include <libavutil></libavutil>avassert.h>
    #include <libavutil></libavutil>channel_layout.h>
    #include <libavutil></libavutil>opt.h>
    #include <libavutil></libavutil>mathematics.h>
    #include <libavutil></libavutil>imgutils.h>
    #include <libswscale></libswscale>swscale.h>
    #include <libswresample></libswresample>swresample.h>
    }

    using namespace std;
    using namespace Ffmpeg;

    void AddFrame(AVPacket &amp;pkt, AVCodecContext *codec, AVFormatContext *_avFmtCtx, AVFrame *_frame, int i)
    {
       // Initialize a packet and clear data as it will be allocated by the encoder
       av_init_packet(&amp;pkt);
       pkt.data = nullptr;
       pkt.size = 0;

       i = i % 25;

       /* prepare a dummy image */
       /* Y */
       for (int y = 0; y &lt; _frame->height; y++) {
           for (int x = 0; x &lt; _frame->width; x++) {
               _frame->data[0][y * _frame->linesize[0] + x] = x + y + i * 3;
           }
       }

       /* Cb and Cr */
       for (int y = 0; y &lt; _frame->height / 2; y++) {
           for (int x = 0; x &lt; _frame->width / 2; x++) {
               _frame->data[1][y * _frame->linesize[1] + x] = 128 + y + i * 2;
               _frame->data[2][y * _frame->linesize[2] + x] = 64 + x + i * 5;
           }
       }

       int got_output;
       avcodec_encode_video2(codec, &amp;pkt, _frame, &amp;got_output);

       _frame->pts++;

       if (got_output)
       {
           av_interleaved_write_frame(_avFmtCtx, &amp;pkt);
           av_packet_unref(&amp;pkt);
       }
    }

    static void CreateVideo(string path, int width, int height)
    {
       // This will quickly exit if registration has already occurred
       av_register_all();

       AVFormatContext *_avFmtCtx;
       avformat_alloc_output_context2(&amp;_avFmtCtx, nullptr, nullptr, path.c_str());

       AVCodec *codec = avcodec_find_encoder(_avFmtCtx->oformat->video_codec);
       AVStream *_video = avformat_new_stream(_avFmtCtx, codec);

       // Customize codec
       _video->codec->coder_type = AVMEDIA_TYPE_VIDEO;
       _video->codec->bit_rate = 200000;
       _video->codec->width = width;
       _video->codec->height = height;
       _video->codec->time_base.num = 1;
       _video->codec->time_base.den = 15;
       _video->codec->gop_size = 12;
       _video->codec->pix_fmt = AV_PIX_FMT_YUV420P;

       if (_video->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO)
       {
           // Just for testing, add B-frames
    #ifdef _DEBUG
           _video->codec->max_b_frames = 2;
    #endif
       }

       if (_video->codec->codec_id == AV_CODEC_ID_MPEG1VIDEO)
       {
           _video->codec->mb_decision = 2;
       }

       if (_avFmtCtx->oformat->flags &amp; AVFMT_GLOBALHEADER)
       {
           _video->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
       }

       // Open file
       avio_open(&amp;_avFmtCtx->pb, path.c_str(), AVIO_FLAG_WRITE);
       avformat_write_header(_avFmtCtx, nullptr);

       AVFrame *_frame = av_frame_alloc();
       _frame->format = _video->codec->pix_fmt;
       _frame->width = _video->codec->width;
       _frame->height = _video->codec->height;
       _frame->pts = 0;

       /* the image can be allocated by any means and av_image_alloc() is  *
        * just the most convenient way if av_malloc() is to be used        */
       av_image_alloc(_frame->data, _frame->linesize, _video->codec->width, _video->codec->height, _video->codec->pix_fmt, 32);

       avcodec_open2(_video->codec, codec, nullptr);

       SwsContext *_swsCtx = sws_getContext(width, height,
           AV_PIX_FMT_BGRA,
           width, height,
           AV_PIX_FMT_YUV420P,
           0, 0, 0, 0);

       AVPacket packet;
       for (int i = 0; i &lt; 25; i++)
       {
           AddFrame(packet, _video->codec, _avFmtCtx, _frame, i);
       }

       /* get the delayed frames */
       int got_output = 1;
       while (got_output)
       {
           // Initialize a packet and clear data as it will be allocated by the encoder
           AVPacket pkt;
           av_init_packet(&amp;pkt);
           pkt.data = nullptr;
           pkt.size = 0;

           avcodec_encode_video2(_video->codec, &amp;pkt, nullptr, &amp;got_output);

           if (got_output)
           {
               av_interleaved_write_frame(_avFmtCtx, &amp;pkt);
               av_packet_unref(&amp;pkt);
           }
       }

       av_write_trailer(_avFmtCtx);
       avio_close(_avFmtCtx->pb);
       sws_freeContext(_swsCtx);
       av_freep(&amp;_frame->data);
       av_frame_free(&amp;_frame);
       avcodec_close(_video->codec);
       avformat_free_context(_avFmtCtx);
    }
  • audiodsp/x86 : clear the high bits of the order parameter on 64bit

    9 août 2016, par Anton Khirnov
    audiodsp/x86 : clear the high bits of the order parameter on 64bit
    

    Also change shl to add, since it can be faster on some CPUs.

    CC : libav-stable@libav.org

    • [DBH] libavcodec/x86/audiodsp.asm