Lines Matching +full:ts +full:- +full:api +full:- +full:utils
1 \input texinfo @c -*- texinfo -*-
2 @documentencoding UTF-8
15 ffmpeg [@var{global_options}] @{[@var{input_file_options}] -i @file{input_url}@} ... @{[@var{output_file_options}] @file{output_url}@} ...
26 @code{-i} option, and writes to an arbitrary number of output "files", which are
34 or with the @code{-map} option (see the Stream selection chapter).
36 To refer to input files in options, you must use their indices (0-based). E.g.
48 Do not mix input and output files -- first specify all input files, then all
56 ffmpeg -i input.avi -b:v 64k -bufsize 64k output.avi
62 ffmpeg -i input.avi -r 24 output.avi
69 ffmpeg -r 1 -i input.m2v -r 24 output.avi
87 | file | ---------> | packets | -----+
97 | output | <-------- | encoded data | <----+
141 Simple filtergraphs are configured with the per-stream @option{-filter} option
142 (with @option{-vf} and @option{-af} aliases for video and audio respectively).
148 | input | ---> | deinterlace | ---> | scale | ---> | output |
173 | input 1 |---->| filter |\
184 Complex filtergraphs are configured with the @option{-filter_complex} option.
188 The @option{-lavfi} option is equivalent to @option{-filter_complex}.
196 @option{-codec} option. It makes @command{ffmpeg} omit the decoding and encoding
198 for changing the container format or modifying container-level metadata. The
205 | file | ---------> | packets | -------> | file |
219 @command{ffmpeg} provides the @code{-map} option for manual control of stream selection in each
220 output file. Users can skip @code{-map} and let ffmpeg perform automatic stream selection as
221 described below. The @code{-vn / -an / -sn / -dn} options can be used to skip inclusion of
226 The sub-sections that follow describe the various rules that are involved in stream selection.
247 The output format's default subtitle encoder can be either text-based or image-based,
255 using @code{-map}.
258 When @code{-map} is used, only user-mapped streams are included in that output file,
274 below. Stream handling is set via the @code{-codec} option addressed to streams within a
276 stream selection process and thus do not influence the latter. If no @code{-codec} option is
315 ffmpeg -i A.avi -i B.mp4 out1.mkv out2.wav -map 1:a -c:a copy out3.mov
317 There are three output files specified, and for the first two, no @code{-map} options
332 For @file{out3.mov}, since a @code{-map} option is set, no automatic stream selection will
333 occur. The @code{-map 1:a} option will select all audio streams from the second input
341 to @code{copy}, so no decoding-filtering-encoding operations will occur, or @emph{can} occur.
347 ffmpeg -i C.mkv out1.mkv -c:s dvdsub -an out2.mkv
350 video and audio stream shall be selected. The subtitle stream of @file{C.mkv} is image-based
351 and the default subtitle encoder of the Matroska muxer is text-based, so a transcode operation
354 selected, in addition to the video stream. The presence of @code{-an} disables audio stream
359 ffmpeg -i A.avi -i C.mkv -i B.mp4 -filter_complex "overlay" out1.mp4 out2.srt
361 A filtergraph is setup here using the @code{-filter_complex} option and consists of a single
370 The 2nd output file, @file{out2.srt}, only accepts text-based subtitle streams. So, even though
371 the first subtitle stream available belongs to @file{C.mkv}, it is image-based and hence skipped.
372 The selected stream, @code{stream 2} in @file{B.mp4}, is the first text-based subtitle stream.
376 ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex "[1:v]hue=s=0[outv];overlay;aresample" \
377 -map '[outv]' -an out1.mp4 \
379 -map '[outv]' -map 1:a:0 out3.mkv
386 ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex "[1:v]hue=s=0[outv];overlay;aresample" \
387 -an out1.mp4 \
389 -map 1:a:0 out3.mkv
397 ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex "[1:v]hue=s=0,split=2[outv1][outv2];overlay;aresample" \
398 -map '[outv1]' -an out1.mp4 \
400 -map '[outv2]' -map 1:a:0 out3.mkv
408 sent to the first output file @file{out1.mp4}, regardless of the presence of the @code{-map} option.
411 output is also unlabelled, it too is mapped to the first output file. The presence of @code{-an}
427 @include fftools-common-opts.texi
433 @item -f @var{fmt} (@emph{input/output})
438 @item -i @var{url} (@emph{input})
441 @item -y (@emph{global})
444 @item -n (@emph{global})
448 @item -stream_loop @var{number} (@emph{input})
450 loop -1 means infinite loop.
452 @item -recast_media (@emph{global})
457 @item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
458 @itemx -codec[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
462 the stream is not to be re-encoded.
466 ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
472 ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
477 @item -t @var{duration} (@emph{input/output})
478 When used as an input option (before @code{-i}), limit the @var{duration} of
485 see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
487 -to and -t are mutually exclusive and -t has priority.
489 @item -to @var{position} (@emph{input/output})
492 see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
494 -to and -t are mutually exclusive and -t has priority.
496 @item -fs @var{limit_size} (@emph{output})
501 @item -ss @var{position} (@emph{input/output})
502 When used as an input option (before @code{-i}), seeks in this input file to
505 When transcoding and @option{-accurate_seek} is enabled (the default), this
507 discarded. When doing stream copy or when @option{-noaccurate_seek} is used, it
514 see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
516 @item -sseof @var{position} (@emph{input})
518 Like the @code{-ss} option but relative to the "end of file". That is negative
521 @item -isync @var{input_index} (@emph{input})
531 the target index itself or @var{-1}, then no adjustment is made to target timestamps. A sync
534 Default value is @var{-1}.
536 @item -itsoffset @var{offset} (@emph{input})
540 see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
546 @item -itsscale @var{scale} (@emph{input,per-stream})
549 @item -timestamp @var{date} (@emph{output})
553 see @ref{date syntax,,the Date section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
555 @item -metadata[:metadata_specifier] @var{key}=@var{value} (@emph{output,per-metadata})
559 on streams, chapters or programs. See @code{-map_metadata}
562 This option overrides metadata set with @code{-map_metadata}. It is
567 ffmpeg -i in.avi -metadata title="my title" out.flv
572 ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
575 @item -disposition[:stream_specifier] @var{value} (@emph{output,per-stream})
579 stream this option applies to is fed by a complex filtergraph - in that case the
582 @var{value} is a sequence of items separated by '+' or '-'. The first item may
583 also be prefixed with '+' or '-', in which case this option modifies the default
585 default value. A '+' prefix adds the given disposition, '-' removes it. It is
588 If no @code{-disposition} options were specified for an output file, ffmpeg will
593 The @code{-dispositions} option lists the known dispositions.
597 ffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv
603 ffmpeg -i in.mkv -c copy -disposition:s:0 0 -disposition:s:1 default out.mkv
608 ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic out.mp4
613 @item -program [title=@var{title}:][program_num=@var{program_num}:]st=@var{stream}[:st=@var{stream}...] (@emph{output})
618 @item -target @var{type} (@emph{output})
620 @code{dv50}). @var{type} may be prefixed with @code{pal-}, @code{ntsc-} or
621 @code{film-} to use the corresponding standard. All the format options
625 ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
632 ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
640 -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
641 -s 352x288 -r 25
642 -codec:v mpeg1video -g 15 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
643 -ar 44100 -ac 2
644 -codec:a mp2 -b:a 224k
647 -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
648 -s 352x240 -r 30000/1001
649 -codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
650 -ar 44100 -ac 2
651 -codec:a mp2 -b:a 224k
654 -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
655 -s 352x240 -r 24000/1001
656 -codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
657 -ar 44100 -ac 2
658 -codec:a mp2 -b:a 224k
664 -f svcd -packetsize 2324
665 -s 480x576 -pix_fmt yuv420p -r 25
666 -codec:v mpeg2video -g 15 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
667 -ar 44100
668 -codec:a mp2 -b:a 224k
671 -f svcd -packetsize 2324
672 -s 480x480 -pix_fmt yuv420p -r 30000/1001
673 -codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
674 -ar 44100
675 -codec:a mp2 -b:a 224k
678 -f svcd -packetsize 2324
679 -s 480x480 -pix_fmt yuv420p -r 24000/1001
680 -codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
681 -ar 44100
682 -codec:a mp2 -b:a 224k
688 -f dvd -muxrate 10080k -packetsize 2048
689 -s 720x576 -pix_fmt yuv420p -r 25
690 -codec:v mpeg2video -g 15 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
691 -ar 48000
692 -codec:a ac3 -b:a 448k
695 -f dvd -muxrate 10080k -packetsize 2048
696 -s 720x480 -pix_fmt yuv420p -r 30000/1001
697 -codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
698 -ar 48000
699 -codec:a ac3 -b:a 448k
702 -f dvd -muxrate 10080k -packetsize 2048
703 -s 720x480 -pix_fmt yuv420p -r 24000/1001
704 -codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
705 -ar 48000
706 -codec:a ac3 -b:a 448k
712 -f dv
713 -s 720x576 -pix_fmt yuv420p -r 25
714 -ar 48000 -ac 2
717 -f dv
718 -s 720x480 -pix_fmt yuv411p -r 30000/1001
719 -ar 48000 -ac 2
722 -f dv
723 -s 720x480 -pix_fmt yuv411p -r 24000/1001
724 -ar 48000 -ac 2
728 Any user-set value for a parameter above will override the target preset value. In that case, the output may
731 @item -dn (@emph{input/output})
733 being automatically selected or mapped for any output. See @code{-discard}
737 mapping of any data stream. For full manual control see the @code{-map}
740 @item -dframes @var{number} (@emph{output})
742 @code{-frames:d}, which you should use instead.
744 @item -frames[:@var{stream_specifier}] @var{framecount} (@emph{output,per-stream})
747 @item -q[:@var{stream_specifier}] @var{q} (@emph{output,per-stream})
748 @itemx -qscale[:@var{stream_specifier}] @var{q} (@emph{output,per-stream})
750 codec-dependent.
758 @item -filter[:@var{stream_specifier}] @var{filtergraph} (@emph{output,per-stream})
766 the ffmpeg-filters manual for more information about the filtergraph
769 See the @ref{filter_complex_option,,-filter_complex option} if you
772 @item -filter_script[:@var{stream_specifier}] @var{filename} (@emph{output,per-stream})
773 This option is similar to @option{-filter}, the only difference is that its
777 @item -reinit_filter[:@var{stream_specifier}] @var{integer} (@emph{input,per-stream})
779 reinitialized when input frame parameters change mid-stream. This option is enabled by
787 @item -filter_threads @var{nb_threads} (@emph{global})
792 @item -pre[:@var{stream_specifier}] @var{preset_name} (@emph{output,per-stream})
795 @item -stats (@emph{global})
797 disable it you need to specify @code{-nostats}.
799 @item -stats_period @var{time} (@emph{global})
802 @item -progress @var{url} (@emph{global})
803 Send program-friendly progress information to @var{url}.
810 The update period is set using @code{-stats_period}.
813 @item -stdin
816 @code{-nostdin}.
823 @item -debug_ts (@emph{global})
829 See also the option @code{-fdebug ts}.
831 @item -attach @var{filename} (@emph{output})
835 a new stream to the file. It is then possible to use per-stream options
838 with @code{-map} or automatic mappings).
842 ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
846 @item -dump_attachment[:@var{stream_specifier}] @var{filename} (@emph{input,per-stream})
853 ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
857 ffmpeg -dump_attachment:t "" -i INPUT
860 Technical note -- attachments are implemented as codec extradata, so this
868 @item -vframes @var{number} (@emph{output})
870 @code{-frames:v}, which you should use instead.
871 @item -r[:@var{stream_specifier}] @var{fps} (@emph{input/output,per-stream})
876 This is not the same as the @option{-framerate} option used for some input formats
878 If in doubt use @option{-framerate} instead of the input option @option{-r}.
883 @item -fpsmax[:@var{stream_specifier}] @var{fps} (@emph{output,per-stream})
886 Clamps output frame rate when output framerate is auto-set and is higher than this value.
888 It cannot be set together with @code{-r}. It is ignored during streamcopy.
890 @item -s[:@var{stream_specifier}] @var{size} (@emph{input/output,per-stream})
895 stored in the file or is configurable -- e.g. raw video or video grabbers.
901 The format is @samp{wxh} (default - same as source).
903 @item -aspect[:@var{stream_specifier}] @var{aspect} (@emph{output,per-stream})
911 If used together with @option{-vcodec copy}, it will affect the aspect ratio
915 @item -vn (@emph{input/output})
917 being automatically selected or mapped for any output. See @code{-discard}
921 mapping of any video stream. For full manual control see the @code{-map}
924 @item -vcodec @var{codec} (@emph{output})
925 Set the video codec. This is an alias for @code{-codec:v}.
927 @item -pass[:@var{stream_specifier}] @var{n} (@emph{output,per-stream})
928 Select the pass number (1 or 2). It is used to do two-pass
930 pass into a log file (see also the option -passlogfile),
936 ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
937 ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
940 @item -passlogfile[:@var{stream_specifier}] @var{prefix} (@emph{output,per-stream})
941 Set two-pass log file name prefix to @var{prefix}, the default file name
943 @file{PREFIX-N.log}, where N is a number specific to the output
946 @item -vf @var{filtergraph} (@emph{output})
950 This is an alias for @code{-filter:v}, see the @ref{filter_option,,-filter option}.
952 @item -autorotate
954 default, use @option{-noautorotate} to disable it.
956 @item -autoscale
958 Enabled by default, use @option{-noautoscale} to disable it. When autoscale is
968 @item -pix_fmt[:@var{stream_specifier}] @var{format} (@emph{input/output,per-stream})
969 Set pixel format. Use @code{-pix_fmts} to show all the supported
979 @item -sws_flags @var{flags} (@emph{input/output})
982 @item -rc_override[:@var{stream_specifier}] @var{override} (@emph{output,per-stream})
988 @item -ilme
989 Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
994 @item -psnr
996 @item -vstats
998 @item -vstats_file @var{file}
1000 @item -vstats_version @var{file}
1010 @item -top[:@var{stream_specifier}] @var{n} (@emph{output,per-stream})
1011 top=1/bottom=0/auto=-1 field first
1012 @item -dc @var{precision}
1014 @item -vtag @var{fourcc/tag} (@emph{output})
1015 Force video tag/fourcc. This is an alias for @code{-tag:v}.
1016 @item -qphist (@emph{global})
1018 @item -vbsf @var{bitstream_filter}
1019 Deprecated see -bsf
1021 @item -force_key_frames[:@var{stream_specifier}] @var{time}[,@var{time}...] (@emph{output,per-stream})
1022 @item -force_key_frames[:@var{stream_specifier}] expr:@var{expr} (@emph{output,per-stream})
1023 @item -force_key_frames[:@var{stream_specifier}] source (@emph{output,per-stream})
1024 @item -force_key_frames[:@var{stream_specifier}] source_no_drop (@emph{output,per-stream})
1036 via @code{-enc_time_base}.
1047 -force_key_frames 0:05:00,chapters-0.1
1053 key frame is forced in case the evaluation is non-zero.
1073 -force_key_frames expr:gte(t,n_forced*5)
1079 -force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
1095 algorithms of certain encoders: using fixed-GOP options or similar
1098 @item -copyinkf[:@var{stream_specifier}] (@emph{output,per-stream})
1099 When doing stream copy, copy also non-key frames found at the
1102 @item -init_hw_device @var{type}[=@var{name}][:@var{device}[,@var{key=value}...]]
1122 @item -init_hw_device cuda:1
1125 @item -init_hw_device cuda:0,primary_ctx=1
1158 platform-appropriate subdevice (@samp{dxva2} or @samp{d3d11va} or @samp{vaapi}) and then deriving a
1161 Alternatively, @samp{child_device_type} helps to choose platform-appropriate subdevice type.
1166 @item -init_hw_device qsv:hw,child_device_type=d3d11va
1169 @item -init_hw_device qsv:hw,child_device_type=dxva2
1176 The set of devices can also be filtered using the key-value pairs to find only
1199 @item -init_hw_device opencl:0.1
1202 @item -init_hw_device opencl:,device_name=Foo9000
1205 @item -init_hw_device opencl:1,device_type=gpu,device_extensions=cl_khr_fp16
1212 system-dependent list of devices. If @var{device} is any other string, it
1229 @item -init_hw_device vulkan:1
1232 @item -init_hw_device vulkan:RADV
1235 @item -init_hw_device vulkan:0,instance_extensions=VK_KHR_wayland_surface+VK_KHR_xcb_surface
1241 @item -init_hw_device @var{type}[=@var{name}]@@@var{source}
1245 @item -init_hw_device list
1248 @item -filter_hw_device @var{name}
1253 is typically only required when the input is not already in hardware frames -
1259 @item -hwaccel[:@var{stream_specifier}] @var{hwaccel} (@emph{input,per-stream})
1270 Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
1279 Use VAAPI (Video Acceleration API) hardware acceleration.
1301 @item -hwaccel_device[:@var{stream_specifier}] @var{hwaccel_device} (@emph{input,per-stream})
1304 This option only makes sense when the @option{-hwaccel} option is also specified.
1305 It can either refer to an existing device created with @option{-init_hw_device}
1307 @samp{-init_hw_device} @var{type}:@var{hwaccel_device}
1310 @item -hwaccels
1320 @item -aframes @var{number} (@emph{output})
1322 @code{-frames:a}, which you should use instead.
1323 @item -ar[:@var{stream_specifier}] @var{freq} (@emph{input/output,per-stream})
1328 @item -aq @var{q} (@emph{output})
1329 Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
1330 @item -ac[:@var{stream_specifier}] @var{channels} (@emph{input/output,per-stream})
1335 @item -an (@emph{input/output})
1337 being automatically selected or mapped for any output. See @code{-discard}
1341 mapping of any audio stream. For full manual control see the @code{-map}
1343 @item -acodec @var{codec} (@emph{input/output})
1344 Set the audio codec. This is an alias for @code{-codec:a}.
1345 @item -sample_fmt[:@var{stream_specifier}] @var{sample_fmt} (@emph{output,per-stream})
1346 Set the audio sample format. Use @code{-sample_fmts} to get a list
1349 @item -af @var{filtergraph} (@emph{output})
1353 This is an alias for @code{-filter:a}, see the @ref{filter_option,,-filter option}.
1359 @item -atag @var{fourcc/tag} (@emph{output})
1360 Force audio tag/fourcc. This is an alias for @code{-tag:a}.
1361 @item -absf @var{bitstream_filter}
1362 Deprecated, see -bsf
1363 @item -guess_layout_max @var{channels} (@emph{input,per-stream})
1374 @item -scodec @var{codec} (@emph{input/output})
1375 Set the subtitle codec. This is an alias for @code{-codec:s}.
1376 @item -sn (@emph{input/output})
1378 being automatically selected or mapped for any output. See @code{-discard}
1382 mapping of any subtitle stream. For full manual control see the @code{-map}
1384 @item -sbsf @var{bitstream_filter}
1385 Deprecated, see -bsf
1392 @item -fix_sub_duration
1399 non-monotonic timestamps.
1405 @item -canvas_size @var{size}
1413 @item -map [-]@var{input_file_id}[:@var{stream_specifier}][?][,@var{sync_file_id}[:@var{stream_specifier}]] | @var{[linklabel]} (@emph{output})
1422 The first @code{-map} option on the command line specifies the
1423 source for output stream 0, the second @code{-map} option specifies
1426 A @code{-} character before the stream identifier creates a "negative" mapping.
1432 is used; such as if the map refers to a non-existent input.
1435 graphs (see the @option{-filter_complex} option) to the output file.
1440 ffmpeg -i INPUT -map 0 output
1445 @code{-map} to select which streams to place in an output file. For
1448 ffmpeg -i INPUT -map 0:1 out.wav
1458 ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
1463 ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
1468 ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
1475 ffmpeg -i INPUT -map 0:v -map 0:a? OUTPUT
1480 ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
1485 @item -ignore_unknown
1489 @item -copy_unknown
1493 @item -map_channel [@var{input_file_id}.@var{stream_specifier}.@var{channel_id}|-1][?][:@var{output_file_id}.@var{stream_specifier}]
1498 Using "-1" instead of
1509 ffmpeg -i INPUT -map_channel 0.0.1 -map_channel 0.0.0 OUTPUT
1514 ffmpeg -i INPUT -map_channel -1 -map_channel 0.0.1 OUTPUT
1517 The order of the "-map_channel" option specifies the order of the channels in
1519 channels mapped (mono if one "-map_channel", stereo if two, etc.). Using "-ac"
1520 in combination of "-map_channel" makes the channel gain levels to be updated if
1521 input and output channel layouts don't match (for instance two "-map_channel"
1522 options and "-ac 6").
1528 ffmpeg -i INPUT -map_channel 0.0.0 OUTPUT_CH0 -map_channel 0.0.1 OUTPUT_CH1
1534 ffmpeg -i stereo.wav -map 0:0 -map 0:0 -map_channel 0.0.0:0.0 -map_channel 0.0.1:0.1 -y out.ogg
1538 input stream; you can't for example use "-map_channel" to pick multiple input
1550 ffmpeg -i input.mkv -filter_complex "[0:1] [0:2] amerge" -c:a pcm_s16le -c:v copy output.mkv
1557 ffmpeg -i INPUT -map_channel 0.0.0 -map_channel 0.0.1? OUTPUT
1560 @item -map_metadata[:@var{metadata_spec_out}] @var{infile}[:@var{metadata_spec_in}] (@emph{output,per-metadata})
1562 those are file indices (zero-based), not filenames.
1570 per-stream metadata. @var{stream_spec} is a stream specifier as described
1576 per-chapter metadata. @var{chapter_index} is the zero-based chapter index.
1579 per-program metadata. @var{program_index} is the zero-based program index.
1584 per-stream and per-chapter metadata is copied along with streams/chapters. These
1591 ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
1596 ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
1601 @item -map_chapters @var{input_file_index} (@emph{output})
1607 @item -benchmark (@emph{global})
1612 @item -benchmark_all (@emph{global})
1615 @item -timelimit @var{duration} (@emph{global})
1617 @item -dump (@emph{global})
1619 @item -hex (@emph{global})
1621 @item -readrate @var{speed} (@emph{input})
1624 Its value is a floating-point positive number which represents the maximum duration of
1627 Value @code{1} represents real-time speed and is equivalent to @code{-re}.
1634 @item -re (@emph{input})
1635 Read input at native frame rate. This is equivalent to setting @code{-readrate 1}.
1636 @item -vsync @var{parameter} (@emph{global})
1637 @itemx -fps_mode[:@var{stream_specifier}] @var{parameter} (@emph{output,per-stream})
1656 fresh timestamps based on frame-rate.
1657 @item auto (-1)
1666 With -map you can select from which stream the timestamps should be
1670 @item -frame_drop_threshold @var{parameter}
1673 The default is -1.1. One possible usecase is to avoid framedrops in case
1677 @item -async @var{samples_per_second}
1680 -async 1 is a special case where only the start of the audio stream is corrected
1689 @item -adrift_threshold @var{time}
1693 @code{-async} must be set to a positive value.
1695 @item -apad @var{parameters} (@emph{output,per-stream})
1696 Pad the output audio stream(s). This is the same as applying @code{-af apad}.
1698 @code{-shortest} must be set for this output for the option to take effect.
1700 @item -copyts
1710 @item -start_at_zero
1713 This means that using e.g. @code{-ss 50} will make output timestamps start at
1716 @item -copytb @var{mode}
1734 @item -1
1738 Default value is -1.
1740 @item -enc_time_base[:@var{stream_specifier}] @var{timebase} (@emph{output,per-stream})
1748 For video - use 1/framerate, for audio - use 1/samplerate.
1750 @item -1
1759 or as a floating point number (e.g. 0.04166, 2.0833e-5)
1764 @item -bitexact (@emph{input/output})
1766 @item -shortest (@emph{output})
1768 @item -dts_delta_threshold
1770 @item -dts_error_threshold @var{seconds}
1774 @item -muxdelay @var{seconds} (@emph{output})
1775 Set the maximum demux-decode delay.
1776 @item -muxpreload @var{seconds} (@emph{output})
1777 Set the initial demux-decode delay.
1778 @item -streamid @var{output-stream-index}:@var{new-value} (@emph{output})
1779 Assign a new stream-id value to an output stream. This option should be
1787 ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts
1790 @item -bsf[:@var{stream_specifier}] @var{bitstream_filters} (@emph{output,per-stream})
1792 a comma-separated list of bitstream filters. Use the @code{-bsfs} option
1795 ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264
1798 ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
1801 @item -tag[:@var{stream_specifier}] @var{codec_tag} (@emph{input/output,per-stream})
1804 @item -timecode @var{hh}:@var{mm}:@var{ss}SEP@var{ff}
1808 ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
1812 @item -filter_complex @var{filtergraph} (@emph{global})
1814 outputs. For simple graphs -- those with one input and one output of the same
1815 type -- see the @option{-filter} options. @var{filtergraph} is a description of
1817 ffmpeg-filters manual.
1820 @code{[file_index:stream_specifier]} syntax (i.e. the same as @option{-map}
1825 Output link labels are referred to with @option{-map}. Unlabeled outputs are
1833 ffmpeg -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map
1844 ffmpeg -i video.mkv -i image.png -filter_complex 'overlay[out]' -map
1851 ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
1860 For example, to hardcode subtitles on top of a DVB-T recording stored in
1861 MPEG-TS format, delaying the subtitles by 1 second:
1863 ffmpeg -i input.ts -filter_complex \
1865 -sn -map '#0x2dc' output.mkv
1867 (0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video,
1872 ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
1875 @item -filter_complex_threads @var{nb_threads} (@emph{global})
1877 Similar to filter_threads but used for @code{-filter_complex} graphs only.
1880 @item -lavfi @var{filtergraph} (@emph{global})
1882 outputs. Equivalent to @option{-filter_complex}.
1884 @item -filter_complex_script @var{filename} (@emph{global})
1885 This option is similar to @option{-filter_complex}, the only difference is that
1889 @item -accurate_seek (@emph{input})
1891 @option{-ss} option. It is enabled by default, so seeking is accurate when
1892 transcoding. Use @option{-noaccurate_seek} to disable it, which may be useful
1895 @item -seek_timestamp (@emph{input})
1897 @option{-ss} option. It is disabled by default. If enabled, the argument
1898 to the @option{-ss} option is considered an actual timestamp, and is not
1902 @item -thread_queue_size @var{size} (@emph{input})
1909 @item -sdp_file @var{file} (@emph{global})
1914 @item -discard (@emph{input})
1928 Discard all non-reference frames.
1940 @item -abort_on @var{flags} (@emph{global})
1950 @item -max_error_rate (@emph{global})
1953 processing. Range is a floating-point number between 0 to 1. Default is 2/3.
1955 @item -xerror (@emph{global})
1958 @item -max_muxing_queue_size @var{packets} (@emph{output,per-stream})
1967 @item -muxing_queue_data_threshold @var{bytes} (@emph{output,per-stream})
1972 @item -auto_conversion_filters (@emph{global})
1974 graphs, including those defined by @option{-vf}, @option{-af},
1975 @option{-filter_complex} and @option{-lavfi}. If filter format negotiation
1980 @code{-noauto_conversion_filters}.
1982 @item -bits_per_raw_sample[:@var{stream_specifier}] @var{value} (@emph{output,per-stream})
2017 in that order. For example, if the argument is @code{libvpx-1080p}, it will
2018 search for the file @file{libvpx-1080p.ffpreset}.
2021 @var{codec_name}-@var{arg}.ffpreset in the above-mentioned
2024 the video codec with @code{-vcodec libvpx} and use @code{-vpre 1080p},
2025 then it will search for the file @file{libvpx-1080p.ffpreset}.
2029 ffpreset files, but they only allow encoder- specific options. Therefore, an
2037 First ffmpeg searches for a file named @var{codec_name}-@var{arg}.avpreset in
2038 the above-mentioned directories, where @var{codec_name} is the name of the codec
2040 video codec with @code{-vcodec libvpx} and use @code{-pre 1080p}, then it will
2041 search for the file @file{libvpx-1080p.avpreset}.
2057 ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
2062 ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
2076 ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg
2083 ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg
2087 variable. 10 is the x-offset and 20 the y-offset for the grabbing.
2099 ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
2110 decoders. You must specify the size of the image with the @option{-s} option
2117 ffmpeg -i /tmp/test.yuv /tmp/out.avi
2128 ffmpeg -i mydivx.avi hugefile.yuv
2135 ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
2145 ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
2155 ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
2158 Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map
2166 ffmpeg -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
2170 output an AVI file with MPEG-4 video and MP3 audio. Note that in this
2171 command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
2173 input video. Furthermore, the audio stream is MP3-encoded so you need
2174 to enable LAME support by passing @code{--enable-libmp3lame} to configure.
2178 NOTE: To see the supported input formats, use @code{ffmpeg -demuxers}.
2185 ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
2189 output them in files named @file{foo-001.jpeg}, @file{foo-002.jpeg},
2193 above command in combination with the @code{-frames:v} or @code{-t} option,
2194 or in combination with -ss to start extracting from a certain point in time.
2198 ffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi
2201 The syntax @code{foo-%03d.jpeg} specifies to use a decimal number
2206 When importing an image sequence, -i also supports expanding
2207 shell-like wildcard patterns (globbing) internally, by selecting the
2208 image2-specific @code{-pattern_type glob} option.
2211 @code{foo-*.jpeg}:
2213 ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi
2220 ffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut
2229 ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
2236 ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
2243 @ifset config-all
2244 @ifset config-avutil
2245 @include utils.texi
2247 @ifset config-avcodec
2251 @ifset config-avformat
2255 @ifset config-avdevice
2258 @ifset config-swresample
2261 @ifset config-swscale
2264 @ifset config-avfilter
2273 @ifset config-all
2276 @ifset config-not-all
2277 @url{ffmpeg-all.html,ffmpeg-all},
2280 @url{ffmpeg-utils.html,ffmpeg-utils},
2281 @url{ffmpeg-scaler.html,ffmpeg-scaler},
2282 @url{ffmpeg-resampler.html,ffmpeg-resampler},
2283 @url{ffmpeg-codecs.html,ffmpeg-codecs},
2284 @url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
2285 @url{ffmpeg-formats.html,ffmpeg-formats},
2286 @url{ffmpeg-devices.html,ffmpeg-devices},
2287 @url{ffmpeg-protocols.html,ffmpeg-protocols},
2288 @url{ffmpeg-filters.html,ffmpeg-filters}
2292 @ifset config-all
2295 @ifset config-not-all
2296 ffmpeg-all(1),
2299 ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
2300 ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
2301 ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1)