[Libav-user] Question about avdevice_list_devices() using.
Roger Pack
rogerdpack2 at gmail.com
Thu Jan 15 15:43:49 CET 2015
AFAIK it's not "tied in" to dshow as of yet, is this a really big priority?
On Wed, Aug 20, 2014 at 8:16 AM, Mike Charikov <ch_mike at mail.ru> wrote:
>
> 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)
>
>
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
More information about the Libav-user
mailing list