LinuxCommandLibrary

ffmpeg-devices

hardware capture device support for ffmpeg

TLDR

List available devices

$ ffmpeg -devices
copy
Capture from webcam
$ ffmpeg -f v4l2 -i [/dev/video0] [output.mp4]
copy
Record screen (X11)
$ ffmpeg -f x11grab -i [:0.0] [screen.mp4]
copy
Capture audio device
$ ffmpeg -f alsa -i [hw:0] [audio.wav]
copy
List webcam formats
$ ffmpeg -f v4l2 -list_formats all -i [/dev/video0]
copy

SYNOPSIS

ffmpeg -f device [options] -i source output

DESCRIPTION

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.

PARAMETERS

-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.

CAVEATS

Device names are platform-specific. Permissions may be required. Screen capture performance depends on system. Audio sync can be challenging.

HISTORY

ffmpeg device support evolved with multimedia hardware APIs. V4L2 support came with Linux video devices, while screen grabbing capabilities were added for recording and streaming use cases.

SEE ALSO

ffmpeg(1), ffprobe(1), v4l2-ctl(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community