FFPLAY(1)

๐ŸŒธ FFplay โ€” the manual page, but make it cute ๐ŸŒธ

okay so this is FFPLAY(1), the manual page for ffplay, and bestie you're gonna love it. sit down, grab a strawberry drink ๐Ÿ“, and let's get into it.


โœจ SYNOPSIS โœจ

ffplay [options] [input_url]

literally that's it. options first, then the url. slay.


๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

FFplay is a very simple and portable media player that runs on the FFmpeg libraries and the SDL library. no cap.

and likeโ€ฆ what's its whole deal? it's mostly used as a testbed for the various FFmpeg APIs. so it's the main character of API testing, basically ๐Ÿ‘‘ it's not trying to be VLC, it's trying to be a vibe check for the libraries. and honestly? iconic.


๐ŸŽ€ OPTIONS ๐ŸŽ€

okay so first, ground rules for the numbers, because this applies everywhere:

  • All the numerical options โ€” unless the page says otherwise โ€” accept a string representing a number as input, and that number may be followed by one of the SI unit prefixes, like 'K', 'M', or 'G'.
  • If you slap an 'i' on the end of the SI unit prefix, the complete prefix gets interpreted as a unit prefix for binary multiples, which are based on powers of 1024 instead of powers of 1000. math girlie hours ๐Ÿงฎ
  • Appending 'B' to the SI unit prefix multiplies the value by 8. so you can use, for example: 'KB', 'MiB', 'G' and 'B' as number suffixes. yes really, that's a whole thing.

then there's boolean options:

  • Options that don't take arguments are boolean options, and they set the corresponding value to true.
  • You can set them to false by prefixing the option name with "no". for example, using -nofoo will set the boolean option with name "foo" to false. cute, right? ๐Ÿซถ

and here's a fun one โ€” options that do take arguments support a special syntax where the argument you gave on the command line gets interpreted as a path to the file from which the actual argument value is loaded. to use this feature, add a forward slash '/' immediately before the option name (after the leading dash). like so:

ffmpeg -i INPUT -/filter:v filter.script OUTPUT

that will load a filtergraph description from the file named filter.script. no cap, that's the whole trick ๐Ÿ’…

๐ŸŒˆ Stream specifiers ๐ŸŒˆ

some options are applied per-stream โ€” think bitrate or codec. stream specifiers are how you precisely specify which stream(s) a given option belongs to. so instead of guessing, you get to point at exactly the stream you mean. obsessed.

A stream specifier is a string that's generally appended to the option name and separated from it by a colon. e.g. -codec:a:1 ac3 contains the "a:1" stream specifier, which matches the second audio stream. so it would select the ac3 codec for the second audio stream. see how that works? ๐ŸŽฏ

A stream specifier can match several streams, so the option gets applied to all of them. e.g. the stream specifier in -b:a 128k matches all audio streams. one little specifier, so much power.

An empty stream specifier matches all streams. for example, -codec copy or -codec: copy would copy all the streams without reencoding. okay short king behavior.

