Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFMPEG API - Retrieve device camera information [closed]

Tags:

c++

c

ffmpeg

webcam

I need to get the compatible framerate/resolution of the available cameras. How can this be done with the ffmpeg library? I've tried using the functions of avdevice but all of them seem to retrieve an error. I am not able to get a list of the available devices as well.

This is being done on a mac using avfoundation (and it will later be ported to windows with dshow).

Thank you for your time.

like image 971
Solidus Avatar asked Sep 07 '26 05:09

Solidus


1 Answers

Try running

ffmpeg -f dshow -list_options true -i video="Integrated Camera"

replacing 'dshow' and "Integrated Camera" with whatever you have, depending on the platform. As above, you can get the name of the video device with

ffmpeg -f dshow -list_devices true -i x

You can then pipe the resulting output to a file using the > operator, or to a further command-line tool for processing with the | operator. For example,

ffmpeg -f dshow -list_options true -i video="Integrated Camera" > test.txt

or

ffmpeg -f dshow -list_options true -i video="Integrated Camera" | grep 'pixel_format'
like image 83
k_ride Avatar answered Sep 09 '26 19:09

k_ride



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!