<div dir="ltr"><div dir="ltr"><div dir="ltr">For Linux, you can use libunicap: <a href="https://github.com/unicap/unicap/tree/master/libunicap">https://github.com/unicap/unicap/tree/master/libunicap</a></div><div dir="ltr"><br></div><div>Sample code here: <a href="https://github.com/salsaman/LiVES/blob/master/src/videodev.c">https://github.com/salsaman/LiVES/blob/master/src/videodev.c</a><br></div><div dir="ltr"><br></div><div>Regards,</div><div>Salsaman.</div><div><br clear="all"></div><div dir="ltr"><div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><br><a href="http://lives-video.com" target="_blank">http://lives-video.com</a><br><a href="https://www.openhub.net/accounts/salsaman" target="_blank">https://www.openhub.net/accounts/salsaman</a><br></div></div></div></div></div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 17, 2019 at 11:43 AM Philippe Gorley <<a href="mailto:philippe.gorley@savoirfairelinux.com">philippe.gorley@savoirfairelinux.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2019-04-17 9:03 a.m., Hristo Ivanov wrote:<br>
> Hi.<br>
> <br>
> The implementation of <br>
> 'avdevice_capabilities_create'(<a href="https://ffmpeg.org/doxygen/trunk/avdevice_8c_source.html#l00143" rel="noreferrer" target="_blank">https://ffmpeg.org/doxygen/trunk/avdevice_8c_source.html#l00143</a>) <br>
> starts with the following lines:<br>
> <br>
> 1 int ret; 2 av_assert0(s && caps); 3 av_assert0(s->iformat || <br>
> s->oformat); 4 if ((s->oformat && <br>
> !s->oformat->create_device_capabilities) || 5 (s->iformat && <br>
> !s->iformat->create_device_capabilities)) 6 return AVERROR(ENOSYS);<br>
> <br>
> My guess is the -40(ENOSYS) error is returned in line 6. Can you check <br>
> in your code if 'm_pFormatCtxInCam->iformat->create_device_capabilities' <br>
> is different from null.<br>
> The next step would be to understand why is <br>
> 'm_pFormatCtxInCam->iformat->create_device_capabilities' null. With <br>
> ffmpeg you just have to dive in the source code and try to understand it.<br>
> Compiling a debug version of the ffmpeg libs/dlls is extremely useful <br>
> for this purpose.<br>
<br>
It is null because, while the API exists, it is not implemented. AFAIK, <br>
no device implements it.<br>
<br>
Source: I grepped the latest source for avdevice_capabilities_create and <br>
found nothing of interest.<br>
<br>
The way to go is to either parse the logs or directly use the DShow/V4L2 <br>
libraries.<br>
<br>
You can also implement the API yourself and send the patch to the <br>
ffmpeg-devel mailing list. ;)<br>
<br>
> <br>
>  > Maybe I did not initialize everything correctly or bad ordering of <br>
> open input?<br>
> <br>
>> Please see my code:<br>
> <br>
> <br>
> The code seems correct, my only problem with the above code is in the <br>
> next line:<br>
> <br>
> <br>
>  > int ret = avformat_open_input(&m_pFormatCtxInCam, szUrl, m_pInFrmt, <br>
> &m_pInOptions);<br>
> <br>
> Try using no(NULL) options:<br>
> <br>
> <br>
> int ret = avformat_open_input(&m_pFormatCtxInCam, szUrl, m_pInFrmt, NULL);<br>
> <br>
> Maybe opening an input with options shuts down the querying capabilities <br>
> of the input, I don't really know, it's just a guess.<br>
> <br>
> <br>
> Regards.<br>
> <br>
> <br>
> _______________________________________________<br>
> Libav-user mailing list<br>
> <a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
> <a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
> <br>
> To unsubscribe, visit link above, or email<br>
> <a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".<br>
> <br>
<br>
-- <br>
Philippe Gorley<br>
Free Software Consultant | Montréal, Qc<br>
Savoir-faire Linux<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".</blockquote></div>