1FFPLAY(1) FFPLAY(1)
2
3
4
6 ffplay - FFplay media player
7
9 ffplay [options] [input_url]
10
12 FFplay is a very simple and portable media player using the FFmpeg
13 libraries and the SDL library. It is mostly used as a testbed for the
14 various FFmpeg APIs.
15
17 All the numerical options, if not specified otherwise, accept a string
18 representing a number as input, which may be followed by one of the SI
19 unit prefixes, for example: 'K', 'M', or 'G'.
20
21 If 'i' is appended to the SI unit prefix, the complete prefix will be
22 interpreted as a unit prefix for binary multiples, which are based on
23 powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit
24 prefix multiplies the value by 8. This allows using, for example: 'KB',
25 'MiB', 'G' and 'B' as number suffixes.
26
27 Options which do not take arguments are boolean options, and set the
28 corresponding value to true. They can be set to false by prefixing the
29 option name with "no". For example using "-nofoo" will set the boolean
30 option with name "foo" to false.
31
32 Stream specifiers
33 Some options are applied per-stream, e.g. bitrate or codec. Stream
34 specifiers are used to precisely specify which stream(s) a given option
35 belongs to.
36
37 A stream specifier is a string generally appended to the option name
38 and separated from it by a colon. E.g. "-codec:a:1 ac3" contains the
39 "a:1" stream specifier, which matches the second audio stream.
40 Therefore, it would select the ac3 codec for the second audio stream.
41
42 A stream specifier can match several streams, so that the option is
43 applied to all of them. E.g. the stream specifier in "-b:a 128k"
44 matches all audio streams.
45
46 An empty stream specifier matches all streams. For example, "-codec
47 copy" or "-codec: copy" would copy all the streams without reencoding.
48
49 Possible forms of stream specifiers are:
50
51 stream_index
52 Matches the stream with this index. E.g. "-threads:1 4" would set
53 the thread count for the second stream to 4. If stream_index is
54 used as an additional stream specifier (see below), then it selects
55 stream number stream_index from the matching streams. Stream
56 numbering is based on the order of the streams as detected by
57 libavformat except when a program ID is also specified. In this
58 case it is based on the ordering of the streams in the program.
59
60 stream_type[:additional_stream_specifier]
61 stream_type is one of following: 'v' or 'V' for video, 'a' for
62 audio, 's' for subtitle, 'd' for data, and 't' for attachments. 'v'
63 matches all video streams, 'V' only matches video streams which are
64 not attached pictures, video thumbnails or cover arts. If
65 additional_stream_specifier is used, then it matches streams which
66 both have this type and match the additional_stream_specifier.
67 Otherwise, it matches all streams of the specified type.
68
69 p:program_id[:additional_stream_specifier]
70 Matches streams which are in the program with the id program_id. If
71 additional_stream_specifier is used, then it matches streams which
72 both are part of the program and match the
73 additional_stream_specifier.
74
75 #stream_id or i:stream_id
76 Match the stream by stream id (e.g. PID in MPEG-TS container).
77
78 m:key[:value]
79 Matches streams with the metadata tag key having the specified
80 value. If value is not given, matches streams that contain the
81 given tag with any value.
82
83 u Matches streams with usable configuration, the codec must be
84 defined and the essential information such as video dimension or
85 audio sample rate must be present.
86
87 Note that in ffmpeg, matching by metadata will only work properly
88 for input files.
89
90 Generic options
91 These options are shared amongst the ff* tools.
92
93 -L Show license.
94
95 -h, -?, -help, --help [arg]
96 Show help. An optional parameter may be specified to print help
97 about a specific item. If no argument is specified, only basic (non
98 advanced) tool options are shown.
99
100 Possible values of arg are:
101
102 long
103 Print advanced tool options in addition to the basic tool
104 options.
105
106 full
107 Print complete list of options, including shared and private
108 options for encoders, decoders, demuxers, muxers, filters, etc.
109
110 decoder=decoder_name
111 Print detailed information about the decoder named
112 decoder_name. Use the -decoders option to get a list of all
113 decoders.
114
115 encoder=encoder_name
116 Print detailed information about the encoder named
117 encoder_name. Use the -encoders option to get a list of all
118 encoders.
119
120 demuxer=demuxer_name
121 Print detailed information about the demuxer named
122 demuxer_name. Use the -formats option to get a list of all
123 demuxers and muxers.
124
125 muxer=muxer_name
126 Print detailed information about the muxer named muxer_name.
127 Use the -formats option to get a list of all muxers and
128 demuxers.
129
130 filter=filter_name
131 Print detailed information about the filter named filter_name.
132 Use the -filters option to get a list of all filters.
133
134 bsf=bitstream_filter_name
135 Print detailed information about the bitstream filter named
136 bitstream_filter_name. Use the -bsfs option to get a list of
137 all bitstream filters.
138
139 protocol=protocol_name
140 Print detailed information about the protocol named
141 protocol_name. Use the -protocols option to get a list of all
142 protocols.
143
144 -version
145 Show version.
146
147 -buildconf
148 Show the build configuration, one option per line.
149
150 -formats
151 Show available formats (including devices).
152
153 -demuxers
154 Show available demuxers.
155
156 -muxers
157 Show available muxers.
158
159 -devices
160 Show available devices.
161
162 -codecs
163 Show all codecs known to libavcodec.
164
165 Note that the term 'codec' is used throughout this documentation as
166 a shortcut for what is more correctly called a media bitstream
167 format.
168
169 -decoders
170 Show available decoders.
171
172 -encoders
173 Show all available encoders.
174
175 -bsfs
176 Show available bitstream filters.
177
178 -protocols
179 Show available protocols.
180
181 -filters
182 Show available libavfilter filters.
183
184 -pix_fmts
185 Show available pixel formats.
186
187 -sample_fmts
188 Show available sample formats.
189
190 -layouts
191 Show channel names and standard channel layouts.
192
193 -dispositions
194 Show stream dispositions.
195
196 -colors
197 Show recognized color names.
198
199 -sources device[,opt1=val1[,opt2=val2]...]
200 Show autodetected sources of the input device. Some devices may
201 provide system-dependent source names that cannot be autodetected.
202 The returned list cannot be assumed to be always complete.
203
204 ffmpeg -sources pulse,server=192.168.0.4
205
206 -sinks device[,opt1=val1[,opt2=val2]...]
207 Show autodetected sinks of the output device. Some devices may
208 provide system-dependent sink names that cannot be autodetected.
209 The returned list cannot be assumed to be always complete.
210
211 ffmpeg -sinks pulse,server=192.168.0.4
212
213 -loglevel [flags+]loglevel | -v [flags+]loglevel
214 Set logging level and flags used by the library.
215
216 The optional flags prefix can consist of the following values:
217
218 repeat
219 Indicates that repeated log output should not be compressed to
220 the first line and the "Last message repeated n times" line
221 will be omitted.
222
223 level
224 Indicates that log output should add a "[level]" prefix to each
225 message line. This can be used as an alternative to log
226 coloring, e.g. when dumping the log to file.
227
228 Flags can also be used alone by adding a '+'/'-' prefix to
229 set/reset a single flag without affecting other flags or changing
230 loglevel. When setting both flags and loglevel, a '+' separator is
231 expected between the last flags value and before loglevel.
232
233 loglevel is a string or a number containing one of the following
234 values:
235
236 quiet, -8
237 Show nothing at all; be silent.
238
239 panic, 0
240 Only show fatal errors which could lead the process to crash,
241 such as an assertion failure. This is not currently used for
242 anything.
243
244 fatal, 8
245 Only show fatal errors. These are errors after which the
246 process absolutely cannot continue.
247
248 error, 16
249 Show all errors, including ones which can be recovered from.
250
251 warning, 24
252 Show all warnings and errors. Any message related to possibly
253 incorrect or unexpected events will be shown.
254
255 info, 32
256 Show informative messages during processing. This is in
257 addition to warnings and errors. This is the default value.
258
259 verbose, 40
260 Same as "info", except more verbose.
261
262 debug, 48
263 Show everything, including debugging information.
264
265 trace, 56
266
267 For example to enable repeated log output, add the "level" prefix,
268 and set loglevel to "verbose":
269
270 ffmpeg -loglevel repeat+level+verbose -i input output
271
272 Another example that enables repeated log output without affecting
273 current state of "level" prefix flag or loglevel:
274
275 ffmpeg [...] -loglevel +repeat
276
277 By default the program logs to stderr. If coloring is supported by
278 the terminal, colors are used to mark errors and warnings. Log
279 coloring can be disabled setting the environment variable
280 AV_LOG_FORCE_NOCOLOR, or can be forced setting the environment
281 variable AV_LOG_FORCE_COLOR.
282
283 -report
284 Dump full command line and log output to a file named
285 "program-YYYYMMDD-HHMMSS.log" in the current directory. This file
286 can be useful for bug reports. It also implies "-loglevel debug".
287
288 Setting the environment variable FFREPORT to any value has the same
289 effect. If the value is a ':'-separated key=value sequence, these
290 options will affect the report; option values must be escaped if
291 they contain special characters or the options delimiter ':' (see
292 the ``Quoting and escaping'' section in the ffmpeg-utils manual).
293
294 The following options are recognized:
295
296 file
297 set the file name to use for the report; %p is expanded to the
298 name of the program, %t is expanded to a timestamp, "%%" is
299 expanded to a plain "%"
300
301 level
302 set the log verbosity level using a numerical value (see
303 "-loglevel").
304
305 For example, to output a report to a file named ffreport.log using
306 a log level of 32 (alias for log level "info"):
307
308 FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
309
310 Errors in parsing the environment variable are not fatal, and will
311 not appear in the report.
312
313 -hide_banner
314 Suppress printing banner.
315
316 All FFmpeg tools will normally show a copyright notice, build
317 options and library versions. This option can be used to suppress
318 printing this information.
319
320 -cpuflags flags (global)
321 Allows setting and clearing cpu flags. This option is intended for
322 testing. Do not use it unless you know what you're doing.
323
324 ffmpeg -cpuflags -sse+mmx ...
325 ffmpeg -cpuflags mmx ...
326 ffmpeg -cpuflags 0 ...
327
328 Possible flags for this option are:
329
330 x86
331 mmx
332 mmxext
333 sse
334 sse2
335 sse2slow
336 sse3
337 sse3slow
338 ssse3
339 atom
340 sse4.1
341 sse4.2
342 avx
343 avx2
344 xop
345 fma3
346 fma4
347 3dnow
348 3dnowext
349 bmi1
350 bmi2
351 cmov
352 ARM
353 armv5te
354 armv6
355 armv6t2
356 vfp
357 vfpv3
358 neon
359 setend
360 AArch64
361 armv8
362 vfp
363 neon
364 PowerPC
365 altivec
366 Specific Processors
367 pentium2
368 pentium3
369 pentium4
370 k6
371 k62
372 athlon
373 athlonxp
374 k8
375 -cpucount count (global)
376 Override detection of CPU count. This option is intended for
377 testing. Do not use it unless you know what you're doing.
378
379 ffmpeg -cpucount 2
380
381 -max_alloc bytes
382 Set the maximum size limit for allocating a block on the heap by
383 ffmpeg's family of malloc functions. Exercise extreme caution when
384 using this option. Don't use if you do not understand the full
385 consequence of doing so. Default is INT_MAX.
386
387 AVOptions
388 These options are provided directly by the libavformat, libavdevice and
389 libavcodec libraries. To see the list of available AVOptions, use the
390 -help option. They are separated into two categories:
391
392 generic
393 These options can be set for any container, codec or device.
394 Generic options are listed under AVFormatContext options for
395 containers/devices and under AVCodecContext options for codecs.
396
397 private
398 These options are specific to the given container, device or codec.
399 Private options are listed under their corresponding
400 containers/devices/codecs.
401
402 For example to write an ID3v2.3 header instead of a default ID3v2.4 to
403 an MP3 file, use the id3v2_version private option of the MP3 muxer:
404
405 ffmpeg -i input.flac -id3v2_version 3 out.mp3
406
407 All codec AVOptions are per-stream, and thus a stream specifier should
408 be attached to them:
409
410 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
411
412 In the above example, a multichannel audio stream is mapped twice for
413 output. The first instance is encoded with codec ac3 and bitrate 640k.
414 The second instance is downmixed to 2 channels and encoded with codec
415 aac. A bitrate of 128k is specified for it using absolute index of the
416 output stream.
417
418 Note: the -nooption syntax cannot be used for boolean AVOptions, use
419 -option 0/-option 1.
420
421 Note: the old undocumented way of specifying per-stream AVOptions by
422 prepending v/a/s to the options name is now obsolete and will be
423 removed soon.
424
425 Main options
426 -x width
427 Force displayed width.
428
429 -y height
430 Force displayed height.
431
432 -fs Start in fullscreen mode.
433
434 -an Disable audio.
435
436 -vn Disable video.
437
438 -sn Disable subtitles.
439
440 -ss pos
441 Seek to pos. Note that in most formats it is not possible to seek
442 exactly, so ffplay will seek to the nearest seek point to pos.
443
444 pos must be a time duration specification, see the Time duration
445 section in the ffmpeg-utils(1) manual.
446
447 -t duration
448 Play duration seconds of audio/video.
449
450 duration must be a time duration specification, see the Time
451 duration section in the ffmpeg-utils(1) manual.
452
453 -bytes
454 Seek by bytes.
455
456 -seek_interval
457 Set custom interval, in seconds, for seeking using left/right keys.
458 Default is 10 seconds.
459
460 -nodisp
461 Disable graphical display.
462
463 -noborder
464 Borderless window.
465
466 -alwaysontop
467 Window always on top. Available on: X11 with SDL >= 2.0.5, Windows
468 SDL >= 2.0.6.
469
470 -volume
471 Set the startup volume. 0 means silence, 100 means no volume
472 reduction or amplification. Negative values are treated as 0,
473 values above 100 are treated as 100.
474
475 -f fmt
476 Force format.
477
478 -window_title title
479 Set window title (default is the input filename).
480
481 -left title
482 Set the x position for the left of the window (default is a
483 centered window).
484
485 -top title
486 Set the y position for the top of the window (default is a centered
487 window).
488
489 -loop number
490 Loops movie playback <number> times. 0 means forever.
491
492 -showmode mode
493 Set the show mode to use. Available values for mode are:
494
495 0, video
496 show video
497
498 1, waves
499 show audio waves
500
501 2, rdft
502 show audio frequency band using RDFT ((Inverse) Real Discrete
503 Fourier Transform)
504
505 Default value is "video", if video is not present or cannot be
506 played "rdft" is automatically selected.
507
508 You can interactively cycle through the available show modes by
509 pressing the key w.
510
511 -vf filtergraph
512 Create the filtergraph specified by filtergraph and use it to
513 filter the video stream.
514
515 filtergraph is a description of the filtergraph to apply to the
516 stream, and must have a single video input and a single video
517 output. In the filtergraph, the input is associated to the label
518 "in", and the output to the label "out". See the ffmpeg-filters
519 manual for more information about the filtergraph syntax.
520
521 You can specify this parameter multiple times and cycle through the
522 specified filtergraphs along with the show modes by pressing the
523 key w.
524
525 -af filtergraph
526 filtergraph is a description of the filtergraph to apply to the
527 input audio. Use the option "-filters" to show all the available
528 filters (including sources and sinks).
529
530 -i input_url
531 Read input_url.
532
533 Advanced options
534 -stats
535 Print several playback statistics, in particular show the stream
536 duration, the codec parameters, the current position in the stream
537 and the audio/video synchronisation drift. It is shown by default,
538 unless the log level is lower than "info". Its display can be
539 forced by manually specifying this option. To disable it, you need
540 to specify "-nostats".
541
542 -fast
543 Non-spec-compliant optimizations.
544
545 -genpts
546 Generate pts.
547
548 -sync type
549 Set the master clock to audio ("type=audio"), video ("type=video")
550 or external ("type=ext"). Default is audio. The master clock is
551 used to control audio-video synchronization. Most media players use
552 audio as master clock, but in some cases (streaming or high quality
553 broadcast) it is necessary to change that. This option is mainly
554 used for debugging purposes.
555
556 -ast audio_stream_specifier
557 Select the desired audio stream using the given stream specifier.
558 The stream specifiers are described in the Stream specifiers
559 chapter. If this option is not specified, the "best" audio stream
560 is selected in the program of the already selected video stream.
561
562 -vst video_stream_specifier
563 Select the desired video stream using the given stream specifier.
564 The stream specifiers are described in the Stream specifiers
565 chapter. If this option is not specified, the "best" video stream
566 is selected.
567
568 -sst subtitle_stream_specifier
569 Select the desired subtitle stream using the given stream
570 specifier. The stream specifiers are described in the Stream
571 specifiers chapter. If this option is not specified, the "best"
572 subtitle stream is selected in the program of the already selected
573 video or audio stream.
574
575 -autoexit
576 Exit when video is done playing.
577
578 -exitonkeydown
579 Exit if any key is pressed.
580
581 -exitonmousedown
582 Exit if any mouse button is pressed.
583
584 -codec:media_specifier codec_name
585 Force a specific decoder implementation for the stream identified
586 by media_specifier, which can assume the values "a" (audio), "v"
587 (video), and "s" subtitle.
588
589 -acodec codec_name
590 Force a specific audio decoder.
591
592 -vcodec codec_name
593 Force a specific video decoder.
594
595 -scodec codec_name
596 Force a specific subtitle decoder.
597
598 -autorotate
599 Automatically rotate the video according to file metadata. Enabled
600 by default, use -noautorotate to disable it.
601
602 -framedrop
603 Drop video frames if video is out of sync. Enabled by default if
604 the master clock is not set to video. Use this option to enable
605 frame dropping for all master clock sources, use -noframedrop to
606 disable it.
607
608 -infbuf
609 Do not limit the input buffer size, read as much data as possible
610 from the input as soon as possible. Enabled by default for realtime
611 streams, where data may be dropped if not read in time. Use this
612 option to enable infinite buffers for all inputs, use -noinfbuf to
613 disable it.
614
615 -filter_threads nb_threads
616 Defines how many threads are used to process a filter pipeline.
617 Each pipeline will produce a thread pool with this many threads
618 available for parallel processing. The default is 0 which means
619 that the thread count will be determined by the number of available
620 CPUs.
621
622 While playing
623 q, ESC
624 Quit.
625
626 f Toggle full screen.
627
628 p, SPC
629 Pause.
630
631 m Toggle mute.
632
633 9, 0
634 /, *
635 Decrease and increase volume respectively.
636
637 a Cycle audio channel in the current program.
638
639 v Cycle video channel.
640
641 t Cycle subtitle channel in the current program.
642
643 c Cycle program.
644
645 w Cycle video filters or show modes.
646
647 s Step to the next frame.
648
649 Pause if the stream is not already paused, step to the next video
650 frame, and pause.
651
652 left/right
653 Seek backward/forward 10 seconds.
654
655 down/up
656 Seek backward/forward 1 minute.
657
658 page down/page up
659 Seek to the previous/next chapter. or if there are no chapters
660 Seek backward/forward 10 minutes.
661
662 right mouse click
663 Seek to percentage in file corresponding to fraction of width.
664
665 left mouse double-click
666 Toggle full screen.
667
669 ffplay-all(1), ffmpeg(1), ffprobe(1), ffmpeg-utils(1),
670 ffmpeg-scaler(1), ffmpeg-resampler(1), ffmpeg-codecs(1),
671 ffmpeg-bitstream-filters(1), ffmpeg-formats(1), ffmpeg-devices(1),
672 ffmpeg-protocols(1), ffmpeg-filters(1)
673
675 The FFmpeg developers.
676
677 For details about the authorship, see the Git history of the project
678 (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command git log in
679 the FFmpeg source directory, or browsing the online repository at
680 <https://git.ffmpeg.org/ffmpeg>.
681
682 Maintainers for the specific components are listed in the file
683 MAINTAINERS in the source code tree.
684
685
686
687 FFPLAY(1)