最近在学习音视频相关知识,参考雷神(leixiaohua1020)的博客做了一些小实验,记录备忘。
一、记录几条命令
1、列出电脑支持的音视频设备
ffmpeg -list_devices true -f dshow -i dummy
输出如下(节选了关键内容):
[dshow @ 0000025feeb5d840] DirectShow video devices (some may be both video and audio devices)
[dshow @ 0000025feeb5d840] "Integrated Camera"
[dshow @ 0000025feeb5d840] "OBS Virtual Camera"
[dshow @ 0000025feeb5d840] DirectShow audio devices
[dshow @ 0000025feeb5d840] "麦克风 (Realtek(R) Audio)"
2、列出设备选项
其中,video后的名字是通过list_devices获取到的
ffmpeg -list_options true -f dshow -i video="Integrated Camera"
输入如下:
[dshow @ 0000019bb535d800] DirectShow video device options (from video devices)
[dshow @ 0000019bb535d800] Pin "捕获" (alternative pin name "捕获")
[dshow @ 0000019bb535d800] pixel_format=yuyv422 min s=1280x720 fps=30 max s=1280x720 fps=30
[dshow @ 0000019bb535d800] pixel_format=bgr24 min s=1280x720 fps=30 max s=1280x720 fps=30
[dshow @ 0000019bb535d800] pixel_format=yuyv422 min s=320x180 fps=30 max s=320x180 fps=30
[dshow @ 0000019bb535d800] pixel_format=bgr24 min s=320x180 fps=30 max s=320x180 fps=30
[dshow @ 0000019bb535d800] pixel_format=yuyv422 min s=320x240 fps=30 max s=320x240 fps=30
[dshow @ 0000019bb535d800] pixel_format=bgr24 min s=320x240 fps=30 max s=320x240 fps=30
[dshow @ 0000019bb535d800] pixel_format=yuyv422 min s=352x288 fps=30 max s=352x288 fps=30
[dshow @ 0000019bb535d800] pixel_format=bgr24 min s=352x288 fps=30 max s=352x288 fps=30
[dshow @ 0000019bb535d800] pixel_format=yuyv422 min s=424x240 fps=30 max s=424x240 fps=30
[dshow @ 0000019bb535d800] pixel_format=bgr24 min s=424x240 fps=30 max s=424x240 fps=30
[dshow @ 0000019bb535d800] pixel_format=yuyv422 min s=640x360 fps=30 max s=640x360 fps=30
[dshow @ 0000019bb535d800] pixel_format=bgr24 min s=640x360 fps=30 max s=640x360 fps=30
[dshow @ 0000019bb535d800] pixel_format=yuyv422 min s=640x480 fps=30 max s=640x480 fps=30
[dshow @ 0000019bb535d800] pixel_format=bgr24 min s=640x480 fps=30 max s=640x480 fps=30
[dshow @ 0000019bb535d800] pixel_format=yuyv422 min s=848x480 fps=30 max s=848x480 fps=30
[dshow @ 0000019bb535d800] pixel_format=bgr24 min s=848x480 fps=30 max s=848x480 fps=30
[dshow @ 0000019bb535d800] pixel_format=yuyv422 min s=960x540 fps=30 max s=960x540 fps=30
[dshow @ 0000019bb535d800] pixel_format=bgr24 min s=960x540 fps=30 max s=960x540 fps=30
3、使用ffplay播放摄像头数据
ffplay -f dshow -i video="Integrated Camera"
//可以设置分辨率
ffplay -s 1280x720 -f dshow -i video="Integrated Camera"
4、使用FFmpeg保存摄像头视频
ffmpeg -f dshow -i video="Integrated Camera" -vcodec libx264 test.mp4
二、基于VS编码实现
TODO:
标签:dshow,FFmpeg,format,30,0000019bb535d800,fps,操作电脑,pixel,摄像头 From: https://blog.51cto.com/sannywoods/6457644