我想使用FFmpeg从Mac流式传输我的网络摄像头。
首先,我使用url = "http://myneta.info/up2007/index.php?action=show_candidates&constituency_id=341"
df = pd.read_html(url, header=0)[2] # Pick the 3rd table in the page
输出:
ffmpeg -f avfoundation -list_devices true -i ""
设备[0]是我想要使用的网络摄像头。
然后我尝试使用[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
输出:
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/
我无法捕获或流式传输此网络摄像头。然而,当我使用Facetime相机而不是这个网络摄像头时,一切都很好。我一直在寻找这个问题几天,但仍然无法解决它。有没有人在Mac上有网络摄像头和FFmpeg的经验?
答案 0 :(得分:5)
' - framerate'
你可以尝试一下
ffmpeg -f avfoundation -framerate 30 -i "0" -target pal-vcd ./test.mpg
答案 1 :(得分:1)
我在尝试流式传输Logitech C920网络摄像头时遇到了同样的问题,其中内置FaceTime相机的流媒体工作正常。
我发现降低帧速率会停止显示您报告的错误消息。这是我用来使网络摄像头工作的命令(帧速率为30的相同命令不起作用)。
ffmpeg -f avfoundation -framerate 10 -pixel_format yuyv422 -i "0" out.avi
根据您的网络摄像头支持的视频格式,看起来以下命令可以正常工作。虽然我没有相同的网络摄像头,但这可能无法解决您的问题。
ffmpeg -f avfoundation -framerate 6 -i "0" -target pal-vcd test.mpg
我希望这可以帮助您找到解决方案。