Recherche avancée

Médias (91)

Autres articles (109)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (15158)

  • (C) avcodec_receive_frame (ffmpeg) function always returns AVERROR(EAGAIN)

    13 avril 2021, par Levyu

    I was following this tutorial : http://dranger.com/ffmpeg/tutorial01.html
and was trying to change some deprecated functions, and so I had to try to use the avcodec_send_packet and avcodec_receive_frame functions.

    


    The problem I'm having is that avcodec_receive_frame always returns AVERROR(EAGAIN).

    


    My decoding function is as follows :

    


    static int decode(AVCodecContext *pCodecCtx, AVFrame *pFrame, AVPacket *packet) {
    
    int ret = avcodec_send_packet(pCodecCtx, packet);
    if (ret<0) {
        fprintf(stderr, "error sending packet for decoding\n");
        exit(1);
    }

    while (ret>=0) {        
        // avcodec_receive_packet(pCodecCtx, NULL);
        ret = avcodec_receive_frame(pCodecCtx, pFrame);
        if (ret == AVERROR(EAGAIN)) {
            fprintf(stderr, "\naverror(eagain) ret = %d\n", ret);
            return -1;
        }
        else if (ret == AVERROR_EOF) {
            fprintf(stderr, "eof\n");
            return -100;
        }
        else if (ret <0) {
            fprintf(stderr, "error during decoding\n");
            exit(1);
        }
    }
    return 0;
}


    


    Everywhere I read said that this is solved by calling avcodec_send_packet with the next frame, but this does not solve the problem for me because this function is being called in a loop :

    


    
    while (av_read_frame(pFormatCtx, &packet)>=0) {
        // is this a packet from the video stream?
        if (packet.stream_index==videoStream) {

           frameNotFinished = decode(pCodecCtx, pFrame, &packet);

            // did we get a video frame?
            if (!frameNotFinished) fprintf(stderr, "it worked!");
        }
        av_packet_unref(&packet);   
    }


    


    I should probably also add that avcodec_send_packet always returns 0 (success).

    


    Any help would be much appreciated.

    


  • pngdec : Stop trying to decode once inflate returns Z_STREAM_END

    28 septembre 2013, par Martin Storsjö
    pngdec : Stop trying to decode once inflate returns Z_STREAM_END
    

    If the input buffer contains more data after the deflate stream,
    the loop previously left running infinitely, with inflate returning
    Z_STREAM_END.

    Reported-by : Mateusz "j00ru" Jurczyk and Gynvael Coldwind
    CC : libav-stable@libav.org
    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] libavcodec/pngdec.c
  • ffmpeg : avcodec_open2 returns invalid argument

    12 mai 2016, par roari

    i’m reusing the sample code from the developer 64bit release of ffmpeg in my application to encode a video :

    AVCodec* pCodec_{nullptr};
    AVCodecContext* pContext_{nullptr};

    avcodec_register_all();
    pCodec_ = avcodec_find_encoder(AV_CODEC_ID_MPEG2VIDEO);
    if (!pCodec_) {}

    pContext_ = avcodec_alloc_context3(pCodec_);
    if (!pContext_) {}

    pContext_->bit_rate = 400000;
    pContext_->width = size.width();
    pContext_->height = size.height();

    pContext_->time_base.den = 1;
    pContext_->time_base.num = fps;

    pContext_->gop_size = 10;
    pContext_->max_b_frames = 1;
    pContext_->pix_fmt = AV_PIX_FMT_BGR0;

    if (codec_id == AV_CODEC_ID_H264) {
       av_opt_set(pContext_->priv_data, "preset", "slow", 0);
    }

    int err = avcodec_open2(pContext_, pCodec_, nullptr);
    if (err &lt; 0) {}

    AVCodec* and AVCodecContext* look like they are allocated correctly. avcodec_open2 then returns invalid argument (-22).

    I use : Windows 10 64, VS2013 Compiler, Qt Creator IDE, ffmpeg(2016-05-12) 64bit.

    The sample i took the code from is "decoding_encoding.c".

    Any ideas ?