← 返回命令列表

Linux command

ffmpeg-devices 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List available devices

ffmpeg -devices

Capture from webcam

ffmpeg -f v4l2 -i [/dev/video0] [output.mp4]

Record screen

ffmpeg -f x11grab -i [:0.0] [screen.mp4]

Capture audio device

ffmpeg -f alsa -i [hw:0] [audio.wav]

List webcam formats

ffmpeg -f v4l2 -list_formats all -i [/dev/video0]

说明

ffmpeg devices enable capturing from hardware sources like webcams, microphones, and screens. Device-specific input formats provide access to system multimedia hardware. Different platforms have different device types: v4l2 and x11grab on Linux, avfoundation on macOS, and dshow on Windows. Each device type has specific options for resolution, framerate, and format. Device capture enables recording, streaming, and real-time processing of live input sources.

参数

-f _DEVICE_
Device type: v4l2, x11grab, alsa, pulse, dshow.
-i _SOURCE_
Device path or identifier.
v4l2
Video4Linux2 webcam capture.
x11grab
X11 screen capture.
alsa
ALSA audio capture.
pulse
PulseAudio capture.
dshow
DirectShow (Windows) capture.
-list_devices
List available devices.

FAQ

What is the ffmpeg-devices command used for?

ffmpeg devices enable capturing from hardware sources like webcams, microphones, and screens. Device-specific input formats provide access to system multimedia hardware. Different platforms have different device types: v4l2 and x11grab on Linux, avfoundation on macOS, and dshow on Windows. Each device type has specific options for resolution, framerate, and format. Device capture enables recording, streaming, and real-time processing of live input sources.

How do I run a basic ffmpeg-devices example?

Run `ffmpeg -devices` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f _DEVICE_ do in ffmpeg-devices?

Device type: v4l2, x11grab, alsa, pulse, dshow.