[Libav-user] Question about avdevice_list_devices() using.
Mike Charikov
ch_mike at mail.ru
Wed Aug 20 16:16:20 CEST 2014
Hi!
I try to use avdevice_list_devices() for getting list of video devices, but
don’t clearly understand, how to do that properly. How should I properly
init AVFormatContext for calling avdevice_list_devices()?
Tried something like that:
int main() {
avdevice_register_all();
avcodec_register_all();
AVFormatContext* format_context = avformat_alloc_context();
AVInputFormat *fmt = av_find_input_format("dshow");
AVDeviceInfoList *device_list=NULL;
int err = avformat_open_input(&format_context, NULL, fmt,
NULL);
if (err != 0) {
fprintf(stderr, "ffmpeg: Unable to open
input: %d\n", err);
}
int i = avdevice_list_devices(format_context, &device_list);
return 0;
}
But avformat_open_input() returns error (code -1414092869), and so does
avdevice_list_devices() (code -40)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20140820/afef7fbd/attachment.html>
More information about the Libav-user
mailing list