Recherche avancée

Médias (1)

Mot : - Tags -/sintel

Autres articles (46)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

Sur d’autres sites (6543)

  • avfilter/vf_bwdif : Add neon for filter_intra

    4 juillet 2023, par John Cox
    avfilter/vf_bwdif : Add neon for filter_intra
    

    Adds an outline for aarch neon functions
    Adds common macros and consts for aarch64 neon
    Exports C filter_intra needed for tail fixup of neon code
    Adds neon for filter_intra

    Signed-off-by : John Cox <jc@kynesim.co.uk>
    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] libavfilter/aarch64/Makefile
    • [DH] libavfilter/aarch64/vf_bwdif_init_aarch64.c
    • [DH] libavfilter/aarch64/vf_bwdif_neon.S
    • [DH] libavfilter/bwdif.h
    • [DH] libavfilter/vf_bwdif.c
  • Decoding audio with FFMPEG

    8 juillet 2012, par Mariano

    I am using FFMPEG to decode an audio file, but I am not able to do it.

       AVFormatContext *pFormatCtx;
    AVCodec *pCodec_audio;
    AVCodecContext *aCodecCtx_audio = NULL;
    AVPacket packet;
    string outfilename = "salida.avi";
    string filename = "john.wav";
    int audioStream;
    int out_size, len, size;
    FILE *outfile;
    int16_t *outbuf;
    uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
    avcodec_init();
    /* register all the codecs */
    av_register_all();

    if(av_open_input_file(&amp;pFormatCtx, filename.c_str(), NULL, 0, NULL) != 0) {
       cerr &lt;&lt; "Archivo no encontrado" &lt;&lt; endl;
       return -1; // Couldn&#39;t open file
    }

    if(av_find_stream_info(pFormatCtx) &lt; 0) {
       cerr &lt;&lt; " No encontro el stream de info" &lt;&lt; endl;
       return -1;// Couldn&#39;t find stream information
    }

    dump_format(pFormatCtx, 0, filename.c_str(), 0);

    for(unsigned int i=0; i &lt; pFormatCtx->nb_streams; i++)
     if(pFormatCtx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
         audioStream = i;
    aCodecCtx_audio = pFormatCtx->streams[audioStream]->codec;
    pCodec_audio = avcodec_find_decoder(aCodecCtx_audio->codec_id);
    if(pCodec_audio == NULL) {
       cerr&lt;&lt; "Unsupported codec!" &lt;&lt; endl;
       return -1; // Codec not found
    }

    if(avcodec_open(aCodecCtx_audio, pCodec_audio) &lt; 0) {
       cerr &lt;&lt; "No se pudo abrir el codec de audio" &lt;&lt; endl;
       return -1;
    }

    outbuf = (int16_t*) av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);

    outfile = fopen(outfilename.c_str(), "wb");
    if (!outfile) {
       exit(1);
    }

    av_init_packet(&amp;packet);
    packet.data = inbuf;
    while(av_read_frame(pFormatCtx, &amp;packet) == 0) {
       if(packet.stream_index == audioStream) {
           size = packet.size;
           if (size == 0) {
               cerr &lt;&lt; "Size = 0 " &lt;&lt; endl;
               break;
           }
           while(size > 0) {
               out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
               len = avcodec_decode_audio3(aCodecCtx_audio, outbuf, &amp;out_size , &amp;packet);
               //av_free_packet(&amp;packet);
               cout &lt;&lt; len &lt;&lt; endl;
               if(len == -1) {
                   cerr &lt;&lt; "Error while decoding" &lt;&lt; endl;
                   return 1;
               }
               if(out_size > 0) {
                   fwrite(outbuf, 1, out_size, outfile);
               }
               size -= len;
               packet.data += len;
           }
       }
    }
    av_free_packet(&amp;packet);


    fclose(outfile);
    free(outbuf);
    cout &lt;&lt; "END CODE" &lt;&lt; endl;
    avcodec_close(aCodecCtx_audio);
    av_free(aCodecCtx_audio);

    In the code I am trying to decode an .wav file to a .avi file. The output file ("salida.avi") is created , but does not play.

  • How to create video using avcodec from jpeg images of type OpenCV::Mat ?

    23 juillet 2015, par theateist

    I have colored jpeg images of OpenCV::Mat type and I create from them video using avcodec. The video that I get is upside-down, black & white and each row of each frame is shifted and I got diagonal line. What could be the reason for such output ?
    Follow this link to watch the video I get using avcodec.
    I’m using acpicture_fill function to create avFrame from cv::Mat frame !

    P.S.
    Each cv::Mat cvFrame has width=810, height=610, step=2432
    I noticed that avFrame (that is filled by acpicture_fill) has linesize[0]=2430
    I tried manually setting avFrame->linesizep0]=2432 and not 2430 but it still didn’t helped.

    ======== CODE =========================================================

    AVCodec *encoder = avcodec_find_encoder(AV_CODEC_ID_H264);
    AVStream *outStream = avformat_new_stream(outContainer, encoder);
    avcodec_get_context_defaults3(outStream->codec, encoder);

    outStream->codec->pix_fmt = AV_PIX_FMT_YUV420P;
    outStream->codec->width = 810;
    outStream->codec->height = 610;
    //...

    SwsContext *swsCtx = sws_getContext(outStream->codec->width, outStream->codec->height, PIX_FMT_RGB24,
                                       outStream->codec->width, outStream->codec->height,  outStream->codec->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL);

    for (uint i=0; i &lt; frameNums; i++)
    {
       // get frame at location I using OpenCV
       cv::Mat cvFrame;
       myReader.getFrame(cvFrame, i);
       cv::Size frameSize = cvFrame.size();    
       //Each cv::Mat cvFrame has  width=810, height=610, step=2432


    1.  // create AVPicture from cv::Mat frame
    2.  avpicture_fill((AVPicture*)avFrame, cvFrame.data, PIX_FMT_RGB24, outStream->codec->width, outStream->codec->height);
    3avFrame->width = frameSize.width;
    4.  avFrame->height = frameSize.height;

       // rescale to outStream format
       sws_scale(swsCtx, avFrame->data, avFrame->linesize, 0, outStream->codec->height, avFrameRescaledFrame->data, avFrameRescaledFrame ->linesize);
    encoderRescaledFrame->pts=i;
    avFrameRescaledFrame->width = frameSize.width;
       avFrameRescaledFrame->height = frameSize.height;

    av_init_packet(&amp;avEncodedPacket);
       avEncodedPacket.data = NULL;
       avEncodedPacket.size = 0;

       // encode rescaled frame
       if(avcodec_encode_video2(outStream->codec, &amp;avEncodedPacket, avFrameRescaledFrame, &amp;got_frame) &lt; 0) exit(1);
       if(got_frame)
       {
           if (avEncodedPacket.pts != AV_NOPTS_VALUE)
               avEncodedPacket.pts =  av_rescale_q(avEncodedPacket.pts, outStream->codec->time_base, outStream->time_base);
           if (avEncodedPacket.dts != AV_NOPTS_VALUE)
               avEncodedPacket.dts = av_rescale_q(avEncodedPacket.dts, outStream->codec->time_base, outStream->time_base);

           // outContainer is "mp4"
           av_write_frame(outContainer, &amp; avEncodedPacket);

           av_free_packet(&amp;encodedPacket);
       }
    }

    UPDATED

    As @Alex suggested I changed the lines 1-4 with the code below

    int width = frameSize.width, height = frameSize.height;
    avpicture_alloc((AVPicture*)avFrame, AV_PIX_FMT_RGB24, outStream->codec->width, outStream->codec->height);
    for (int h = 0; h &lt; height; h++)
    {
        memcpy(&amp;(avFrame->data[0][h*avFrame->linesize[0]]), &amp;(cvFrame.data[h*cvFrame.step]), width*3);
    }

    The video (here) I get now is almost perfect. It’s NOT upside-down, NOT black & white, BUT it seems that one of the RGB components is missing. Every brown/red colors became blue (in original images it should be vice-verse).
    What could be the problem ? Could rescaling(sws_scale) to AV_PIX_FMT_YUV420P format causes this ?