[Libav-user] list all available formats of webcam

Hristo Ivanov hivanov.ffmailing at gmail.com
Wed Apr 17 16:03:04 EEST 2019


Hi.

The implementation of 'avdevice_capabilities_create'(
https://ffmpeg.org/doxygen/trunk/avdevice_8c_source.html#l00143) starts
with the following lines:

1    int ret;
2    av_assert0(s && caps);
3    av_assert0(s->iformat || s->oformat);
4    if ((s->oformat && !s->oformat->create_device_capabilities) ||
5        (s->iformat && !s->iformat->create_device_capabilities))
6        return AVERROR(ENOSYS);

My guess is the -40(ENOSYS) error is returned in line 6. Can you check in
your code if 'm_pFormatCtxInCam->iformat->create_device_capabilities' is
different from null.
The next step would be to understand why is
'm_pFormatCtxInCam->iformat->create_device_capabilities'
null. With ffmpeg you just have to dive in the source code and try to
understand it.
Compiling a debug version of the ffmpeg libs/dlls is extremely useful for
this purpose.

> Maybe I did not initialize everything correctly or bad ordering of open
input?

> Please see my code:


The code seems correct, my only problem with the above code is in the next line:


> int ret = avformat_open_input(&m_pFormatCtxInCam, szUrl, m_pInFrmt, &m_pInOptions);


Try using no(NULL) options:


int ret = avformat_open_input(&m_pFormatCtxInCam, szUrl, m_pInFrmt, NULL);

Maybe opening an input with options shuts down the querying capabilities of
the input, I don't really know, it's just a guess.


Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20190417/acb4a1c2/attachment.html>


More information about the Libav-user mailing list