Possible forms of stream specifiers are:

  • stream_index โ€” matches the stream with this index. e.g. -threads:1 4 would set the thread count for the second stream to 4. If stream_index is used as an additional stream specifier (see below), then it selects stream number stream_index from the matching streams. Stream numbering is based on the order of the streams as detected by libavformat, except when a stream group specifier or program ID is also specified โ€” in that case it's based on the ordering of the streams in the group or program. nuance!! โœจ
  • stream_type[:additional_stream_specifier] โ€” stream_type is one of the following: 'v' or 'V' for video, 'a' for audio, 's' for subtitle, 'd' for data, and 't' for attachments. 'v' matches all video streams, while 'V' only matches video streams which are not attached pictures, video thumbnails or cover arts. If additional_stream_specifier is used, then it matches streams which both have this type and match the additional_stream_specifier. Otherwise, it matches all streams of the specified type.
  • g:group_specifier[:additional_stream_specifier] โ€” matches streams which are in the group with the specifier group_specifier. if additional_stream_specifier is used, then it matches streams which both are part of the group and match the additional_stream_specifier. group_specifier may be one of the following:
    • group_index โ€” match the stream with this group index.
    • #group_id or i:group_id โ€” match the stream with this group id.
  • p:program_id[:additional_stream_specifier] โ€” matches streams which are in the program with the id program_id. If additional_stream_specifier is used, then it matches streams which both are part of the program and match the additional_stream_specifier.
  • #stream_id or i:stream_id โ€” match the stream by stream id (e.g. PID in MPEG-TS container). iykyk ๐Ÿฆ‹
  • m:key[:value] โ€” matches streams with the metadata tag key having the specified value. If value is not given, matches streams that contain the given tag with any value. heads up: the colon character ':' in key or value needs to be backslash-escaped. don't forget, or it's giving chaos ๐Ÿ˜ญ
  • disp:dispositions[:additional_stream_specifier] โ€” matches streams with the given disposition(s). dispositions is a list of one or more dispositions (as printed by the -dispositions option) joined with '+'.
  • u โ€” matches streams with usable configuration: the codec must be defined, and the essential information such as video dimension or audio sample rate must be present.
note note note ๐Ÿ“Œ โ€” in ffmpeg, matching by metadata will only work properly for input files.

๐Ÿ’– Generic options ๐Ÿ’–

these options are shared amongst the ff* tools. group project energy, but like, the good kind.

  • -L, -license โ€” show license.
  • -h, -?, -help, --help [arg] โ€” show help. An optional parameter may be specified to print help about a specific item. If no argument is specified, only basic (non advanced) tool options are shown. Possible values of arg are:
    • long โ€” print advanced tool options in addition to the basic tool options.
    • full โ€” print the complete list of options, including shared and private options for encoders, decoders, demuxers, muxers, filters, etc. the whole buffet ๐Ÿ“
    • decoder=decoder_name โ€” print detailed information about the decoder named decoder_name. Use the -decoders option to get a list of all decoders.
    • encoder=encoder_name โ€” print detailed information about the encoder named encoder_name. Use the -encoders option to get a list of all encoders.
    • demuxer=demuxer_name โ€” print detailed information about the demuxer named demuxer_name. Use the -formats option to get a list of all demuxers and muxers.
    • muxer=muxer_name โ€” print detailed information about the muxer named muxer_name. Use the -formats option to get a list of all muxers and demuxers.
    • filter=filter_name โ€” print detailed information about the filter named filter_name. Use the -filters option to get a list of all filters.
    • bsf=bitstream_filter_name โ€” print detailed information about the bitstream filter named bitstream_filter_name. Use the -bsfs option to get a list of all bitstream filters.
    • protocol=protocol_name โ€” print detailed information about the protocol named protocol_name. Use the -protocols option to get a list of all protocols.
  • -version โ€” show version.
  • -buildconf โ€” show the build configuration, one option per line.
  • -formats โ€” show available formats (including devices).
  • -demuxers โ€” show available demuxers.
  • -muxers โ€” show available muxers.
  • -devices โ€” show available devices.
  • -codecs โ€” show all codecs known to libavcodec.
little note ๐ŸŽ€ โ€” the term 'codec' is used throughout this documentation as a shortcut for what is more correctly called a media bitstream format.
  • -decoders โ€” show available decoders.
  • -encoders โ€” show all available encoders.
  • -bsfs โ€” show available bitstream filters.
  • -protocols โ€” show available protocols.
  • -filters โ€” show available libavfilter filters.
  • -pix_fmts โ€” show available pixel formats.
  • -sample_fmts โ€” show available sample formats.
  • -layouts โ€” show channel names and standard channel layouts.
  • -dispositions โ€” show stream dispositions.
  • -colors โ€” show recognized color names.
  • -sources device[,opt1=val1[,opt2=val2]...] โ€” show autodetected sources of the input device. Some devices may provide system-dependent source names that cannot be autodetected. The returned list cannot be assumed to be always complete. ๐Ÿ™ˆ
