Hi. I wrote the code for getting a list of input devices:

 avdevice_register_all();


    AVFormatContext *formatContext = avformat_alloc_context();

    AVInputFormat *inputFormat = NULL;

    while((inputFormat = av_input_video_device_next(inputFormat)))

    {

        formatContext->iformat = inputFormat;


        AVDeviceInfoList *deviceList = NULL;

        avdevice_list_devices(formatContext, &deviceList);


        if(deviceList)

        {

            for(int i = 0; i < deviceList->nb_devices; ++i)

            {

                AVDeviceInfo *device = deviceList->devices[i];

                ..........

            }

        }


       avdevice_free_list_devices(&deviceList);

     }


It fails with SIGSEGV on avdevice_list_devices when it comes to v4l2
input format.


Why does it fail?

How can I get list of video devices?


Btw I'm using Ubuntu 16.04
_______________________________________________
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to