=encoding utf8 =head1 NAME ffplay - FFplay media player =head1 SYNOPSIS ffplay [I] [F] =head1 DESCRIPTION FFplay is a very simple and portable media player using the FFmpeg libraries and the SDL library. It is mostly used as a testbed for the various FFmpeg APIs. =head1 OPTIONS All the numerical options, if not specified otherwise, accept a string representing a number as input, which may be followed by one of the SI unit prefixes, for example: 'K', 'M', or 'G'. If 'i' is appended to the SI unit prefix, the complete prefix will be interpreted as a unit prefix for binary multiples, which are based on powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit prefix multiplies the value by 8. This allows using, for example: 'KB', 'MiB', 'G' and 'B' as number suffixes. Options which do not take arguments are boolean options, and set the corresponding value to true. They can be set to false by prefixing the option name with "no". For example using "-nofoo" will set the boolean option with name "foo" to false. Options that take arguments support a special syntax where the argument given on the command line is 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). E.g. ffmpeg -i INPUT -/filter:v filter.script OUTPUT will load a filtergraph description from the file named F. =head2 Stream specifiers Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers are used to precisely specify which stream(s) a given option belongs to. A stream specifier is a string generally appended to the option name and separated from it by a colon. E.g. C<-codec:a:1 ac3> contains the C stream specifier, which matches the second audio stream. Therefore, it would select the ac3 codec for the second audio stream. A stream specifier can match several streams, so that the option is applied to all of them. E.g. the stream specifier in C<-b:a 128k> matches all audio streams. An empty stream specifier matches all streams. For example, C<-codec copy> or C<-codec: copy> would copy all the streams without reencoding. Possible forms of stream specifiers are: =over 4 =item I Matches the stream with this index. E.g. C<-threads:1 4> would set the thread count for the second stream to 4. If I is used as an additional stream specifier (see below), then it selects stream number I 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 this case it is based on the ordering of the streams in the group or program. =item IB<[:>IB<]> I is one of following: 'v' or 'V' for video, 'a' for audio, 's' for subtitle, 'd' for data, and 't' for attachments. 'v' matches all video streams, 'V' only matches video streams which are not attached pictures, video thumbnails or cover arts. If I is used, then it matches streams which both have this type and match the I. Otherwise, it matches all streams of the specified type. =item BIB<[:>IB<]> Matches streams which are in the group with the specifier I. if I is used, then it matches streams which both are part of the group and match the I. I may be one of the following: =over 4 =item I Match the stream with this group index. =item B<#>I BI Match the stream with this group id. =back =item BIB<[:>IB<]> Matches streams which are in the program with the id I. If I is used, then it matches streams which both are part of the program and match the I. =item B<#>I BI Match the stream by stream id (e.g. PID in MPEG-TS container). =item BIB<[:>IB<]> Matches streams with the metadata tag I having the specified value. If I is not given, matches streams that contain the given tag with any value. =item BIB<[:>IB<]> Matches streams with the given disposition(s). I is a list of one or more dispositions (as printed by the B<-dispositions> option) joined with '+'. =item B 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 that in B, matching by metadata will only work properly for input files. =back =head2 Generic options These options are shared amongst the ff* tools. =over 4 =item B<-L> Show license. =item B<-h, -?, -help, --help [>IB<]> 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 I are: =over 4 =item B Print advanced tool options in addition to the basic tool options. =item B Print complete list of options, including shared and private options for encoders, decoders, demuxers, muxers, filters, etc. =item BI Print detailed information about the decoder named I. Use the B<-decoders> option to get a list of all decoders. =item BI Print detailed information about the encoder named I. Use the B<-encoders> option to get a list of all encoders. =item BI Print detailed information about the demuxer named I. Use the B<-formats> option to get a list of all demuxers and muxers. =item BI Print detailed information about the muxer named I. Use the B<-formats> option to get a list of all muxers and demuxers. =item BI Print detailed information about the filter named I. Use the B<-filters> option to get a list of all filters. =item BI Print detailed information about the bitstream filter named I. Use the B<-bsfs> option to get a list of all bitstream filters. =item BI Print detailed information about the protocol named I. Use the B<-protocols> option to get a list of all protocols. =back =item B<-version> Show version. =item B<-buildconf> Show the build configuration, one option per line. =item B<-formats> Show available formats (including devices). =item B<-demuxers> Show available demuxers. =item B<-muxers> Show available muxers. =item B<-devices> Show available devices. =item B<-codecs> Show all codecs known to libavcodec. Note that the term 'codec' is used throughout this documentation as a shortcut for what is more correctly called a media bitstream format. =item B<-decoders> Show available decoders. =item B<-encoders> Show all available encoders. =item B<-bsfs> Show available bitstream filters. =item B<-protocols> Show available protocols. =item B<-filters> Show available libavfilter filters. =item B<-pix_fmts> Show available pixel formats. =item B<-sample_fmts> Show available sample formats. =item B<-layouts> Show channel names and standard channel layouts. =item B<-dispositions> Show stream dispositions. =item B<-colors> Show recognized color names. =item B<-sources> IB<[,>IB<=>IB<[,>IB<=>IB<]...]> 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 =item B<-sinks> IB<[,>IB<=>IB<[,>IB<=>IB<]...]> 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 =item B<-loglevel [>IB<+]>I B<| -v [>IB<+]>I Set logging level and flags used by the library. The optional I prefix can consist of the following values: =over 4 =item B Indicates that repeated log output should not be compressed to the first line and the "Last message repeated n times" line will be omitted. =item B Indicates that log output should add a C<[level]> prefix to each message line. This can be used as an alternative to log coloring, e.g. when dumping the log to file. =back Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single flag without affecting other I or changing I. When setting both I and I, a '+' separator is expected between the last I value and before I. I is a string or a number containing one of the following values: =over 4 =item B Show nothing at all; be silent. =item B Only show fatal errors which could lead the process to crash, such as an assertion failure. This is not currently used for anything. =item B Only show fatal errors. These are errors after which the process absolutely cannot continue. =item B Show all errors, including ones which can be recovered from. =item B Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown. =item B Show informative messages during processing. This is in addition to warnings and errors. This is the default value. =item B Same as C, except more verbose. =item B Show everything, including debugging information. =item B =back For example to enable repeated log output, add the C prefix, and set I to C: ffmpeg -loglevel repeat+level+verbose -i input output Another example that enables repeated log output without affecting current state of C prefix flag or I: ffmpeg [...] -loglevel +repeat By default the program logs to stderr. If coloring is supported by the terminal, colors are used to mark errors and warnings. Log coloring can be disabled setting the environment variable B, or can be forced setting the environment variable B. =item B<-report> Dump full command line and log output to a file named C-I-I.log> in the current directory. This file can be useful for bug reports. It also implies C<-loglevel debug>. Setting the environment variable B to any value has the same effect. If the value is a ':'-separated key=value sequence, these options will affect the report; option values must be escaped if they contain special characters or the options delimiter ':' (see the ``Quoting and escaping'' section in the ffmpeg-utils manual). The following options are recognized: =over 4 =item B set the file name to use for the report; C<%p> is expanded to the name of the program, C<%t> is expanded to a timestamp, C<%%> is expanded to a plain C<%> =item B set the log verbosity level using a numerical value (see C<-loglevel>). =back For example, to output a report to a file named F using a log level of C<32> (alias for log level C): FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output Errors in parsing the environment variable are not fatal, and will not appear in the report. =item B<-hide_banner> Suppress printing banner. All FFmpeg tools will normally show a copyright notice, build options and library versions. This option can be used to suppress printing this information. =item B<-cpuflags flags (>IB<)> Allows setting and clearing cpu flags. This option is intended for testing. Do not use it unless you know what you're doing. ffmpeg -cpuflags -sse+mmx ... ffmpeg -cpuflags mmx ... ffmpeg -cpuflags 0 ... Possible flags for this option are: =over 4 =item B =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B<3dnow> =item B<3dnowext> =item B =item B =item B =back =item B =over 4 =item B =item B =item B =item B =item B =item B =item B =back =item B =over 4 =item B =item B =item B =back =item B =over 4 =item B =back =item B =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =back =back =item B<-cpucount> I B<(>IB<)> Override detection of CPU count. This option is intended for testing. Do not use it unless you know what you're doing. ffmpeg -cpucount 2 =item B<-max_alloc> I Set the maximum size limit for allocating a block on the heap by ffmpeg's family of malloc functions. Exercise B when using this option. Don't use if you do not understand the full consequence of doing so. Default is INT_MAX. =back =head2 AVOptions These options are provided directly by the libavformat, libavdevice and libavcodec libraries. To see the list of available AVOptions, use the B<-help> option. They are separated into two categories: =over 4 =item B 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. =item B These options are specific to the given container, device or codec. Private options are listed under their corresponding containers/devices/codecs. =back For example to write an ID3v2.3 header instead of a default ID3v2.4 to an MP3 file, use the B private option of the MP3 muxer: ffmpeg -i input.flac -id3v2_version 3 out.mp3 All codec AVOptions are per-stream, and thus 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 above example, 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 absolute index of the output stream. Note: the B<-nooption> syntax cannot be used for boolean AVOptions, use B<-option 0>/B<-option 1>. 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. =head2 Main options =over 4 =item B<-x> I Force displayed width. =item B<-y> I Force displayed height. =item B<-fs> Start in fullscreen mode. =item B<-an> Disable audio. =item B<-vn> Disable video. =item B<-sn> Disable subtitles. =item B<-ss> I Seek to I. Note that in most formats it is not possible to seek exactly, so B will seek to the nearest seek point to I. I must be a time duration specification, see B. =item B<-t> I Play I seconds of audio/video. I must be a time duration specification, see B. =item B<-bytes> Seek by bytes. =item B<-seek_interval> Set custom interval, in seconds, for seeking using left/right keys. Default is 10 seconds. =item B<-nodisp> Disable graphical display. =item B<-noborder> Borderless window. =item B<-alwaysontop> Window always on top. Available on: X11 with SDL E= 2.0.5, Windows SDL E= 2.0.6. =item B<-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. =item B<-f> I Force format. =item B<-window_title> I Set window title (default is the input filename). =item B<-left> I<title> Set the x position for the left of the window (default is a centered window). =item B<-top> I<title> Set the y position for the top of the window (default is a centered window). =item B<-loop> I<number> Loops movie playback E<lt>numberE<gt> times. 0 means forever. =item B<-showmode> I<mode> Set the show mode to use. Available values for I<mode> are: =over 4 =item B<0, video> show video =item B<1, waves> show audio waves =item B<2, rdft> show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform) =back Default value is "video", if video is not present or cannot be played "rdft" is automatically selected. You can interactively cycle through the available show modes by pressing the key B<w>. =item B<-vf> I<filtergraph> Create the filtergraph specified by I<filtergraph> and use it to filter the video stream. I<filtergraph> is a description of the filtergraph to apply to the stream, and must have a single video input and a single video output. In the filtergraph, the input is associated to the label C<in>, and the output to the label C<out>. See the ffmpeg-filters manual for more information 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 B<w>. =item B<-af> I<filtergraph> I<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). =item B<-i> I<input_url> Read I<input_url>. =back =head2 Advanced options =over 4 =item B<-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 is shown by default, unless the log level is lower than C<info>. Its display can be forced by manually specifying this option. To disable it, you need to specify C<-nostats>. =item B<-fast> Non-spec-compliant optimizations. =item B<-genpts> Generate pts. =item B<-sync> I<type> Set the master clock to audio (C<type=audio>), video (C<type=video>) or external (C<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 is necessary to change that. This option is mainly used for debugging purposes. =item B<-ast> I<audio_stream_specifier> Select the desired audio stream using the given stream specifier. The stream specifiers are described in the B<Stream specifiers> chapter. If this option is not specified, the "best" audio stream is selected in the program of the already selected video stream. =item B<-vst> I<video_stream_specifier> Select the desired video stream using the given stream specifier. The stream specifiers are described in the B<Stream specifiers> chapter. If this option is not specified, the "best" video stream is selected. =item B<-sst> I<subtitle_stream_specifier> Select the desired subtitle stream using the given stream specifier. The stream specifiers are described in the B<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. =item B<-autoexit> Exit when video is done playing. =item B<-exitonkeydown> Exit if any key is pressed. =item B<-exitonmousedown> Exit if any mouse button is pressed. =item B<-codec:>I<media_specifier>B< >I<codec_name> Force a specific decoder implementation for the stream identified by I<media_specifier>, which can assume the values C<a> (audio), C<v> (video), and C<s> subtitle. =item B<-acodec> I<codec_name> Force a specific audio decoder. =item B<-vcodec> I<codec_name> Force a specific video decoder. =item B<-scodec> I<codec_name> Force a specific subtitle decoder. =item B<-autorotate> Automatically rotate the video according to file metadata. Enabled by default, use B<-noautorotate> to disable it. =item B<-framedrop> Drop video frames if video is out of sync. Enabled by default if the master clock is not set to video. Use this option to enable frame dropping for all master clock sources, use B<-noframedrop> to disable it. =item B<-infbuf> Do not limit the input buffer size, read as much data as possible from the input as soon as possible. Enabled by default for realtime streams, where data may be dropped if not read in time. Use this option to enable infinite buffers for all inputs, use B<-noinfbuf> to disable it. =item B<-filter_threads> I<nb_threads> Defines how many threads are used to process a filter pipeline. Each pipeline will produce a thread pool with this many threads available for parallel processing. The default is 0 which means that the thread count will be determined by the number of available CPUs. =item B<-enable_vulkan> Use vulkan renderer rather than SDL builtin renderer. Depends on libplacebo. =item B<-vulkan_params> Vulkan configuration using a list of I<key>=I<value> pairs separated by ":". =item B<-hwaccel> Use HW accelerated decoding. Enable this option will enable vulkan renderer automatically. =back =head2 While playing =over 4 =item B<q, ESC> Quit. =item B<f> Toggle full screen. =item B<p, SPC> Pause. =item B<m> Toggle mute. =item B<9, 0> =item B</, *> Decrease and increase volume respectively. =item B<a> Cycle audio channel in the current program. =item B<v> Cycle video channel. =item B<t> Cycle subtitle channel in the current program. =item B<c> Cycle program. =item B<w> Cycle video filters or show modes. =item B<s> Step to the next frame. Pause if the stream is not already paused, step to the next video frame, and pause. =item B<left/right> Seek backward/forward 10 seconds. =item B<down/up> Seek backward/forward 1 minute. =item B<page down/page up> Seek to the previous/next chapter. or if there are no chapters Seek backward/forward 10 minutes. =item B<right mouse click> Seek to percentage in file corresponding to fraction of width. =item B<left mouse double-click> Toggle full screen. =back =head1 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) =head1 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 B<git log> in the FFmpeg source directory, or browsing the online repository at E<lt>B<https://git.ffmpeg.org/ffmpeg>E<gt>. Maintainers for the specific components are listed in the file F<MAINTAINERS> in the source code tree.