ffmpeg -sources pulse,server=192.168.0.4
  • -sinks device[,opt1=val1[,opt2=val2]...] โ€” show autodetected sinks of the output device. Some devices may provide system-dependent sink names that cannot be autodetected. The returned list cannot be assumed to be always complete.
ffmpeg -sinks pulse,server=192.168.0.4
  • -loglevel [flags+]loglevel, -v [flags+]loglevel โ€” set logging level and flags used by the library. The optional flags prefix can consist of the following values:
    • repeat โ€” indicates that repeated log output should not be compressed to the first line, and the "Last message repeated n times" line will be omitted.
    • level โ€” indicates that log output should add a "[level]" prefix to each message line. This can be used as an alternative to log coloring, e.g. when dumping the log to file.
    • time โ€” indicates that log lines should be prefixed with time information.
    • datetime โ€” indicates that log lines should be prefixed with date and time information.

Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single flag without affecting other flags or changing loglevel. When setting both flags and loglevel, a '+' separator is expected between the last flags value and before loglevel.

loglevel is a string or a number containing one of the following values:

  • quiet, -8 โ€” show nothing at all; be silent. ๐Ÿคซ
  • panic, 0 โ€” only show fatal errors which could lead the process to crash, such as an assertion failure. This is not currently used for anything.
  • fatal, 8 โ€” only show fatal errors. These are errors after which the process absolutely cannot continue.
  • error, 16 โ€” show all errors, including ones which can be recovered from.
  • warning, 24 โ€” show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown.
  • info, 32 โ€” show informative messages during processing. This is in addition to warnings and errors. This is the default value. โญ
  • verbose, 40 โ€” same as "info", except more verbose. it's giving chatty ๐Ÿ’…
  • debug, 48 โ€” show everything, including debugging information.
  • trace, 56 โ€” that's the level, bestie, it's just 56.

For example, to enable repeated log output, add the "level" prefix, and set loglevel to "verbose":

ffmpeg -loglevel repeat+level+verbose -i input output

bestie we're not done yet โ€” there's more page coming ๐ŸŒˆโœจ

Like, another example, bestie โ€” this one enables repeated log output without touching the current state of the level prefix flag or the loglevel:

ffmpeg [...] -loglevel +repeat

So by default the program logs to stderr. If your terminal supports coloring, colors get used to mark errors and warnings. Wanna kill the color? Set the environment variable AV_LOG_FORCE_NOCOLOR. Wanna force it on? Set the environment variable AV_LOG_FORCE_COLOR. Easy ๐Ÿ’…

  • -report โ€” dumps the full command line and the log output into a file named program-YYYYMMDD-HHMMSS.log in the current directory. Super useful for bug reports, fr. It also implies -loglevel debug.

Setting the environment variable FFREPORT to any value has the same effect. And if that value is a :-separated key=value sequence, those options will affect the report โ€” but heads up: option values must be escaped if they contain special characters or the options delimiter : (peep the "Quoting and escaping" section in the ffmpeg-utils manual, iykyk).

The following options are recognized:

  • file โ€” set the file name to use for the report. %p is expanded to the name of the program, %t is expanded to a timestamp, and %% is expanded to a plain %.
  • level โ€” set the log verbosity level using a numerical value (see -loglevel).

So like, to output a report to a file named ffreport.log using a log level of 32 (which is an alias for log level info):

FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output

Errors in parsing the environment variable are not fatal, and they won't show up in the report either. No drama ๐Ÿซถ

  • -hide_banner โ€” suppresses printing the banner. All FFmpeg tools normally show a copyright notice, build options and library versions, and this option lets you shut all that up. Iconic for clean output โœจ
  • -cpuflags flags (global) โ€” lets you set and clear cpu flags. This option is intended for testing. Do not use it unless you know what you're doing, seriously ๐Ÿ’€
