[Libav-user] About avformat_open_input and avformat_find_stream_info

wolverin wolverin82 at mail.ru
Mon Jul 25 15:00:41 EEST 2022

*  Why does avformat_open_input reset pInpDic or how to specify AVDictionary correctly?
const AVInputFormat * pInpFmt = av_find_input_format("v4l2");
AVDictionary * pInpDic = NULL
av_dict_set(&pInpDic, "pixel_format", format, 0);
av_dict_set(&pInpDic, "video_size", size, 0);
av_dict_set(&pInpDic, "framerate", rate, 0);
avformat_open_input(&pInpFmtCtx, device, pInpFmt, &pInpDic)
*  If after executing avformat_find_stream_info to release resources, I get an error
avformat_find_stream_info(pInpFmtCtx, NULL)
if (pInpDic) av_dict_free(&pInpDic);
here ---» if (pInpFmtCtx) avformat_close_input(&pInpFmtCtx);
video4linux2,v4l2 @ 0x14dcf10] Some buffers are still owned by the caller on close.
ioctl(VIDIOC_QBUF): Bad file descriptor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20220725/7c29dce3/attachment.htm>

More information about the Libav-user mailing list