Webcam with FFmpeg on Mac: The selected frame rate (29.970030) is not supported by the device

There was a very strange problem on the Mac when I tried to open the webcam using FFmpeg. For instance:

ffmpeg -f avfoundation -i "1" -framerate 60 -vcodec libx264 -preset veryfast -f flv rtmp://localhost:1935/hls/test 

No matter what set of frames I installed, the error was always the same.

[avfoundation @ 0x7ff831800000] Selected framerate (29.970030) is not supported by the device
[avfoundation @ 0x7ff831800000] Supported modes:
[avfoundation @ 0x7ff831800000]   320x240@[120.101366 120.101366]fps
[avfoundation @ 0x7ff831800000]   640x480@[120.101366 120.101366]fps
[avfoundation @ 0x7ff831800000]   800x600@[60.000240 60.000240]fps
[avfoundation @ 0x7ff831800000]   1024x768@[30.000030 30.000030]fps
[avfoundation @ 0x7ff831800000]   1280x720@[60.000240 60.000240]fps
[avfoundation @ 0x7ff831800000]   1280x1024@[30.000030 30.000030]fps
[avfoundation @ 0x7ff831800000]   1920x1080@[30.000030 30.000030]fps
[avfoundation @ 0x7ff831800000]   320x240@[30.000030 30.000030]fps
[avfoundation @ 0x7ff831800000]   640x480@[30.000030 30.000030]fps
[avfoundation @ 0x7ff831800000]   800x600@[20.000000 20.000000]fps
[avfoundation @ 0x7ff831800000]   1024x768@[6.000002 6.000002]fps
1: Input/output error

I have been looking for this problem for many days, but still cannot find a solution. I'm very confused right now.

I hope someone using a Mac can try a similar command to access the webcam to make sure this is a common problem.

+4
source share
1 answer

-framerate . , -i, .

+8

Source: https://habr.com/ru/post/1648623/


All Articles