Audio 如何使用ffmpeg从网络摄像头录制视频和音频?

Audio 如何使用ffmpeg从网络摄像头录制视频和音频?,audio,video,ffmpeg,webcam,video-recording,Audio,Video,Ffmpeg,Webcam,Video Recording,我想用ffmpeg从网络摄像头录制视频和音频 我已使用以下代码了解哪些设备可用: ffmpeg -list_devices true -f dshow -i dummy 结果是: ffmpeg version N-54082-g96b33dd Copyright (c) 2000-2013 the FFmpeg developers built on Jun 17 2013 02:05:16 with gcc 4.7.3 (GCC) configuration: --enable-gpl --

我想用ffmpeg从网络摄像头录制视频和音频

我已使用以下代码了解哪些设备可用:

ffmpeg -list_devices true -f dshow -i dummy
结果是:

ffmpeg version N-54082-g96b33dd Copyright (c) 2000-2013 the FFmpeg developers
built on Jun 17 2013 02:05:16 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
enable-libxvid --enable-zlib
libavutil      52. 37.101 / 52. 37.101
libavcodec     55. 16.100 / 55. 16.100
libavformat    55.  8.103 / 55.  8.103
libavdevice    55.  2.100 / 55.  2.100
libavfilter     3. 77.101 /  3. 77.101
libswscale      2.  3.100 /  2.  3.100
libswresample   0. 17.102 /  0. 17.102
libpostproc    52.  3.100 / 52.  3.100
[dshow @ 024eb460] DirectShow video devices
[dshow @ 024eb460]  "Sirius USB2.0 Camera"
[dshow @ 024eb460]  "Vimicro USB Camera (Altair)"
[dshow @ 024eb460] DirectShow audio devices
[dshow @ 024eb460]  "Microphone (Realtek High Defini"
dummy: Immediate exit requested
我正在使用以下代码获取有关该设备的更多详细信息:

ffmpeg -f dshow -list_options true -i video="Vimicro USB Camera (Altair)"
我得到了以下结果:

ffmpeg version N-54082-g96b33dd Copyright (c) 2000-2013 the FFmpeg developers
built on Jun 17 2013 02:05:16 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
enable-libxvid --enable-zlib
libavutil      52. 37.101 / 52. 37.101
libavcodec     55. 16.100 / 55. 16.100
libavformat    55.  8.103 / 55.  8.103
libavdevice    55.  2.100 / 55.  2.100
libavfilter     3. 77.101 /  3. 77.101
libswscale      2.  3.100 /  2.  3.100
libswresample   0. 17.102 /  0. 17.102
libpostproc    52.  3.100 / 52.  3.100
[dshow @ 0249b3e0] DirectShow video device options
[dshow @ 0249b3e0]  Pin "Capture"
[dshow @ 0249b3e0]   pixel_format=yuyv422  min s=640x480 fps=30 max   s=640x480 fp
s=30
[dshow @ 0249b3e0]   pixel_format=yuyv422  min s=640x480 fps=30 max s=640x480 fp
s=30
[dshow @ 0249b3e0]   pixel_format=yuyv422  min s=352x288 fps=30 max s=352x288 fp
s=30
[dshow @ 0249b3e0]   pixel_format=yuyv422  min s=352x288 fps=30 max s=352x288 fp
s=30
[dshow @ 0249b3e0]   pixel_format=yuyv422  min s=320x240 fps=30 max s=320x240 fp
s=30
[dshow @ 0249b3e0]   pixel_format=yuyv422  min s=320x240 fps=30 max s=320x240 fp
s=30
[dshow @ 0249b3e0]   pixel_format=yuyv422  min s=176x144 fps=30 max s=176x144 fp
s=30
[dshow @ 0249b3e0]   pixel_format=yuyv422  min s=176x144 fps=30 max s=176x144 fp
s=30
[dshow @ 0249b3e0]   pixel_format=yuyv422  min s=160x120 fps=30 max s=160x120 fp
s=30
[dshow @ 0249b3e0]   pixel_format=yuyv422  min s=160x120 fps=30 max s=160x120 fp
s=30
video=Vimicro USB Camera (Altair): Immediate exit requested
当我尝试使用以下代码获取视频和音频流时:

ffmpeg -f dshow -s 320x240 -r 30 -vcodec mjpeg -i video="Vimicro USB Camera (Altair)" e:\output.mp4
我收到一条错误消息,因为“无法设置视频选项 视频=Vimicro USB摄像头(Altair):输入/输出错误

以下是错误详细信息:

ffmpeg version N-54082-g96b33dd Copyright (c) 2000-2013 the FFmpeg developers
built on Jun 17 2013 02:05:16 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
enable-libxvid --enable-zlib
libavutil      52. 37.101 / 52. 37.101
libavcodec     55. 16.100 / 55. 16.100
libavformat    55.  8.103 / 55.  8.103
libavdevice    55.  2.100 / 55.  2.100
libavfilter     3. 77.101 /  3. 77.101
libswscale      2.  3.100 /  2.  3.100
libswresample   0. 17.102 /  0. 17.102
libpostproc    52.  3.100 / 52.  3.100
[dshow @ 002f78e0] Could not set video options
video=Vimicro USB Camera (Altair): Input/output error
我无法发现我做错了什么


因此,如果有人能找到我哪里做错了,或者如何使用ffmpeg从网络摄像头录制视频和音频,请帮助我解决这个问题。

这说明了什么:
ffmpeg-f dshow-list_options 1-i video=“Vimicro USB Camera(Altair)”-f null-
?您好@Mulvya,谢谢您的评论我编辑了我的问题,因此,请再次阅读,您将得到您的答案。跳过
vcodec
,将
-s
替换为
-video\u size
-r
替换为
-framerate
,并添加
-pixel\u格式yuyv422
Hi@Mulvya,根据您的以下信息修改命令后
ffmpeg-f dshow-video\u size 320x240-framerate 30-pixel\u format yuyv422-i video=“Vimicro USB Camera(Altair)”e:\output.mp4
此外,我收到一个错误[dshow@003179c0]无法运行filter video=Vimicro USB Camera(Altair):输入/输出错误您的ffmpeg非常旧。获取最新版本。