[Libav-user] Set Webcam Encoder C API

Casey Price cprice1317 at gmail.com
Thu Oct 22 18:19:21 CEST 2015


Thanks, I had to init the InputContext and then set its codec id and codec
before opening it.

        AVDictionary* dictionary = NULL;
av_dict_set(&dictionary, "video_size", "1280x720", NULL);
av_dict_set(&dictionary, "framerate", "30", NULL);
ifmt_ctx = avformat_alloc_context();
ifmt_ctx->video_codec_id = AV_CODEC_ID_MJPEG;
av_format_set_video_codec(ifmt_ctx, opened_mjpeg_codec);

        avformat_open_input(&ifmt_ctx, filename, inputFormat, &dictionary);

On Wed, Oct 21, 2015 at 5:34 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> Casey Price <cprice1317 at ...> writes:
>
> >       av_dict_set(&opt, "vcodec", "mjpeg", 0);
>
> >       av_dict_set(&opt, "s", "1280x720", 0);
>
> The option is actually called "video_size"
>
> >         av_dict_set(&opt , "framerate", "30", 0);
>
> This looks correct.
>
> I am quite sure that "vcodec" is wrong, you
> probably have to pass the opened decoder to
> avformat (but I don't really know).
>
> Carl Eugen
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20151022/04989b32/attachment.html>


More information about the Libav-user mailing list