Hello

I am experimenting with the FFMpeg library and now succesful able to encode
MPEG1  (after looking at examples from Fabrice Bellard and others) and XVID
after messing around a bit.
Encoding WMV (1 or 2) is a problem. I have no clue why I can't open the
codec and I can't find a clear example that tells me how to set-up the
context.

    avcodec_init();
    av_register_all();

    AVCodec            *           pCodec_ =
avcodec_find_encoder(CODEC_ID_WMV1);
    if  ( ! pCodec_)
    {//Codec is found in my case!
       return;
    }

    AVCodecContext    *        pContext_ = avcodec_alloc_context();
    avcodec_get_context_defaults(pContext_);

    pContext_->bit_rate = 400000;
    pContext_->width = 512;
    pContext_->height = 512;
    pContext_->time_base.den = 25;//(AVRational){1,25}; // svw change this
for win MSVC
    pContext_->time_base.num = 1;//(AVRational){1,25}; // svw change this
for win MSVC
    pContext_->gop_size = 10;
    pContext_->max_b_frames = 1;
    pContext_->pix_fmt = PIX_FMT_YUV420P;

    /* open it */
    int res = avcodec_open(pContext_, pCodec_);
    //The return value is -1!
    if (res < 0)
    {
       av_free(pContext_);
       pContext_ = 0;
       return;
    }

Obiously I need to set up some context parameters correctly. Does anyone
know where I can find how to do this or does anyone have a nice example?

Best regards,

Arthur
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to