先检测设备名称,后使用ffplay播放该设备
ffmpeg -hide_banner -list_devices true -f dshow -i dummy
ffplay -hide_banner -f dshow -i video="USB 2.0 Camera" -y 480 -x 720
13919@DESKTOP-OA5RJFC MINGW64 ~/Desktop/ffmpeg-n5.0-latest-win64-gpl-shared-5.0/ffmpeg-n5.0-latest-win64-gpl-shared-5.0/bin
$ ./ffmpeg -hide_banner -list_devices true -f dshow -i dummy
[dshow @ 000001e65f848d00] "USB 2.0 Camera" (video)
[dshow @ 000001e65f848d00] Alternative name "@device_pnp_\\?\usb#vid_1124&pid_2925&mi_00#6&2a4be5fd&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
[dshow @ 000001e65f848d00] "麦克风 (USB Microphone)" (audio)
[dshow @ 000001e65f848d00] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{A885C5D0-0617-4E7F-8DB5-B0061E72A364}"
[dshow @ 000001e65f848d00] "麦克风 (3- Realtek(R) Audio)" (audio)
[dshow @ 000001e65f848d00] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{A0C093F7-CEFD-43BE-AED5-B0A17ECA2E15}"
[dshow @ 000001e65f848d00] "立体声混音 (3- Realtek(R) Audio)" (audio)
[dshow @ 000001e65f848d00] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{CCCDBA36-CEE8-4546-B0F9-5134E1F7B10C}"
dummy: Immediate exit requested
13919@DESKTOP-OA5RJFC MINGW64 ~/Desktop/ffmpeg-n5.0-latest-win64-gpl-shared-5.0/ffmpeg-n5.0-latest-win64-gpl-shared-5.0/bin
$ ./ffplay -hide_banner -f dshow -i video="USB 2.0 Camera" -y 480 -x 720
[mjpeg @ 0000019ab544c840] No JPEG data found in image 0B f=0/0
Input #0, dshow, from 'video=USB 2.0 Camera':
Duration: N/A, start: 92829.235370, bitrate: N/A
Stream #0:0: Video: mjpeg (Baseline) (MJPG / 0x47504A4D), yuvj420p(pc, bt470bg/bt709/unknown), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 10000k tbn
[swscaler @ 0000019ab5481300] [swscaler @ 0000019ab54902c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000019ab5481300] [swscaler @ 0000019ab54d3c80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000019ab5481300] [swscaler @ 0000019ac13d2ec0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000019ab5481300] [swscaler @ 0000019ac1420f40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000019ab5481300] [swscaler @ 0000019ac146ef80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000019ab5481300] [swscaler @ 0000019ac14e00c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000019ab5481300] [swscaler @ 0000019ac14eef80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000019ab5481300] [swscaler @ 0000019ac1538c80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000019ab5481300] [swscaler @ 0000019ac15c9040] deprecated pixel format used, make sure you did set range correctly
92882.77 M-V: -0.022 fd= 105 aq= 0KB vq= 0KB sq= 0B f=0/0
result: