Hi,

it seems that way I want is not really possible:

I asked the AI to generate some example code for and after some more prompts explaining it should be compatible with ffmpeg 6 and later (that's where major API changes happened) it produced working code, but also used a lot of direct OS calls with a lot of platform #ifdefs

After explicitly telling it not to use direct OS calls it rewrote the code to parse ffmpeg log/debug messages, which is not great. I looked into the ffmpeg code and there doesn't seem to be a convenient way to get available formats/resolutions (except getting the string that ffmpeg would print).

Additionally all capture APIs work slightly different, so my idea selecting the API (v4l2, avfoundation, dshow) and then share all other code doesn't work either.

So my approach is now: Create a simple capture API with 4 functions (available devices, available formats/resolutions for a device, start and stop capture) by copying code from libavdevice and not use ffmpeg.

Best regards
Stefan


Am 02.09.25 um 19:42 schrieb Carl Zwanzig via ffmpeg-user:
On 8/31/2025 12:13 PM, Stefan Oltmanns via ffmpeg-user wrote:
Does somebody know some example code for that? All I found is decades old and won't compile with recent ffmpeg.

If nothing else, you ought to be able to tease some examples out of ffmpeg itself - it has command line options to list devices/formats/etc. Might take a little work to trace the option to the code executing it, but that shouldn't be too bad.

Likewise, with a some digging you should be able to trace how the pipeline gets frames from the demuxer (which will depend on the capture device, I assume).

Later,

z!

_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]

_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to