gpt4 book ai didi

windows上的ffmpeg网络摄像头流到sdl

转载 作者:行者123 更新时间:2023-12-04 23:11:44 28 4
gpt4 key购买 nike

您好我正在尝试在 Windows 上显示网络摄像头流。
我可以使用“ffplay”,但我想使用“ffmpeg”命令。

c:\>ffmpeg -f dshow -i video="USB2.0 VGA UVC WebCam" -f sdl test
ffmpeg version 2020-12-27-git-bff6fbead8-full_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 56. 62.100 / 56. 62.100
libavcodec 58.115.102 / 58.115.102
libavformat 58. 65.100 / 58. 65.100
libavdevice 58. 11.103 / 58. 11.103
libavfilter 7. 94.100 / 7. 94.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, dshow, from 'video=USB2.0 VGA UVC WebCam':
Duration: N/A, start: 92136.240000, bitrate: N/A
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 30 fps, 30 tbr, 10000k tbn, 10000k tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Output #0, sdl,sdl2, to 'test':
Metadata:
encoder : Lavf58.65.100
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422(progressive), 640x480, q=2-31, 147456 kb/s, 30 fps, 30 tbn
Metadata:
encoder : Lavc58.115.102 rawvideo
av_interleaved_write_frame(): Operation not permitted
frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.03 bitrate=N/A speed=0.448x
video:600kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
但以下工作:
ffmpeg -i file.webm -f sdl test
任何想法为什么失败?

最佳答案

添加 format过滤以输出不同的像素格式:

ffmpeg -f dshow -i video="USB2.0 VGA UVC WebCam" -vf format=yuv420p -f sdl test
不知道为什么 yuyv422 和 uyvy422 不起作用,尽管它们列在 sdl_texture_format_map[] 中在 libavdevice/sdl2.c .否则应该输出 Unsupported pixel format错误。

关于windows上的ffmpeg网络摄像头流到sdl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65756905/

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