ffmpeg -cpuflags -sse+mmx ...
ffmpeg -cpuflags mmx ...
ffmpeg -cpuflags 0 ...

Possible flags for this option are:

  • x86
    • mmx
    • mmxext
    • sse
    • sse2
    • sse2slow
    • sse3
    • sse3slow
    • ssse3
    • atom
    • sse4.1
    • sse4.2
    • avx
    • avx2
    • xop
    • fma3
    • fma4
    • 3dnow
    • 3dnowext
    • bmi1
    • bmi2
    • cmov
  • ARM
    • armv5te
    • armv6
    • armv6t2
    • vfp
    • vfpv3
    • neon
    • setend
  • AArch64
    • armv8
    • vfp
    • neon
  • PowerPC
    • altivec
  • Specific Processors
    • pentium2
    • pentium3
    • pentium4
    • k6
    • k62
    • athlon
    • athlonxp
    • k8
  • -cpucount count (global) โ€” overrides detection of CPU count. Again, this option is intended for testing. Do not use it unless you know what you're doing ๐Ÿ™ˆ
ffmpeg -cpucount 2
  • -max_alloc bytes โ€” sets the maximum size limit for allocating a block on the heap by ffmpeg's family of malloc functions. Exercise extreme caution when using this option. Don't use it if you don't understand the full consequence of doing so, bestie, I'm begging ๐Ÿ˜ญ Default is INT_MAX.

๐ŸŒˆ AVOptions ๐ŸŒˆ

These options are provided directly by the libavformat, libavdevice and libavcodec libraries. To see the list of available AVOptions, use the -help option. They're split into two categories:

  • generic โ€” these options can be set for any container, codec or device. Generic options are listed under AVFormatContext options for containers/devices and under AVCodecContext options for codecs.
  • private โ€” these options are specific to the given container, device or codec. Private options are listed under their corresponding containers/devices/codecs.

For example, to write an ID3v2.3 header instead of a default ID3v2.4 to an MP3 file, use the id3v2_version private option of the MP3 muxer:

ffmpeg -i input.flac -id3v2_version 3 out.mp3

All codec AVOptions are per-stream, so a stream specifier should be attached to them:

ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4

In the example above, a multichannel audio stream is mapped twice for output. The first instance is encoded with codec ac3 and bitrate 640k. The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using the absolute index of the output stream. See how that works? Chef's kiss ๐Ÿ‘‘

Note: the -nooption syntax cannot be used for boolean AVOptions โ€” use -option 0/-option 1 instead. No cap.
Note: the old undocumented way of specifying per-stream AVOptions by prepending v/a/s to the options name is now obsolete and will be removed soon. It's giving deprecated, bestie, don't get attached ๐Ÿ’€

๐Ÿ’– Main options ๐Ÿ’–

  • -x width โ€” force displayed width.
  • -y height โ€” force displayed height.
  • -fs โ€” start in fullscreen mode.
  • -an โ€” disable audio.
  • -vn โ€” disable video.
  • -sn โ€” disable subtitles.
  • -ss pos โ€” seek to pos. Note that in most formats it's not possible to seek exactly, so ffplay will seek to the nearest seek point to pos. pos must be a time duration specification โ€” see the Time duration section in the ffmpeg-utils(1) manual ๐ŸŒธ
  • -t duration โ€” play duration seconds of audio/video. duration must be a time duration specification, see the Time duration section in the ffmpeg-utils(1) manual.
  • -bytes โ€” seek by bytes.
  • -seek_interval โ€” set a custom interval, in seconds, for seeking using the left/right keys. Default is 10 seconds.
  • -nodisp โ€” disable graphical display.
  • -noborder โ€” borderless window.
  • -alwaysontop โ€” window always on top. Available on: X11 with SDL >= 2.0.5, Windows SDL >= 2.0.6.
  • -volume โ€” set the startup volume. 0 means silence, 100 means no volume reduction or amplification. Negative values are treated as 0, values above 100 are treated as 100.
  • -f fmt โ€” force format.
  • -window_title title โ€” set window title (default is the input filename).
  • -left title โ€” set the x position for the left of the window (default is a centered window).
  • -top title โ€” set the y position for the top of the window (default is a centered window).
  • -loop number โ€” loops movie playback <number> times. 0 means forever โ™พ๏ธ
  • -showmode mode โ€” set the show mode to use. Available values for mode are:
    • 0, video โ€” show video
    • 1, waves โ€” show audio waves
    • 2, rdft โ€” show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)

