FFMPEG-DEVICES(1)
π ffmpeg-devices(1) π
okay bestie, welcome to the ffmpeg-devices manual page β literally the whole vibe of FFmpeg devices, and yes we're getting into it. π β¨
NAME
ffmpeg-devices β FFmpeg devices
DESCRIPTION
This document describes the input and output devices provided by the libavdevice library. π¦
DEVICE OPTIONS
The libavdevice library gives you the same interface as libavformat. No cap: an input device is treated like a demuxer, and an output device is treated like a muxer, and the interface plus the generic device options are exactly the same ones provided by libavformat (see the ffmpeg-formats manual). π
On top of that, each input or output device may support so-called private options, which are specific to that component. π
You can set options by specifying -option value in the FFmpeg tools, or by setting the value explicitly in the device AVFormatContext options, or by using the libavutil/opt.h API for programmatic use. β¨
INPUT DEVICES
Input devices are configured elements in FFmpeg that let you access data coming from a multimedia device attached to your system. πΈ
When you configure your FFmpeg build, all the supported input devices are enabled by default. You can list all available ones using the configure option --list-indevs. π
You can disable all the input devices using the configure option --disable-indevs, and selectively enable an input device using the option --enable-indev=INDEV, or you can disable a particular input device using the option --disable-indev=INDEV. π
The option -devices of the ff* tools will display the list of supported input devices. π«Ά
A description of the currently available input devices follows. π
β¨ alsa β¨
ALSA (Advanced Linux Sound Architecture) input device. π₯
To enable this input device during configuration you need libasound installed on your system. π
This device allows capturing from an ALSA device. The name of the device to capture has to be an ALSA card identifier. π
An ALSA identifier has the syntax:
hw:<CARD>[,<DEV>[,<SUBDEV>]]
where the DEV and SUBDEV components are optional.
The three arguments (in order: CARD,DEV,SUBDEV) specify card number or identifier, device number and subdevice number (-1 means any). π¦
To see the list of cards currently recognized by your system check the files /proc/asound/cards and /proc/asound/devices. πΈ
For example to capture with ffmpeg from an ALSA device with card id 0, you may run the command:
ffmpeg -f alsa -i hw:0 alsaout.wav
For more information see: <http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html> π
Options
sample_rateβ Set the sample rate in Hz. Default is48000.channelsβ Set the number of channels. Default is2.
π android_camera π
Android camera input device. π±β¨
This input device uses the Android Camera2 NDK API which is available on devices with API level 24+. The availability of android_camera is autodetected during configuration. π
This device allows capturing from all cameras on an Android device, which are integrated into the Camera2 NDK API. π¦
The available cameras are enumerated internally and can be selected with the camera_index parameter. The input file string is discarded. π
Generally the back facing camera has index 0 while the front facing camera has index 1. πΈ
Options
video_sizeβ Set the video size given as a string such as640x480orhd720. Falls back to the first available configuration reported by Android if requested video size is not available or by default. πframerateβ Set the video framerate. Falls back to the first available configuration reported by Android if requested framerate is not available or by default (-1). β¨camera_indexβ Set the index of the camera to use. Default is0.input_queue_sizeβ Set the maximum number of frames to buffer. Default is5.
π avfoundation π
AVFoundation input device. π
AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX >= 10.7 as well as on iOS. π
The input filename has to be given in the following syntax:
-i "[[VIDEO]:[AUDIO]]"
The first entry selects the video input while the latter selects the audio input. The stream has to be specified by the device name or the device index as shown by the device list. Alternatively, the video and/or audio input device can be chosen by index using the
-video_device_index <INDEX>
and/or
-audio_device_index <INDEX>
, overriding any device name or index given in the input filename. π
All available devices can be enumerated by using -list_devices true, listing all device names and corresponding indices. πΈ
There are two device name aliases:
"default"β Select the AVFoundation default device of the corresponding type."none"β Do not record the corresponding media type. This is equivalent to specifying an empty device name or index.
Options
AVFoundation supports the following options:
-list_devices <TRUE|FALSE>β If set to true, a list of all available input devices is given showing all device names and indices. β¨-video_device_index <INDEX>β Specify the video device by its index. Overrides anything given in the input filename.-audio_device_index <INDEX>β Specify the audio device by its index. Overrides anything given in the input filename.-pixel_format <FORMAT>β Request the video device to use a specific pixel format. If the specified format is not supported, a list of available formats is given and the first one in this list is used instead. Available pixel formats are:
"monob, rgb555be, rgb555le, rgb565be, rgb565le,
rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16,
yuv422p10, yuv444p10,
yuv420p, nv12, yuyv422, gray"
-framerateβ Set the grabbing frame rate. Default isntsc, corresponding to a frame rate of30000/1001. π-video_sizeβ Set the video frame size.-capture_cursorβ Capture the mouse pointer. Default is0.-capture_mouse_clicksβ Capture the screen mouse clicks. Default is0.-capture_raw_dataβ Capture the raw device data. Default is0. Using this option may result in receiving the underlying data delivered to the AVFoundation framework. E.g. for muxed devices that sends raw DV data to the framework (like tape-based camcorders), setting this option to false results in extracted video frames captured in the designated pixel format only. Setting this option to true results in receiving the raw DV stream untouched. π
Examples
- Print the list of AVFoundation supported devices and exit:
$ ffmpeg -f avfoundation -list_devices true -i ""
- Record video from video device
0and audio from audio device0intoout.avi:
$ ffmpeg -f avfoundation -i "0:0" out.avi
- Record video from video device
2and audio from audio device1intoout.avi:
$ ffmpeg -f avfoundation -video_device_index 2 -i ":1" out.avi
- Record video from the system default video device using the pixel format
bgr0and do not record any audio intoout.avi:
$ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
- Record raw DV data from a suitable input device and write the output into
out.dv:
$ ffmpeg -f avfoundation -capture_raw_data true -i "zr100:none" out.dv
π decklink π
The decklink input device provides capture capabilities for Blackmagic DeckLink devices. π¬
To enable this input device, you need the Blackmagic DeckLink SDK and you need to configure with the appropriate --extra-cflags and --extra-ldflags. On Windows, you need to run the IDL files through widl. π
DeckLink is very picky about the formats it supports. Pixel format of the input can be set with raw_format. Framerate and video size must be determined for your device with -list_formats 1. Audio sample rate is always 48 kHz and the number of channels can be 2, 8 or 16. Note that all audio channels are bundled in one single audio track. π
Options
list_devicesβ If set to true, print a list of devices and exit. Defaults to false. This option is deprecated, please use the-sourcesoption offfmpegto list the available input devices. > β οΈ deprecated bestie, use-sourcesinstead.list_formatsβ If set to true, print a list of supported formats and exit. Defaults to false.format_code <FourCC>β This sets the input video format to the format given by the FourCC. To see the supported values of your device(s) uselist_formats. Note that there is a FourCC'pal 'that can also be used aspal(3 letters). Default behavior is autodetection of the input video format, if the hardware supports it. β¨raw_formatβ Set the pixel format of the captured video. Available values are:autoβ This is the default which means 8-bit YUV 422 or 8-bit ARGB if format autodetection is used, 8-bit YUV 422 otherwise.uyvy422β 8-bit YUV 422.yuv422p10β 10-bit YUV 422.argbβ 8-bit RGB.bgraβ 8-bit RGB.rgb10β 10-bit RGB.
teletext_linesβ If set to nonzero, an additional teletext stream will be captured from the vertical ancillary data. Both SD PAL (576i) and HD (1080i or 1080p) sources are supported. In case of HD sources, OP47 packets are decoded. This option is a bitmask of the SD PAL VBI lines captured, specifically lines 6 to 22, and lines 318 to 335. Line 6 is the LSB in the mask. Selected lines which do not contain teletext information will be ignored. You can use the specialallconstant to select all possible lines, orstandardto skip lines 6, 318 and 319, which are not compatible with all receivers. For SD sources,ffmpegneeds to be compiled with--enable-libzvbi. For HD sources, on older (pre-4K) DeckLink card models you have to capture in 10 bit mode. πchannelsβ Defines number of audio channels to capture. Must be2,8or16. Defaults to2.duplex_modeβ Sets the decklink device duplex/profile mode. Must beunset,half,full,one_sub_device_full,one_sub_device_half,two_sub_device_full,four_sub_device_halfDefaults tounset. Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property. For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2 sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles. π
Valid profile modes for DeckLink 8K Pro (with DeckLink SDK >= 11.0):
one_sub_device_full, one_sub_device_half, two_sub_device_full,
four_sub_device_half
Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
half, full
timecode_formatβ which timecode type gets baked into the frame and the video stream metadata. Has to be one ofnone,rp188vitc,rp188vitc2,rp188ltc,rp188hfr,rp188any,vitc,vitc2, orserial. Defaults tonone(so it's justβ¦ not included, bestie).
Okay so this part is lowkey important: to properly support 50/60 fps timecodes, the ordering of the queried timecode types for rp188any is HFR, VITC1, VITC2 and LTC for >30 fps content. And heads up β that's slightly different to the ordering used by the DeckLink API, which is HFR, VITC1, LTC, VITC2. Don't @ me, that's just how it is π
video_inputβ sets the video input source. Must beunset,sdi,hdmi,optical_sdi,component,compositeors_video. Defaults tounset.audio_inputβ sets the audio input source. Must beunset,embedded,aes_ebu,analog,analog_xlr,analog_rcaormicrophone. Defaults tounset.video_ptsβ sets the video packet timestamp source. Must bevideo,audio,reference,wallclockorabs_wallclock. Defaults tovideo.audio_ptsβ sets the audio packet timestamp source. Must bevideo,audio,reference,wallclockorabs_wallclock. Defaults toaudio.draw_barsβ if set totrue, color bars are drawn in the event of a signal loss. Defaults totrue. > Heads up bestie: this option is deprecated, please use thesignal_loss_actionoption instead π«Άsignal_loss_actionβ sets the action to take in the event of a signal loss. Accepts one of the following values:noneβ do nothing on signal loss. This usually results in black frames.barsβ draw color bars on signal loss. Only supported for 8-bit input signals.repeatβ repeat the last video frame on signal loss.
Defaults to bars. (The original also lets you pass 1, 2, 3 for none, bars, repeat respectively, iykyk.)
queue_sizeβ sets maximum input buffer size in bytes. If the buffering reaches this value, incoming frames will be dropped. Defaults to1073741824.audio_depthβ sets the audio sample bit depth. Must be16or32. Defaults to16.decklink_copytsβ if set totrue, timestamps are forwarded as they are without removing the initial offset. Defaults tofalse.timestamp_alignβ capture start time alignment in seconds. If set to nonzero, input frames are dropped till the system timestamp aligns with configured value. Alignment difference of up to one frame duration is tolerated. This is useful for maintaining input synchronization across N different hardware devices deployed for 'N-way' redundancy. The system time of different hardware devices should be synchronized with protocols such as NTP or PTP, before using this option.
Girl, listen: this method is not foolproof. In some border cases input synchronization may not happen due to thread scheduling jitters in the OS. Either sync could go wrong by 1 frame or in a rarer casetimestamp_alignseconds. Defaults to0π
wait_for_tc(bool) β drop frames till a frame with timecode is received. Sometimes serial timecode isn't received with the first input frame. If that happens, the stored stream timecode will be inaccurate. If this option is set totrue, input frames are dropped till a frame with timecode is received.timecode_formatoption must be specified. Defaults tofalse.enable_klv(bool) β if set totrue, extracts KLV data from VANC and outputs KLV packets. KLV VANC packets are joined based on MID and PSC fields and aggregated into one KLV packet. Defaults tofalse.
β¨ Examples β¨
- List input devices:
ffmpeg -sources decklink
- List supported formats:
ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
- Capture video clip at 1080i50:
ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -c:a copy -c:v copy output.avi
- Capture video clip at 1080i50 10 bit:
ffmpeg -raw_format yuv422p10 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
- Capture video clip at 1080i50 with 16 audio channels:
ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
π₯ dshow
Windows DirectShow input device. Yes, Windows bestie, we see you πͺ
DirectShow support is enabled when FFmpeg is built with the mingw-w64 project. Currently only audio and video devices are supported.
Multiple devices may be opened as separate inputs, but they may also be opened on the same input, which should improve synchronism between them. Slay, synchronized π«
The input name should be in the format:
<TYPE>=<NAME>[:<TYPE>=<NAME>]
where TYPE can be either audio or video, and NAME is the device's name or alternative name.. (yes there's a double period in the original, we're keeping it, character for character, no cap π)
Options
If no options are specified, the device's defaults are used. If the device does not support the requested options, it will fail to open. Rude, but okay.
video_sizeβ set the video size in the captured video.framerateβ set the frame rate in the captured video.sample_rateβ set the sample rate (in Hz) of the captured audio.sample_sizeβ set the sample size (in bits) of the captured audio.channelsβ set the number of channels in the captured audio.list_devicesβ if set totrue, print a list of devices and exit.list_optionsβ if set totrue, print a list of selected device's options and exit.video_device_numberβ set video device number for devices with the same name (starts at0, defaults to0).audio_device_numberβ set audio device number for devices with the same name (starts at0, defaults to0).pixel_formatβ select pixel format to be used by DirectShow. This may only be set when the video codec is not set or set torawvideo.audio_buffer_sizeβ set audio device buffer size in milliseconds (which can directly impact latency, depending on the device). Defaults to using the audio device's default buffer size (typically some multiple of 500ms). Setting this value too low can degrade performance. See also<http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx>video_pin_nameβ select video capture pin to use by name or alternative name.audio_pin_nameβ select audio capture pin to use by name or alternative name.crossbar_video_input_pin_numberβ select video input pin number for crossbar device. This will be routed to the crossbar device's Video Decoder output pin.
Note that changing this value can affect future invocations (sets a new default) until system reboot occurs. It's giving "sticky settings," so be careful π
crossbar_audio_input_pin_numberβ select audio input pin number for crossbar device. This will be routed to the crossbar device's Audio Decoder output pin.
Same warning, bestie: changing this value can affect future invocations (sets a new default) until system reboot occurs.
show_video_device_dialogβ if set totrue, before capture starts, popup a display dialog to the end user, allowing them to change video filter properties and configurations manually.
Note that for crossbar devices, adjusting values in this dialog may be needed at times to toggle between PAL (25 fps) and NTSC (29.97) input frame rates, sizes, interlacing, etc. Changing these values can enable different scan rates/frame rates and avoiding green bars at the bottom, flickering scan lines, etc. Note that with some devices, changing these properties can also affect future invocations (sets new defaults) until system reboot occurs. Iconic little chaos gremlin behavior π
show_audio_device_dialogβ if set totrue, before capture starts, popup a display dialog to the end user, allowing them to change audio filter properties and configurations manually.show_video_crossbar_connection_dialogβ if set totrue, before capture starts, popup a display dialog to the end user, allowing them to manually modify crossbar pin routings, when it opens a video device.show_audio_crossbar_connection_dialogβ if set totrue, before capture starts, popup a display dialog to the end user, allowing them to manually modify crossbar pin routings, when it opens an audio device.show_analog_tv_tuner_dialogβ if set totrue, before capture starts, popup a display dialog to the end user, allowing them to manually modify TV channels and frequencies.show_analog_tv_tuner_audio_dialogβ if set totrue, before capture starts, popup a display dialog to the end user, allowing them to manually modify TV audio (like mono vs. stereo, Language A,B or C).audio_device_loadβ load an audio capture filter device from file instead of searching it by name. It may load additional parameters too, if the filter supports the serialization of its properties to. To use this an audio capture source has to be specified, but it can be anything even fake one. Fr fr, anything πaudio_device_saveβ save the currently used audio capture filter device and its parameters (if the filter supports it) to a file. If a file with the same name exists it will be overwritten.video_device_loadβ load a video capture filter device from file instead of searching it by name. It may load additional parameters too, if the filter supports the serialization of its properties to. To use this a video capture source has to be specified, but it can be anything even fake one.video_device_saveβ save the currently used video capture filter device and its parameters (if the filter supports it) to a file. If a file with the same name exists it will be overwritten.use_video_device_timestampsβ if set tofalse, the timestamp for video frames will be derived from the wallclock instead of the timestamp provided by the capture device. This allows working around devices that provide unreliable timestamps. Love a workaround π
β¨ Examples β¨
- Print the list of DirectShow supported devices and exit:
$ ffmpeg -list_devices true -f dshow -i dummy
- Open video device Camera:
$ ffmpeg -f dshow -i video="Camera"
- Open second video device with name Camera:
$ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
- Open video device Camera and audio device Microphone:
$ ffmpeg -f dshow -i video="Camera":audio="Microphone"
- Print the list of supported options in selected device and exit:
$ ffmpeg -list_options true -f dshow -i video="Camera"
- ok so you can also pin down exactly which pins to grab, by name or alternative name, or even point at a different device name entirely β like this:
$ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
- and bestie, you can set up a crossbar device π β give it the crossbar pins and let the user tweak video capture properties at startup:
$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
-crossbar_audio_input_pin_number 3 -i video="AVerMedia BDA Analog Capture":audio="AVerMedia BDA Analog Capture"
πΌοΈ fbdev
Okay so this one is the Linux framebuffer input device. Basically it's a graphic hardware-independent abstraction layer that shows graphics on your monitor β usually on the console β and you reach it through a file device node, usually /dev/fb0. Cute, right? π
Want the whole lore? Go read Documentation/fb/framebuffer.txt in the Linux source tree, it's all in there fr fr.
See also <http://linux-fbdev.sourceforge.net/>, and fbset(1).
To record from the framebuffer device /dev/fb0 with ffmpeg:
ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
And if you just want one lil screenshot image, this is the move π:
ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
β¨ Options β¨
framerateβ sets the frame rate. Default is25.
πͺ gdigrab
The Win32 GDI-based screen capture device β Windows besties, this is your moment π. It lets you capture a region of the display on Windows.
So the input filenames can be a few different things, like:
desktop
or
title=<window_title>
or
hwnd=<window_hwnd>
The first one captures your entire desktop, or a fixed region of it. The second and third ones instead grab the contents of a single window, no matter where that window is sitting on screen. Iconic behaviour honestly π
For example, to grab the whole desktop using ffmpeg:
ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
Grab a 640x480 region at position "10,20":
ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
And grab the contents of the window literally named "Calculator":
ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
π Options π
draw_mouseβ says whether to draw the mouse pointer. Use the value0to not draw the pointer. Default value is1.framerateβ sets the grabbing frame rate. Default value is"ntsc", which corresponds to a frame rate of"30000/1001".show_regionβ shows the grabbed region on screen.
If show_region is specified with 1, then the grabbing region gets indicated on screen. With this option it's super easy to know what's being grabbed when you're only snatching a portion of the screen. π«Ά
Heads up bestie: show_region is incompatible with grabbing the contents of a single window. No cap.
For example:
ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
video_sizeβ sets the video frame size. The default is to capture the full screen ifdesktopis selected, or the full window size iftitle=window_titleis selected.offset_xβ when you're capturing a region withvideo_size, this sets the distance from the left edge of the screen or desktop.
Ngl this one's a lil sneaky: the offset calculation is from the top left corner of the primary monitor on Windows. If you've got a monitor positioned to the left of your primary monitor, you'll need to use a negative offset_x value to move the region over to that monitor. π
offset_yβ when you're capturing a region withvideo_size, this sets the distance from the top edge of the screen or desktop.
Same deal, opposite direction π: the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned above your primary monitor, you'll need to use a negative offset_y value to move the region up to that monitor.
π₯ iec61883
FireWire DV/HDV input device using libiec61883. Retro tech girlies rise π§
To enable this input device, you need libiec61883, libraw1394 and libavc1394 installed on your system. Use the configure option --enable-libiec61883 to compile with the device enabled.
The iec61883 capture device supports capturing from a video device connected via IEEE1394 (FireWire), using libiec61883 and the new Linux FireWire stack (juju). This is the default DV/HDV input method in Linux Kernel 2.6.37 and later, since the old FireWire stack was removed. RIP old stack π
Specify the FireWire port to be used as input file, or "auto" to choose the first port connected.
πΈ Options πΈ
dvtypeβ overrides autodetection of DV/HDV. This should only be used if auto detection does not work, or if usage of a different device type should be prohibited.
Fr fr be careful: treating a DV device as HDV (or vice versa) will not work and results in undefined behavior π. The valuesauto,dvandhdvare supported.
dvbufferβ sets the maximum size of buffer for incoming data, in frames. For DV, this is an exact value. For HDV, it is not frame exact, since HDV does not have a fixed frame size.dvguidβ selects the capture device by specifying its GUID. Capturing will only be performed from the specified device and fails if no device with the given GUID is found. This is useful to select the input if multiple devices are connected at the same time. Look at/sys/bus/firewire/devicesto find out the GUIDs. β¨
π¦ Examples π¦
- Grab and show the input of a FireWire DV/HDV device:
ffplay -f iec61883 -i auto
- Grab and record the input of a FireWire DV/HDV device, using a packet buffer of
100000packets if the source is HDV:
ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
π§ jack
The JACK input device β audio girlies, this is for you π
To enable this input device during configuration you need libjack installed on your system.
A JACK input device creates one or more JACK writable clients, one for each audio channel, with name client_name:input_N, where client_name is the name provided by the application, and N is a number which identifies the channel. Each writable client will send the acquired data to the FFmpeg input device. Slay, very demure, very mindful π
Once you've created one or more JACK readable clients, you need to connect them to one or more JACK writable clients.
To connect or disconnect JACK clients you can use the jack_connect and jack_disconnect programs, or do it through a graphical interface, for example with qjackctl.
To list the JACK clients and their properties you can invoke the command jack_lsp.
Here's an example showing how to capture a JACK readable client with ffmpeg. π
# Create a JACK writable client with name "ffmpeg".
$ ffmpeg -f jack -i ffmpeg -y out.wav
# Start the sample jack_metro readable client.
$ jack_metro -b 120 -d 0.2 -f 4000
# List the current JACK clients.
$ jack_lsp -c
system:capture_1
system:capture_2
system:playback_1
system:playback_2
ffmpeg:input_1
metro:120_bpm
# Connect metro to the ffmpeg writable client.
$ jack_connect metro:120_bpm ffmpeg:input_1
For more information read: <http://jackaudio.org/>
β Options β
channelsβ sets the number of channels. Default is2.
π kmsgrab
The KMS video input device. Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a DRM object that can be passed to other hardware functions.
Requires either DRM master or CAP_SYS_ADMIN to run.
Okay bestie if you don't understand what all of that means, you probably don't want this π. Look at x11grab instead.
π§ Options π§
deviceβ DRM device to capture on. Defaults to/dev/dri/card0.formatβ pixel format of the framebuffer. This can be autodetected if you're running Linux5.7or later, but needs to be provided for earlier versions. Defaults tobgr0, which is the most common format used by the Linux console and Xorg X server.format_modifierβ format modifier to signal on output frames. This is necessary to import correctly into some APIs. It can be autodetected if you're running Linux5.7or later, but will need to be provided explicitly when needed in earlier versions. See thelibdrmdocumentation for possible values.crtc_idβ KMS CRTC ID to define the capture source. The first active plane on the given CRTC will be used.plane_idβ KMS plane ID to define the capture source. Defaults to the first active plane found if neithercrtc_idnorplane_idare specified.framerateβ framerate to capture at. This is not synchronised to any page flipping or framebuffer changes β it just defines the interval at which the framebuffer is sampled. Sampling faster than the framebuffer update rate will generate independent frames with the same content. Defaults to30.
π Examples π
- Capture from the first active plane, download the result to normal frames and encode. This will only work if the framebuffer is both linear and mappable β if not, the result may be scrambled or fail to download. π
ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
- Capture from CRTC ID
42at60fps, map the result to VAAPI, convert to NV12 and encode as H.264:
ffmpeg -crtc_id 42 -framerate 60 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v h264_vaapi output.mp4
- To capture only part of a plane the output can be cropped β this can be used to capture a single window, as long as it has a known absolute position and size. For example, to capture and encode the middle quarter of a
1920x1080plane:
ffmpeg -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,crop=960:540:480:270,scale_vaapi=960:540:nv12' -c:v h264_vaapi output.mp4
π lavfi
The Libavfilter input virtual device β¨ β lowkey my fave tbh.
This input device reads data from the open output pads of a libavfilter filtergraph.
For each filtergraph open output, the input device will create a corresponding stream which is mapped to the generated output. The filtergraph is specified through the option graph.
π Options π
graphβ specify the filtergraph to use as input. Each video open output must be labelled by a unique string of the form"outN", whereNis a number starting from0corresponding to the mapped input stream generated by the device. The first unlabelled output is automatically assigned to the"out0"label, but all the others need to be specified explicitly. π«Ά
Okay so about that output label: you can append the suffix +subcc to create an extra stream with the closed captions packets attached to that output (experimental; only for EIA-608 / CEA-708 for now). The subcc streams are created after all the normal streams, in the order of the corresponding stream. So if youβve got out19+subcc, out7+subcc and up to out42, then stream #43 is the subcc for stream #7 and stream #44 is the subcc for stream #19. Bestie, that ordering is lowkey iconic.
If itβs not specified, it defaults to the filename specified for the input device.
graph_fileβ Set the filename of the filtergraph to be read and sent to the other filters. The syntax of the filtergraph is the same as the one specified by the optiongraph.dumpgraphβ Dump graph tostderr.
πΈ Examples πΈ
- Create a color video stream and play it back with
ffplay:
ffplay -f lavfi -graph "color=c=pink [out0]" dummy
- As the previous example, but use filename for specifying the graph description, and omit the
out0label:
ffplay -f lavfi color=c=pink
- Create three different video test filtered sources and play them:
ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
- Read an audio stream from a file using the
amoviesource and play it back withffplay:
ffplay -f lavfi "amovie=test.wav"
- Read an audio stream and a video stream and play it back with
ffplay:
ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
- Dump decoded frames to images and Closed Captions to an RCWT backup:
ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rcwt subcc.bin
πΏ libcdio πΏ
Audio-CD input device based on libcdio. Itβs giving βphysical media resurgence,β honestly.
To enable this input device during configuration you need libcdio installed on your system. It requires the configure option --enable-libcdio.
This device allows playing and grabbing from an Audio-CD.
For example to copy with ffmpeg the entire Audio-CD in /dev/sr0, you may run the command:
ffmpeg -f libcdio -i /dev/sr0 cd.wav
ποΈ Options ποΈ
speedβ Set drive reading speed. Default value is0. The speed is specified CD-ROM speed units. The speed is set through the libcdiocdio_cddap_speed_setfunction. On many CD-ROM drives, specifying a value too large will result in using the fastest speed.paranoia_modeβ Set paranoia recovery mode flags. It accepts one of the following values:disable,verify,overlap,neverskip,full. Default value isdisable. For more information about the available recovery modes, consult the paranoia project documentation.
π· libdc1394 π·
IIDC1394 input device, based on libdc1394 and libraw1394.
Requires the configure option --enable-libdc1394.
ποΈ Options ποΈ
framerateβ Set the frame rate. Default isntsc, corresponding to a frame rate of30000/1001.pixel_formatβ Select the pixel format. Default isuyvy422.video_sizeβ Set the video size given as a string such as640x480orhd720. Default isqvga.
π openal π
The OpenAL input device provides audio capture on all systems with a working OpenAL 1.1 implementation. Audio capture bestie era.
To enable this input device during configuration, you need OpenAL headers and libraries installed on your system, and need to configure FFmpeg with --enable-openal.
OpenAL headers and libraries should be provided as part of your OpenAL implementation, or as an additional download (an SDK). Depending on your installation you may need to specify additional flags via the --extra-cflags and --extra-ldflags for allowing the build system to locate the OpenAL headers and libraries.
An incomplete list of OpenAL implementations follows:
- Creative β The official Windows implementation, providing hardware acceleration with supported devices and software fallback. See
<http://openal.org/>. - OpenAL Soft β Portable, open source (LGPL) software implementation. Includes backends for the most common sound APIs on the Windows, Linux, Solaris, and BSD operating systems. See
<http://kcat.strangesoft.net/openal.html>. - Apple β OpenAL is part of Core Audio, the official Mac OS X Audio interface. See
<http://developer.apple.com/technologies/mac/audio-and-video.html>
This device allows one to capture from an audio input device handled through OpenAL.
You need to specify the name of the device to capture in the provided filename. If the empty string is provided, the device will automatically select the default device. You can get the list of the supported devices by using the option list_devices.
ποΈ Options ποΈ
channelsβ Set the number of channels in the captured audio. Only the values1(monaural) and2(stereo) are currently supported. Defaults to2.sample_sizeβ Set the sample size (in bits) of the captured audio. Only the values8and16are currently supported. Defaults to16.sample_rateβ Set the sample rate (in Hz) of the captured audio. Defaults to44.1k.list_devicesβ If set to true, print a list of devices and exit. Defaults tofalse.
πΈ Examples πΈ
Print the list of OpenAL supported devices and exit:
$ ffmpeg -list_devices true -f openal -i dummy out.ogg
Capture from the OpenAL device DR-BT101 via PulseAudio:
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
Capture from the default device (note the empty string '' as filename):
$ ffmpeg -f openal -i '' out.ogg
Capture from two devices simultaneously, writing to two different files, within the same ffmpeg command:
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
Note: not all OpenAL implementations support multiple simultaneous capture - try the latest OpenAL Soft if the above does not work.
π§ oss π§
Open Sound System input device.
The filename to provide to the input device is the device node representing the OSS input device, and is usually set to /dev/dsp.
For example to grab from /dev/dsp using ffmpeg use the command:
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
For more information about OSS see: <http://manuals.opensound.com/usersguide/dsp.html>
ποΈ Options ποΈ
sample_rateβ Set the sample rate in Hz. Default is48000.channelsβ Set the number of channels. Default is2.
π pulse π
PulseAudio input device.
To enable this output device you need to configure FFmpeg with --enable-libpulse.
The filename to provide to the input device is a source device or the string default
To list the PulseAudio source devices and their properties you can invoke the command pactl list sources.
More information about PulseAudio can be found on <http://www.pulseaudio.org>.
ποΈ Options ποΈ
serverβ Connect to a specific PulseAudio server, specified by an IP address. Default server is used when not provided.nameβ Specify the application name PulseAudio will use when showing active clients, by default it is theLIBAVFORMAT_IDENTstring.stream_nameβ Specify the stream name PulseAudio will use when showing active streams, by default it isrecord.sample_rateβ Specify the samplerate in Hz, by default 48kHz is used.channelsβ Specify the channels in use, by default 2 (stereo) is set.frame_sizeβ This option does nothing and is deprecated. Literally nothing. Itβs giving vestigial.fragment_sizeβ Specify the size in bytes of the minimal buffering fragment in PulseAudio, it will affect the audio latency. By default it is set to 50 ms amount of data.wallclockβ Set the initial PTS using the current time. Default is1.
πΈ Examples πΈ
Record a stream from default device:
ffmpeg -f pulse -i default /tmp/pulse.wav
π¦ sndio π¦
sndio input device.
To enable this input device during configuration you need libsndio installed on your system.
The filename to provide to the input device is the device node representing the sndio input device, and is usually set to /dev/audio0.
For example to grab from /dev/audio0 using ffmpeg use the command:
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
ποΈ Options ποΈ
sample_rateβ Set the sample rate in Hz. Default is48000.channelsβ Set the number of channels. Default is2.
π₯ video4linux2, v4l2 π₯
Video4Linux2 input video device.
v4l2 can be used as alias for video4linux2.
If FFmpeg is built with v4l-utils support (by using the --enable-libv4l2 configure option), it is possible to use it with the -use_libv4l2 input device option.
The name of the device to grab is a file device node, usually Linux systems tend to automatically create such nodes when the device (e.g. an USB webcam) is plugged into the system, and has a name of the kind /dev/videoN, where N is a number associated to the device.
Video4Linux2 devices usually support a limited set of widthxheight sizes and frame rates. You can check which are supported using -list_formats all for Video4Linux2 devices. Some devices, like TV cards, support one or more standards. It is possible to list all the supported standards using -list_standards all.
The time base for the timestamps is 1 microsecond. Depending on the kernel version and configuration, the timestamps may be derived from the real time clock (origin at the Unix Epoch) or the monotonic clock (origin usually at boot time, unaffected by NTP or manual changes to the clock). The -timestamps abs or -ts abs option can be used to force conversion into the real time clock.
Some usage examples of the video4linux2 device with ffmpeg and ffplay:
- List supported formats for a video4linux2 device:
ffplay -f video4linux2 -list_formats all /dev/video0
- Grab and show the input of a video4linux2 device:
ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
- Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set:
ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
For more information about Video4Linux, check <http://linuxtv.org/>.
ποΈ Options ποΈ
standardβ Set the standard. Must be the name of a supported standard. To get a list of the supported standards, use thelist_standardsoption.channelβ Set the input channel number. Default to-1, which means using the previously selected channel.video_sizeβ sets the video frame size, bestie. the argument has to be a string shaped likeWIDTHxHEIGHTor one of those valid size abbreviations, no cap πpixel_formatβ picks the pixel format. lowkey only valid for raw video input tho, so don't come at her πinput_formatβ sets the preferred pixel format (again, raw video) or a codec name. this is the girlie that lets you pick your input format when several of them are just sitting there available β¨framerateβ sets the preferred video frame rate. that's it, that's the whole vibe π¦list_formatsβ lists the available formats (supported pixel formats, codecs, and frame sizes) and then dips. exit stage left, periodt π
the available values are:
allβ show all available formats, both compressed and non-compressed, the whole buffet πrawβ show only raw video, aka non-compressed formatscompressedβ show only compressed formats
list_standardsβ lists the supported standards and exits. queen of knowing what's supported π
the available values are:
allβ show all supported standards
timestamps,tsβ sets the type of timestamps for grabbed frames β
the available values are:
defaultβ use timestamps from the kernelabsβ use absolute timestamps (wall clock, like, actual time o'clock π°οΈ)mono2absβ force conversion from monotonic to absolute timestamps
default value is "default".
use_libv4l2β use libv4l2 (v4l-utils) conversion functions. default is0. like, off by default, but she's there if you need her π
vfwcap
VfW (Video for Windows) capture input device π¬
the filename you pass as input is the capture driver number, ranging from 0 to 9. you may use "list" as the filename to print a list of drivers. any other filename will be interpreted as device number 0 β so like, if you're being chaotic and typing random stuff, congrats, you got device 0 π
Options
video_sizeβ set the video frame size πframerateβ set the grabbing frame rate. default value is"ntsc", which corresponds to a frame rate of"30000/1001". yes that's a weird-looking fraction, no she's not going to simplify it for you π
x11grab
X11 video input device, aka the screen-recording icon β¨
to enable this input device during configuration you need libxcb installed on your system. it'll be automatically detected during configuration, so like, no manual labor required π«Ά
this device lets you capture a region of an X11 display.
the filename passed as input has this syntax:
[<hostname>]:<display_number>.<screen_number>[+<x_offset>,<y_offset>]
hostname:display_number.screen_number specifies the X11 display name of the screen to grab from. hostname can be omitted, and defaults to "localhost". the environment variable DISPLAY contains the default display name π₯
x_offset and y_offset specify the offsets of the grabbed area with respect to the top-left border of the X11 screen. they default to 0.
check the X11 documentation (e.g. man X) for more detailed information, iykyk π
use the xdpyinfo program for getting basic information about the properties of your X11 display (e.g. grep for "name" or "dimensions"). lowkey a lifesaver.
for example, to grab from :0.0 using ffmpeg:
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
grab at position "10,20":
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
Options
select_regionβ specify whether to select the grabbing area graphically using the pointer π±οΈ a value of1prompts the user to select the grabbing area graphically by clicking and dragging. a single click with no dragging will select the whole screen. a region with zero width or height will also select the whole screen. this option overwrites thevideo_size,grab_x, andgrab_yoptions β so yeah, she has main character energy and takes over π default value is0.draw_mouseβ specify whether to draw the mouse pointer. a value of0means don't draw the pointer. default value is1πfollow_mouseβ make the grabbed area follow the mouse. the argument can be"centered"or a number of pixels PIXELS π
when it's specified with "centered", the grabbing region follows the mouse pointer and keeps the pointer at the center of the region. otherwise, the region follows only when the mouse pointer reaches within PIXELS (greater than zero) to the edge of the region.
for example:
ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
to follow only when the mouse pointer reaches within 100 pixels to the edge:
ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
framerateβ set the grabbing frame rate. default value is"ntsc", corresponding to a frame rate of"30000/1001"βshow_regionβ show the grabbed region on screen π
if show_region is specified with 1, then the grabbing region will be indicated on screen. with this option, it's easy to know what's being grabbed if only a portion of the screen is grabbed. honestly super helpful, no notes π
region_borderβ set the region border thickness if-show_region 1is used. range is1to128and default is3(XCB-based x11grab only) πΌοΈ
for example:
ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
with follow_mouse:
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
window_idβ grab this window, instead of the whole screen. default value is0, which maps to the whole screen (root window) πͺ
the id of a window can be found using the xwininfo program, possibly with options -tree and -root.
if the window is later enlarged, the new area is not recorded. video ends when the window is closed, unmapped (i.e., iconified) or shrunk beyond the video size (which defaults to the initial window size). so like, resize at your own risk bestie π
this option disables options follow_mouse and select_region.
video_sizeβ set the video frame size. default is the full desktop or window π₯οΈgrab_x,grab_yβ set the grabbing region coordinates. they're expressed as offset from the top left corner of the X11 window and correspond to thex_offsetandy_offsetparameters in the device name. the default value for both options is0π
OUTPUT DEVICES
output devices are configured elements in FFmpeg that can write multimedia data to an output device attached to your system. like, video goes out this time, we're not capturing, we're serving π
when you configure your FFmpeg build, all the supported output devices are enabled by default. you can list all available ones using the configure option --list-outdevs β¨
you can disable all the output devices using the configure option --disable-outdevs, and selectively enable an output device using the option --enable-outdev=OUTDEV, or you can disable a particular input device using the option --disable-outdev=OUTDEV. (yes, the source says "input device" there in that last clause β she's quoting it exactly, don't @ her π)
the option -devices of the ff* tools will display the list of enabled output devices π¦
a description of the currently available output devices follows, bestie, get comfy π
alsa
ALSA (Advanced Linux Sound Architecture) output device π΅
Examples
- play a file on the default ALSA device:
ffmpeg -i INPUT -f alsa default
- play a file on soundcard 1, audio device 7:
ffmpeg -i INPUT -f alsa hw:1,7
AudioToolbox
AudioToolbox output device π
allows native output to CoreAudio devices on OSX. apple girlies we see you π«Ά
the output filename can be empty (or -) to refer to the default system output device, or a number that refers to the device index as shown using: -list_devices true.
alternatively, the audio input device can be chosen by index using the
B<-audio_device_index E<lt>INDEXE<gt>>
, overriding any device name or index given in the input filename. (that's the literal manpage markup right there, character for character β she's iconic in a cursed way π)
all available devices can be enumerated by using -list_devices true, listing all device names, UIDs and corresponding indices π
Options
AudioToolbox supports the following options:
-audio_device_index <INDEX>β specify the audio device by its index. overrides anything given in the output filename. periodt.
Examples
- print the list of supported devices and output a sine wave to the default device:
$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -list_devices true -
- output a sine wave to the device with the index 2, overriding any output filename:
$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -audio_device_index 2 -
caca
CACA output device π
this output device lets you show a video stream in a CACA window. only one CACA window is allowed per application, so you can have only one instance of this output device in an application. one window, one queen, no exceptions π
to enable this output device you need to configure FFmpeg with --enable-libcaca. libcaca is a graphics library that outputs text instead of pixels β yes, text, that's the whole aesthetic, it's giving terminal art π¨
for more information about libcaca, check: <http://caca.zoy.org/wiki/libcaca>
Options
window_titleβ set the CACA window title. if not specified, defaults to the filename specified for the output device π·οΈwindow_sizeβ set the CACA window size. can be a string of the formwidthxheightor a video size abbreviation. if not specified it defaults to the size of the input video πΌοΈdriverβ set display driver.algorithmβ set dithering algorithm. dithering is necessary because the picture being rendered has usually far more colours than the available palette. the accepted values are listed with-list_dither algorithmsπ¨antialiasβ set antialias method. antialiasing smoothens the rendered image and avoids the commonly seen staircase effect β¨ the accepted values are listed with-list_dither antialiases.charsetβ set which characters are going to be used when rendering text. the accepted values are listed with-list_dither charsets.colorβ set color to be used when rendering text. the accepted values are listed with-list_dither colorsπΈlist_driversβ if set to true, print a list of available drivers and exit.list_ditherβ list available dither options related to the argument. the argument must be one of"algorithms","antialiases","charsets","colors"π
Examples
- the following command shows the ffmpeg output is a CACA window, forcing its size to
80x25:
ffmpeg -i INPUT -c:v rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
- show the list of available drivers and exit:
ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
- show the list of available dither colors and exit:
ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
decklink
the decklink output device provides playback capabilities for Blackmagic DeckLink devices π₯
to enable this output device, you need the Blackmagic DeckLink SDK and you need to configure with the appropriate --extra-cflags and --extra-ldflags. on Windows, you need to run the IDL files through widl πͺ
DeckLink is so picky about formats bestie, like it will not budge π Pixel format is always uyvy422, and you gotta figure out framerate, field order and video size for your device with -list_formats 1. Audio sample rate is always 48 kHz. That's just the rules. π
β¨ Options β¨
list_devicesβ if you set this to true, it prints a list of devices and dips out. Defaults tofalse. > Heads up: this option is deprecated β please use the-sinksoption offfmpegto list the available output devices instead, okurrr?list_formatsβ set it to true and it prints a list of supported formats and exits. Defaults tofalse.prerollβ how much time to preroll video, in seconds. Defaults to0.5.duplex_modeβ sets the decklink device duplex/profile mode. Must beunset,half,full,one_sub_device_full,one_sub_device_half,two_sub_device_full,four_sub_device_half. Defaults tounset.
Note: DeckLink SDK 11.0 replaced the duplex property with a profile property. For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2 sub-devices that use the same connectors. For the DeckLink 8K Pro, a profile is shared between all 4 sub-devices. So the DeckLink 8K Pro supports four profiles, slay.
Valid profile modes for DeckLink 8K Pro (with DeckLink SDK >= 11.0): one_sub_device_full, one_sub_device_half, two_sub_device_full, four_sub_device_half. Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2: half, full.
timing_offsetβ sets the genlock timing pixel offset on the used output. Defaults tounset.linkβ sets the SDI video link configuration on the used output. Must beunset,single link SDI,dual link SDIorquad link SDI. Defaults tounset.sqdβ enable Square Division Quad Split mode for Quad-link SDI output. Must beunset,trueorfalse. Defaults tounset.level_aβ enable SMPTE Level A mode on the used output. Must beunset,trueorfalse. Defaults tounset.vanc_queue_sizeβ sets the maximum output buffer size in bytes for VANC data. If the buffering reaches this value, outgoing VANC data will be dropped π. Defaults to1048576.
β¨ Examples β¨
- List output devices:
ffmpeg -sinks decklink
- List supported formats:
ffmpeg -i test.avi -f decklink -list_formats 1 'DeckLink Mini Monitor'
- Play video clip:
ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 'DeckLink Mini Monitor'
- Play video clip with non-standard framerate or video size:
ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLink Mini Monitor'
π fbdev π
The Linux framebuffer output device, we love her π«Ά
The Linux framebuffer is a graphic hardware-independent abstraction layer for showing graphics on a computer monitor β typically on the console, iykyk. You access it through a file device node, usually /dev/fb0.
For more detailed info, go read the file Documentation/fb/framebuffer.txt included in the Linux source tree. It's giving homework but it's worth it β¨
β¨ Options β¨
xoffset,yoffsetβ set the x/y coordinate of the top left corner. Default is0.
β¨ Examples β¨
Play a file on the framebuffer device /dev/fb0. The required pixel format depends on your current framebuffer settings, so check that first bestie:
ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
See also http://linux-fbdev.sourceforge.net/, and fbset(1).
π§ oss π§
The OSS (Open Sound System) output device. Short and sweet, we stan π
π pulse π
The PulseAudio output device β literal main character energy.
To enable this output device you need to configure FFmpeg with --enable-libpulse.
More information about PulseAudio can be found on http://www.pulseaudio.org
β¨ Options β¨
serverβ connect to a specific PulseAudio server, specified by an IP address. The default server is used when not provided.nameβ specify the application name PulseAudio will use when showing active clients. By default it's theLIBAVFORMAT_IDENTstring.stream_nameβ specify the stream name PulseAudio will use when showing active streams. By default it's set to the specified output name.deviceβ specify the device to use. The default device is used when not provided. You can get the list of output devices with the commandpactl list sinks.buffer_size,buffer_durationβ control the size and duration of the PulseAudio buffer. A small buffer gives you more control, but it needs more frequent updates, no cap.buffer_sizespecifies size in bytes, whilebuffer_durationspecifies duration in milliseconds. When both options are provided, the highest value is used (duration is recalculated to bytes using stream parameters). If they're set to0(which is the default), the device will use the default PulseAudio duration value. By default PulseAudio sets buffer duration to around 2 seconds.prebufβ specify pre-buffering size in bytes. The server does not start playback before at leastprebufbytes are available in the buffer. By default this option is initialized to the same value asbuffer_sizeorbuffer_duration(whichever is bigger).minreqβ specify minimum request size in bytes. The server won't request less thanminreqbytes from the client β instead it waits until the buffer is free enough to request more bytes at once. > It's recommended to not set this option, which will initialize it to a value that the server deems sensible. Let the server cook π₯
β¨ Examples β¨
Play a file on the default device on the default server:
ffmpeg -i INPUT -f pulse "stream name"
π¦ sndio π¦
The sndio audio output device. Iconic, brief, done. β¨
π v4l2 π
The Video4Linux2 output device. That's the whole vibe π
π xv π
The XV (XVideo) output device.
This output device lets you show a video stream in an X Window System window. Slay.
β¨ Options β¨
display_nameβ specify the hardware display name, which determines the display and communications domain to be used. The display name orDISPLAYenvironment variable can be a string in the formathostname[:number[.screen_number]].hostnamespecifies the name of the host machine the display is physically attached to.numberspecifies the number of the display server on that host machine.screen_numberspecifies the screen to be used on that server. If unspecified, it defaults to the value of theDISPLAYenvironment variable. For example,"dual-headed:0.1"would specify screen 1 of display 0 on the machine named ``dual-headed''. Check the X11 specification for more detailed info about the display name format, iykyk.window_idβ when set to a non-zero value, the device doesn't create a new window but uses the existing one with the providedwindow_id. By default this option is set to0and the device creates its own window.window_sizeβ set the created window size. Can be a string of the formwidthxheightor a video size abbreviation. If not specified it defaults to the size of the input video. Ignored whenwindow_idis set.window_x,window_yβ set the X and Y window offsets for the created window. Both are set to0by default. The values may be ignored by the window manager π Ignored whenwindow_idis set.window_titleβ set the window title. If not specified, defaults to the filename specified for the output device. Ignored whenwindow_idis set.
For more information about XVideo see http://www.x.org/.
β¨ Examples β¨
- Decode, display and encode video input with
ffmpegat the same time:
ffmpeg -i INPUT OUTPUT -f xv display
- Decode and display the input video to multiple X11 windows:
ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
π SEE ALSO π
ffmpeg(1), ffplay(1), ffprobe(1), libavdevice(3)
πΈ AUTHORS πΈ
The FFmpeg developers. π
For details about the authorship, see the Git history of the project (https://git.ffmpeg.org/ffmpeg) β e.g. by typing the command git log in the FFmpeg source directory, or browsing the online repository at https://git.ffmpeg.org/ffmpeg.
Maintainers for the specific components are listed in the file MAINTAINERS in the source code tree.
okay bestie that's the whole entire page, we ate and left no crumbs π β¨ the footer's got the source/version and date on it β go check it, mwah π«Άπ
π¦ where this page comes from
- alpine 3.24: ffmpeg-doc 8.1.3-r0 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- nixos 26.05: ffmpeg 8.1.3
- nixos 26.05: ffmpeg-full 8.1.3
- nixos 26.05: ffmpeg-headless 8.1.3
- nixpkgs unstable: ffmpeg 9.0.2
- nixpkgs unstable: ffmpeg-full 9.0.2
- nixpkgs unstable: ffmpeg-headless 9.0.2
- nixpkgs unstable: jellyfin-ffmpeg 8.1.3-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms