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 is 48000.
  • channels β€” Set the number of channels. Default is 2.

🌈 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 as 640x480 or hd720. 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 is 0.
  • input_queue_size β€” Set the maximum number of frames to buffer. Default is 5.

πŸ’– 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 is ntsc, corresponding to a frame rate of 30000/1001. πŸŽ€
  • -video_size β€” Set the video frame size.
  • -capture_cursor β€” Capture the mouse pointer. Default is 0.
  • -capture_mouse_clicks β€” Capture the screen mouse clicks. Default is 0.
  • -capture_raw_data β€” Capture the raw device data. Default is 0. 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 0 and audio from audio device 0 into out.avi:
$ ffmpeg -f avfoundation -i "0:0" out.avi
  • Record video from video device 2 and audio from audio device 1 into out.avi:
$ ffmpeg -f avfoundation -video_device_index 2 -i ":1" out.avi
  • Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.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

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 -sources option of ffmpeg to list the available input devices. > ⚠️ deprecated bestie, use -sources instead.
  • 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) use list_formats. Note that there is a FourCC 'pal ' that can also be used as pal (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 special all constant to select all possible lines, or standard to skip lines 6, 318 and 319, which are not compatible with all receivers. For SD sources, ffmpeg needs 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 be 2, 8 or 16. Defaults to 2.
  • duplex_mode β€” Sets the decklink device duplex/profile mode. Must be unset, half, full, one_sub_device_full, one_sub_device_half, two_sub_device_full, four_sub_device_half Defaults to unset. 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 of none, rp188vitc, rp188vitc2, rp188ltc, rp188hfr, rp188any, vitc, vitc2, or serial. Defaults to none (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 be unset, sdi, hdmi, optical_sdi, component, composite or s_video. Defaults to unset.
  • audio_input β€” sets the audio input source. Must be unset, embedded, aes_ebu, analog, analog_xlr, analog_rca or microphone. Defaults to unset.
  • video_pts β€” sets the video packet timestamp source. Must be video, audio, reference, wallclock or abs_wallclock. Defaults to video.
  • audio_pts β€” sets the audio packet timestamp source. Must be video, audio, reference, wallclock or abs_wallclock. Defaults to audio.
  • draw_bars β€” if set to true, color bars are drawn in the event of a signal loss. Defaults to true. > Heads up bestie: this option is deprecated, please use the signal_loss_action option instead 🫢
  • signal_loss_action β€” sets the action to take in the event of a signal loss. Accepts one of the following values:
    1. none β€” do nothing on signal loss. This usually results in black frames.
    2. bars β€” draw color bars on signal loss. Only supported for 8-bit input signals.
    3. 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 to 1073741824.
  • audio_depth β€” sets the audio sample bit depth. Must be 16 or 32. Defaults to 16.
  • decklink_copyts β€” if set to true, timestamps are forwarded as they are without removing the initial offset. Defaults to false.
  • 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 case timestamp_align seconds. Defaults to 0 😭
  • 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 to true, input frames are dropped till a frame with timecode is received. timecode_format option must be specified. Defaults to false.
  • enable_klv(bool) β€” if set to true, 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 to false.

✨ 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 to true, print a list of devices and exit.
  • list_options β€” if set to true, print a list of selected device's options and exit.
  • video_device_number β€” set video device number for devices with the same name (starts at 0, defaults to 0).
  • audio_device_number β€” set audio device number for devices with the same name (starts at 0, defaults to 0).
  • pixel_format β€” select pixel format to be used by DirectShow. This may only be set when the video codec is not set or set to rawvideo.
  • 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 to true, 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 to true, 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 to true, 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 to true, 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 to true, 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 to true, 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 to false, 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 is 25.

πŸͺŸ 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 value 0 to not draw the pointer. Default value is 1.
  • 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 if desktop is selected, or the full window size if title=window_title is selected.
  • offset_x β€” when you're capturing a region with video_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 with video_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 values auto, dv and hdv are 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/devices to 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 100000 packets 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 is 2.

πŸ‘‘ 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 Linux 5.7 or later, but needs to be provided for earlier versions. Defaults to bgr0, 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 Linux 5.7 or later, but will need to be provided explicitly when needed in earlier versions. See the libdrm documentation 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 neither crtc_id nor plane_id are 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 to 30.

πŸ’– 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 42 at 60fps, 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 1920x1080 plane:
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", where N is a number starting from 0 corresponding 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 option graph.
  • dumpgraph β€” Dump graph to stderr.

🌸 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 out0 label:
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 amovie source and play it back with ffplay:
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 is 0. The speed is specified CD-ROM speed units. The speed is set through the libcdio cdio_cddap_speed_set function. 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 is disable. 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 is ntsc, corresponding to a frame rate of 30000/1001.
  • pixel_format β€” Select the pixel format. Default is uyvy422.
  • video_size β€” Set the video size given as a string such as 640x480 or hd720. Default is qvga.

πŸ”Š 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:

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 values 1 (monaural) and 2 (stereo) are currently supported. Defaults to 2.
  • sample_size β€” Set the sample size (in bits) of the captured audio. Only the values 8 and 16 are currently supported. Defaults to 16.
  • sample_rate β€” Set the sample rate (in Hz) of the captured audio. Defaults to 44.1k.
  • list_devices β€” If set to true, print a list of devices and exit. Defaults to false.

🌸 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 is 48000.
  • channels β€” Set the number of channels. Default is 2.

πŸ’œ 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 the LIBAVFORMAT_IDENT string.
  • stream_name β€” Specify the stream name PulseAudio will use when showing active streams, by default it is record.
  • 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 is 1.

🌸 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 is 48000.
  • channels β€” Set the number of channels. Default is 2.

πŸŽ₯ 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 the list_standards option.
  • 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 like WIDTHxHEIGHT or 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 formats
  • compressed β€” 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 kernel
  • abs β€” 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 is 0. 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 of 1 prompts 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 the video_size, grab_x, and grab_y options β€” so yeah, she has main character energy and takes over πŸ’€ default value is 0.
  • draw_mouse β€” specify whether to draw the mouse pointer. a value of 0 means don't draw the pointer. default value is 1 🐭
  • 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 1 is used. range is 1 to 128 and default is 3 (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 is 0, 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 the x_offset and y_offset parameters in the device name. the default value for both options is 0 πŸ“

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 form widthxheight or 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 -

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 to false. > Heads up: this option is deprecated β€” please use the -sinks option of ffmpeg to list the available output devices instead, okurrr?
  • list_formats β€” set it to true and it prints a list of supported formats and exits. Defaults to false.
  • preroll β€” how much time to preroll video, in seconds. Defaults to 0.5.
  • duplex_mode β€” sets the decklink device duplex/profile mode. Must be unset, half, full, one_sub_device_full, one_sub_device_half, two_sub_device_full, four_sub_device_half. Defaults to unset.
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 to unset.
  • link β€” sets the SDI video link configuration on the used output. Must be unset, single link SDI, dual link SDI or quad link SDI. Defaults to unset.
  • sqd β€” enable Square Division Quad Split mode for Quad-link SDI output. Must be unset, true or false. Defaults to unset.
  • level_a β€” enable SMPTE Level A mode on the used output. Must be unset, true or false. Defaults to unset.
  • 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 to 1048576.

✨ 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 is 0.

✨ 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 the LIBAVFORMAT_IDENT string.
  • 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 command pactl 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_size specifies size in bytes, while buffer_duration specifies 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 to 0 (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 least prebuf bytes are available in the buffer. By default this option is initialized to the same value as buffer_size or buffer_duration (whichever is bigger).
  • minreq β€” specify minimum request size in bytes. The server won't request less than minreq bytes 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 or DISPLAY environment variable can be a string in the format hostname[:number[.screen_number]]. hostname specifies the name of the host machine the display is physically attached to. number specifies the number of the display server on that host machine. screen_number specifies the screen to be used on that server. If unspecified, it defaults to the value of the DISPLAY environment 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 provided window_id. By default this option is set to 0 and the device creates its own window.
  • window_size β€” set the created window size. Can be a string of the form widthxheight or a video size abbreviation. If not specified it defaults to the size of the input video. Ignored when window_id is set.
  • window_x, window_y β€” set the X and Y window offsets for the created window. Both are set to 0 by default. The values may be ignored by the window manager πŸ™ˆ Ignored when window_id is set.
  • window_title β€” set the window title. If not specified, defaults to the filename specified for the output device. Ignored when window_id is set.

For more information about XVideo see http://www.x.org/.

✨ Examples ✨

  • Decode, display and encode video input with ffmpeg at 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