ffmpeg-devices
List available multimedia devices
SYNOPSIS
To view documentation:
`man ffmpeg-devices`
To use devices with FFmpeg:
The `ffmpeg-devices` manual describes the device formats utilized by the core `ffmpeg` command. When interacting with devices, `ffmpeg` employs the `-f` option to specify the device format, followed by the `-i` option and the device path or identifier.
General Usage Pattern:
`ffmpeg -f <device_format> [device_options] -i <device_path_or_id> [output_options] <output_file_or_device>`
Examples:
`ffmpeg -f v4l2 -framerate 30 -video_size 640x480 -i /dev/video0 output.mkv`
`ffmpeg -f alsa -i hw:0,0 audio.wav`
`ffmpeg -f x11grab -framerate 25 -video_size 1920x1080 -i :0.0+0,0 desktop.mp4`
PARAMETERS
v4l2
Linux Video4Linux2 input device for webcams, capture cards. Common options include: `-video_size Wxh` (e.g., 640x480), `-framerate N`, `-input_format fmt`, `-standard std`.
alsa
Advanced Linux Sound Architecture input/output device. Common options include: `-channels N`, `-sample_rate N`, `-f s16le` (sample format).
x11grab
X11 display screen grabbing device for recording desktop sessions. Common options include: `-video_size Wxh`, `-framerate N`, `-i :0.0+offset_x,offset_y` (offset for capturing a specific part of the screen).
decklink
Blackmagic Design DeckLink capture/playback device. Common options include: `-video_input N`, `-audio_input N`, `-raw_format fmt`, `-framerate N`.
lavfi
Libavfilter virtual device. Allows complex filtergraphs to be used as input sources. Options are defined by the specific filtergraph used (e.g., `-i "amovie=input.mp3,asetrate=44100*1.5"`).
pulse
PulseAudio sound server input/output device. Common options include: `-server addr`, `-device name`.
fbdev
Linux framebuffer device input for direct screen capture. Common options include: `-framerate N`.
oss
Open Sound System input/output device. Options are generally similar to ALSA but specific to the OSS interface.
DESCRIPTION
The `ffmpeg-devices` entry refers to the manual page that provides comprehensive documentation on the various input and output devices supported by the FFmpeg multimedia framework. It serves as an essential reference for users who need to capture audio or video from hardware sources, or stream/output data to specific devices.
This documentation details device-specific formats (e.g., `v4l2`, `alsa`, `x11grab`, `decklink`), their unique options, and how to interact with them using the main `ffmpeg` command-line tool. Understanding `ffmpeg-devices` is crucial for configuring `ffmpeg` for tasks like live streaming, recording from webcams or microphones, or playing audio directly to a sound card.
It empowers users to leverage FFmpeg's powerful capabilities to interface with a wide range of multimedia hardware, ensuring proper setup and optimal performance for capture and playback operations across different operating systems.
CAVEATS
Compilation Dependency: Support for specific devices (e.g., DeckLink, PulseAudio) depends heavily on how your FFmpeg binary was compiled. If FFmpeg was built without certain libraries, the corresponding device formats will not be available. You can check compiled-in support with `ffmpeg -devices`.
System Drivers & Permissions: Proper functioning of devices requires correct kernel modules/drivers to be loaded and appropriate user permissions (e.g., belonging to `video` or `audio` groups) to access device files (`/dev/videoX`, `/dev/snd/pcmC0D0p`).
Device-Specific Complexity: Each device format has its own set of unique options, which can be complex and require detailed understanding of the hardware capabilities and limitations. Referencing the `ffmpeg-devices` man page is crucial for proper configuration.
Platform Specificity: Many devices are platform-specific (e.g., `v4l2`, `alsa`, `fbdev` are Linux-specific; `dshow` is Windows-specific; `avfoundation` is macOS-specific). The `ffmpeg-devices` manual often includes information relevant to various operating systems where applicable.
LISTING AVAILABLE DEVICES
To see which device formats your FFmpeg binary supports, use the `-devices` option with the main `ffmpeg` command:
`ffmpeg -devices`
This command will list all compiled-in input and output device formats. To identify specific hardware devices on your system (e.g., webcam paths, audio device IDs), you might need system-specific utilities like `ls /dev/video*`, `aplay -L`, or `arecord -L`.
INPUT VS. OUTPUT DEVICES
The `ffmpeg-devices` manual often distinguishes between input devices (used with `-i` for capture) and output devices (used as the final argument for playback/streaming). While many devices can function as both (e.g., ALSA), some are typically input-only (e.g., `v4l2`, `x11grab`). Understanding this distinction is key to constructing correct `ffmpeg` commands for your desired operation.
HISTORY
FFmpeg, initiated by Fabrice Bellard in 2000, has evolved into a cornerstone of multimedia processing. Device support has been an integral part of its development, enabling direct interaction with hardware for capture and playback. Early versions focused on basic video and audio input/output, primarily through standard Linux interfaces like V4L and OSS. Over time, support expanded significantly to include more advanced and specific hardware (e.g., ALSA, PulseAudio, DeckLink, various capture cards) and platform-specific APIs (DirectShow on Windows, AVFoundation on macOS). The `ffmpeg-devices` manual page itself serves as a continuously updated catalog reflecting this ongoing evolution, ensuring that FFmpeg remains a versatile tool for both generic and specialized hardware multimedia tasks.