Default value is video, and if video is not present or can't be played, rdft is automatically selected. You can interactively cycle through the available show modes by pressing the key w ๐Ÿฆ‹

  • -vf filtergraph โ€” create the filtergraph specified by filtergraph and use it to filter the video stream. filtergraph is a description of the filtergraph to apply to the stream, and it must have a single video input and a single video output. In the filtergraph, the input is associated to the label in, and the output to the label out. See the ffmpeg-filters manual for more info about the filtergraph syntax. You can specify this parameter multiple times and cycle through the specified filtergraphs along with the show modes by pressing the key w โœจ
  • -af filtergraph โ€” filtergraph is a description of the filtergraph to apply to the input audio. Use the option -filters to show all the available filters (including sources and sinks).
  • -i input_url โ€” read input_url.

๐Ÿš€ Advanced options ๐Ÿš€

  • -stats โ€” print several playback statistics, in particular show the stream duration, the codec parameters, the current position in the stream and the audio/video synchronisation drift. It's shown by default, unless the log level is lower than info. Its display can be forced by manually specifying this option. To disable it, you need to specify -nostats.
  • -fast โ€” non-spec-compliant optimizations.
  • -genpts โ€” generate pts.
  • -sync type โ€” set the master clock to audio (type=audio), video (type=video) or external (type=ext). Default is audio. The master clock is used to control audio-video synchronization. Most media players use audio as master clock, but in some cases (streaming or high quality broadcast) it's necessary to change that. This option is mainly used for debugging purposes ๐Ÿซถ
  • -ast audio_stream_specifier โ€” select the desired audio stream using the given stream specifier. The stream specifiers are described in the Stream specifiers chapter. If this option is not specified, the "best" audio stream is selected in the program of the already selected video stream.
  • -vst video_stream_specifier โ€” select the desired video stream using the given stream specifier. The stream specifiers are described in the Stream specifiers chapter. If this option is not specified, the "best" video stream is selected.
  • -sst subtitle_stream_specifier โ€” select the desired subtitle stream using the given stream specifier. The stream specifiers are described in the Stream specifiers chapter. If this option is not specified, the "best" subtitle stream is selected in the program of the already selected video or audio stream.
  • -autoexit โ€” exit when video is done playing.
  • -exitonkeydown โ€” exit if any key is pressed.
  • -exitonmousedown โ€” exit if any mouse button is pressed.
  • -codec:media_specifier codec_name โ€” force a specific decoder implementation for the stream identified by media_specifier, which can assume the values a (audio), v (video), and s subtitle.
  • -acodec codec_name โ€” force a specific audio decoder.
  • -vcodec codec_name โ€” force a specific video decoder.
  • -scodec codec_name โ€” force a specific subtitle decoder.
  • -autorotate โ€” automatically rotate the video according to file metadata. Enabled by default, so use -noautorotate to disable it ๐Ÿ’…
  • -framedrop โ€” drops video frames when the video is out of sync ๐Ÿ”ฅ ngl this one's already on by default whenever the master clock isn't set to video. Wanna turn on frame dropping for all master clock sources? That's literally what this flag is for, bestie. And if you'd rather it never drop frames, -noframedrop is your girl ๐Ÿ’…
  • -infbuf โ€” tells ffplay to not limit the input buffer size, so it reads as much data as possible from the input as fast as possible ๐Ÿƒโ€โ™€๏ธ๐Ÿ’จ it's enabled by default for realtime streams, where data can straight up get dropped if it isn't read in time ๐Ÿ˜ญ. Want infinite buffers on everything? this option. Want it off? -noinfbuf.
  • -filter_threads nb_threads โ€” sets how many threads get used to process a filter pipeline ๐Ÿงต each pipeline makes its own thread pool with this many threads ready for parallel processing. default is 0, which means the thread count gets figured out from how many CPUs you have available โœจ
  • -enable_vulkan โ€” use the vulkan renderer instead of the SDL builtin renderer ๐Ÿฆ‹ this one depends on libplacebo (iykyk).
  • -vulkan_params โ€” vulkan configuration, given as a list of key=value pairs separated by ":" ๐Ÿ’œ
  • -hwaccel โ€” use HW accelerated decoding โšก enabling this option will automatically enable the vulkan renderer, no cap.
  • -video_bg pattern โ€” sets the video background pattern used for transparent videos ๐ŸŽ€ for solid color patterns you can use the color name or color code as specified in the Color section in the ffmpeg-utils(1) manual. you can also use the special "tiles" keyword for a checker board style pattern โ€” and fun fact, that's the default too ๐ŸŒˆ the "none" pattern does rendering without alpha blending, effectively ignoring the alpha channel entirely ๐Ÿซถ

โœจ While playing โœจ

okay so this is the part where you're actually watching something and you just wanna vibe with the keyboard ๐Ÿ‘‘

  • q, ESC โ€” quit ๐Ÿ’จ
  • f โ€” toggle full screen ๐Ÿ–ฅ๏ธโœจ
  • p, SPC โ€” pause โธ๏ธ
  • m โ€” toggle mute ๐Ÿ”‡
  • 9, 0
  • /, * โ€” decrease and increase volume respectively ๐Ÿ”Š (yes both pairs do it, pick your fave)
  • a โ€” cycle audio channel in the current program ๐ŸŽง
  • v โ€” cycle video channel ๐Ÿ“บ
  • t โ€” cycle subtitle channel in the current program ๐Ÿ’ฌ
  • c โ€” cycle program ๐Ÿ”„
  • w โ€” cycle video filters or show modes ๐ŸŽจ
  • s โ€” step to the next frame ๐Ÿฆ‹ it pauses if the stream isn't already paused, steps to the next video frame, and pauses. iconic behaviour honestly.
  • left/right โ€” seek backward/forward by 10 seconds, or by a custom interval if -seek_interval is set โชโฉ
  • down/up โ€” seek backward/forward 1 minute โฑ๏ธ
  • page down/page up โ€” seek to the previous/next chapter, or backward/forward 10 minutes if there are no chapters ๐Ÿ“–
  • right mouse click ๐Ÿ–ฑ๏ธ โ€” seek to a percentage in the file corresponding to the fraction of the width you clicked on ๐ŸŽฏ
  • left mouse double-click ๐Ÿ–ฑ๏ธ๐Ÿ–ฑ๏ธ โ€” toggle full screen ๐Ÿ’–

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

ffplay-all(1), ffmpeg(1), ffprobe(1), ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1), ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1), ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1)

like, the whole squad fr fr ๐Ÿซถ

๐Ÿ‘‘ 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. ๐Ÿ“โœจ


and that's a wrap on the whole page, bestie ๐ŸŽ€ this was the FFPLAY(1) page โ€” go be a main character and play some media ๐Ÿ’…๐Ÿ’–

๐Ÿ“ฆ where this page comes from