[Libav-user] list all available formats of webcam
philippe.gorley at savoirfairelinux.com
Wed Apr 17 17:43:33 EEST 2019
On 2019-04-17 9:03 a.m., Hristo Ivanov wrote:
> The implementation of
> 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.
It is null because, while the API exists, it is not implemented. AFAIK,
no device implements it.
Source: I grepped the latest source for avdevice_capabilities_create and
found nothing of interest.
The way to go is to either parse the logs or directly use the DShow/V4L2
You can also implement the API yourself and send the patch to the
ffmpeg-devel mailing list. ;)
> > 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,
> 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.
> Libav-user mailing list
> Libav-user at ffmpeg.org
> To unsubscribe, visit link above, or email
> libav-user-request at ffmpeg.org with subject "unsubscribe".
Free Software Consultant | Montréal, Qc
More information about the Libav-user