gpt4 book ai didi

macos - 使用 FFmpeg 从 Mac 流式传输网络摄像头

转载 作者:行者123 更新时间:2023-12-04 14:41:24 26 4
gpt4 key购买 nike

我想使用 FFmpeg 从 Mac 流式传输我的网络摄像头。

首先,我使用 ffmpeg -f avfoundation -list_devices true -i "" 检查了支持的设备。

输出:

[AVFoundation input device @ 0x7fdf1bd03000] AVFoundation video devices:
[AVFoundation input device @ 0x7fdf1bd03000] [0] USB 2.0 Camera #2
[AVFoundation input device @ 0x7fdf1bd03000] [1] FaceTime HD Camera
[AVFoundation input device @ 0x7fdf1bd03000] [2] Capture screen 0
[AVFoundation input device @ 0x7fdf1bd03000] [3] Capture screen 1
[AVFoundation input device @ 0x7fdf1bd03000] AVFoundation audio devices:
[AVFoundation input device @ 0x7fdf1bd03000] [0] Built-in Microphone

device[0] 是我要使用的网络摄像头。

然后我尝试使用 ffmpeg -f avfoundation -i "0" out.mpg 捕获网络摄像头

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

之后,我尝试使用 ffmpeg -f avfoundation -framerate 30 -i "0" -f mpeg1video -b 200k -r 30 -vf scale=1920:1080 http://127.0.0.1:8082/ 从我的 Mac 流式传输此网络摄像头

输出:
[avfoundation @ 0x7f8515012800] An error occurred: The activeVideoMinFrameDuration passed is not supported by the device.  Use -activeFormat.videoSupportedFrameRateRanges to discover valid ranges.0: Input/output error

我无法捕获或流式传输此网络摄像头。但是,当我使用 Facetime 摄像头而不是这个网络摄像头时,一切正常。我一直在寻找这个问题几天,但仍然无法解决它。有人在 Mac 上使用过网络摄像头和 FFmpeg 吗?

最佳答案

需要'-framerate'

你可以试试

ffmpeg -f avfoundation -framerate 30 -i "0" -target pal-vcd ./test.mpg

关于macos - 使用 FFmpeg 从 Mac 流式传输网络摄像头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37960828/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com