FFMPEG(1) ( ) (NAME) ffmpeg - (SYNOPSIS) ffmpeg [_] {[_] -i _} ... {[_] _} ... (DESCRIPTION) ffmpeg . - - (Transcode) . ffmpeg "-i" . . () (////) . "-map" ( (STREAM SELECTION) ). ( 0 1 ). "2:3" . . . ( ) . -- . : o : ffmpeg -i input.avi output.mp4 o 64 : ffmpeg -i input.avi -b:v 64k -bufsize 64k output.mp4 o 24 : ffmpeg -i input.avi -r 24 output.mp4 o 1 24 : ffmpeg -r 1 -i input.m2v -r 24 output.mp4 (-f) . (DETAILED DESCRIPTION) ffmpeg ( ) . . : o (Demuxers) ( demultiplexers) : o o . -i (packets) . splitters . : | demuxer | | packets for stream 0 elementary stream 0 | | | | global |properties| | packets for stream 1 | and | elementary stream 1 | metadata | | | | | | | | ........... | | | | | | | | packets for stream N | | elementary stream N | | | | | read from file, network stream, | grabbing device, etc. | o (Decoders) (raw frames) ( PCM ) . ( ). : packets | | raw frames | decoder | | o (Filtergraphs) . . (simple) (complex) -filter -filter_complex . deinterlacing ( yadif) ( scale) : | simple filtergraph | frames from frames for a decoder | | an encoder | yadif | scale | | | . : | complex filtergraph | frames frames |input 0| overlay | overlay |output 0 | | | | frames | | | | | |input 1 | | | | frames frames |input 2|scale|split|output 1 o (Encoders) . (lossy) (lossless) . : raw frames | | packets | encoder | | o (Muxers) ( multiplexers) ( ) ( ) (Interleave) . : packets for stream 0 | | muxer | | elementary stream 0 | | | global | packets for stream 1 | |properties | | elementary stream 1 | and | | | metadata | | | | | | ........... | | | | | | packets for stream N | | | | elementary stream N | | | | | | write to file, network stream, | grabbing device, etc. | | (Streamcopy) ffmpeg streamcopy . INPUT.mkv OUTPUT.mp4 : | demuxer | | unused elementary stream 0 | | | |INPUT.mkv | | | packets | | muxer | | | elementary stream 1 | elementary stream 0 | | | | |OUTPUT.mp4 | | | | | unused | | elementary stream 2 | | | : ffmpeg -i INPUT.mkv -map 0:1 -c copy OUTPUT.mp4 : | demuxer 0| | packets | | muxer | elementary stream 0 |elementary stream 0 |INPUT0.mkv| | | |OUTPUT.mp4 | | | | | | demuxer 1| | packets |elementary stream 1 | | elementary stream 0 | | | |INPUT1.aac| | : ffmpeg -i INPUT0.mkv -i INPUT1.aac -map 0:0 -map 1:0 -c copy OUTPUT.mp4 : : | demuxer | | packets | | muxer 0 | elementary stream 0 |elementary stream 0 | | | | |OUTPUT0.mp4| |INPUT.mkv | | | packets | | elementary stream 1 | | muxer 1 | | | | |elementary stream 0 | |OUTPUT1.mp4| : ffmpeg -i INPUT.mkv -map 0:0 -c copy OUTPUT0.mp4 -map 0:1 -c copy OUTPUT1.mp4 (Transcoding) . . : | demuxer | | audio packets stream 0 (audio) | | | | |INPUT.mkv video raw | | | | packets | video | video frames | | | stream 1 (video) | decoder | | | | | | | | | | | | video | | | muxer | | packets | video | | | stream 0 (video) | encoder | | | | |(libx264)| | |OUTPUT.mp4 | | | | | | | stream 1 (audio) | | | | : ffmpeg -i INPUT.mkv -map 0:v -map 0:a -c:v libx264 -c:a copy OUTPUT.mp4 (Filtering) . : | demuxer | | video stream | packets | video | frames |INPUT.mkv | | decoder | | | | | | | | simple filtergraph | | | | | | yadif | scale | || | | | video | | muxer | | packets | video | | video stream | encoder |OUTPUT.mp4| | | | | | | (Loopback decoders) . "-dec" : ffmpeg -i INPUT \ -map 0:v:0 -c:v libx264 -crf 45 -f null - \ -threads 3 -dec 0:0 \ -filter_complex '[0:v][dec:0]hstack[stack]' \ -map '[stack]' -c:v ffv1 OUTPUT : | demuxer | | video stream | | video | | video | | null muxer | | INPUT | | decoder | encoder |(discards its input)| | | | | |(libx264)| | | | | | |loopback | | | decoder | | | | | | | | | | |complex filtergraph| | | | | | | | hstack | | || | || | | | | muxer | | | video | | video stream | encoder | OUTPUT | | | (ffv1) | | | | (STREAM SELECTION) ffmpeg "-map" . "-map" ffmpeg . "-vn / -an / -sn / -dn" . : o : (Resolution) . o : . o : ( ) . "-map" . (Manual stream selection) "-map" . (Examples) ffmpeg . : input file 'A.avi' stream 0: video 640x360 stream 1: audio 2 channels input file 'B.mp4' stream 0: video 1920x1080 stream 1: audio 2 channels stream 2: subtitles (text) stream 3: audio 5.1 channels stream 4: subtitles (text) input file 'C.mkv' stream 0: video 1280x720 stream 1: audio 2 channels stream 2: subtitles (image) : (automatic stream selection): ffmpeg -i A.avi -i B.mp4 out1.mkv out2.wav -map 1:a -c:a copy out3.mov . "-map" ffmpeg . out1.mkv . "stream 0" B.mp4 ( ) "stream 3" B.mp4 ( 5.1) ("stream 2" B.mp4) . out2.wav 3 B.mp4 . out3.mov "-map 1:a" (B.mp4) (-c:a copy) . : (automatic subtitles selection): ffmpeg -i C.mkv out1.mkv -c:s dvdsub -an out2.mkv : (unlabeled filtergraph outputs): ffmpeg -i A.avi -i C.mkv -i B.mp4 -filter_complex "overlay" out1.mp4 out2.srt (OPTIONS) SI : 'K' () 'M' () 'G' (). 'i' SI ( 1024 1000) : 'KiB', 'MiB', 'GiB'. 'B' 8 ( ). (Boolean) true . "no" -nofoo foo . '/' : ffmpeg -i INPUT -/filter:v filter.script OUTPUT filter.script . (Stream specifiers) ( ). . . "-codec:a:1 ac3" "a:1" ac3 . "-b:a 128k" 128 . . "-codec copy" . : stream_index ( -threads:1 4 4 ). stream_type[:additional_stream_specifier] : 'v' 'V' 'a' 's' 'd' 't' . 'v' 'V' . p:program_id[:additional_stream_specifier] program_id . #stream_id or i:stream_id ( PID MPEG-TS). m:key[:value] key value ( -map 0:m:language:fas ). u ( ). (Generic options) ff* . -L, -license (License). -h, -?, -help, --help [arg] . : long . full . decoder=decoder_name decoder_name. encoder=encoder_name encoder_name. demuxer=demuxer_name demuxer_name. muxer=muxer_name muxer_name. filter=filter_name filter_name. -version . -buildconf . -formats ( ). -demuxers . -muxers . -devices . -codecs libavcodec. -decoders . -encoders . -filters libavfilter. -protocols / ( http, rtmp, file). -loglevel [flags+] (LogLevel) : quiet, panic, fatal, error, warning, info, verbose, debug. -v loglevel -loglevel. -report log . -hide_banner . AVOptions libavformat libavdevice libavcodec . AVOptions -help . : . . ID3v2.3 ID3v2.4 MP3 MP3 : ffmpeg -i input.flac -id3v2_version 3 out.mp3 (Main options) -f fmt (/) . . -i url () . -y () . -n () . -stream_loop number () (Loop) . 0 -1 . -c[:stream_specifier] codec (/) -codec[:stream_specifier] codec (/) ( ) ( ) . codec / "copy" ( ) . : ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT libx264 . -t duration (/) . duration . -to position (/) position. -fs limit_size () . -ss position (/) (Seek) position ( 00:01:30 90). -sseof position () ( ). -timestamp date () . -metadata[:metadata_specifier] key=value () / ( title=" " author=" "). -disposition[:stream_specifier] value () ( default, forced, hearing_impaired). -target type () ( vcd, svcd, dvd, dv, pal-dvd). -filter[:stream_specifier] filtergraph () . -filter_complex filtergraph () / . (Video Options) -vframes number () ( -frames:v). -r[:stream_specifier] fps (/) ( 24, 30, 60 30000/1001). -fpsmax[:stream_specifier] fps () . -s[:stream_specifier] size (/) wxh ( 1920x1080 1280x720 hd1080). -aspect[:stream_specifier] aspect () (Display Aspect Ratio) ( 16:9 4:3). -vn (/) ( ). -vcodec codec (/) ( -codec:v). -pass[:stream_specifier] n () (1 2 two-pass). -vf filtergraph () -filter:v ( ). (Advanced Video options) -pix_fmt[:stream_specifier] format (/) (Pixel Format yuv420p, yuv444p, nv12, rgb24). -pix_fmts . -sws_flags flags (/) libswscale ( bicubic, lanczos, bilinear). -vstats 4 vstats_HHMMSS.log. -vstats_file file . -vtag fourcc/tag () / FourCC ( -tag:v). -force_key_frames[:stream_specifier] time[,time...] () (I- frame / Keyframe) ( HLS DASH). (Audio Options) -aframes number () ( -frames:a). -ar[:stream_specifier] freq (/) (Sampling Frequency) ( 44100 48000). -aq q () VBR ( -q:a). -ac[:stream_specifier] channels (/) ( 1 2 6 5.1). -an (/) ( ). -acodec codec (/) ( -codec:a aac, libmp3lame, opus, flac). -af filtergraph () -filter:a ( ). (Subtitle options) -scodec codec (/) ( -codec:s srt, subrip, ass, mov_text). -sn (/) ( ). -fix_sub_duration ( DVB). (Advanced options) -map [-]input_file_id[:stream_specifier][:view_specifier][:?] | [linklabel] () . : ( -i ) ( -filter_complex ). "-" . "?" . -re () ( Realtime). RTMP/RTSP . -benchmark () CPU . -shortest () ( ). (Preset files) = . '#' . vstats "-vstats" "-vstats_file" . (q) (PSNR) . (EXAMPLES) ffmpeg : ffmpeg -f alsa -ac 2 -i hw:0 -f video4linux2 -i /dev/video0 /tmp/out.mpg (X11 grabbing) (X11): ffmpeg -f x11grab -video_size 1920x1080 -framerate 30 -i :0.0 /tmp/desktop.mp4 :0.0 X11 ( DISPLAY). ffmpeg : o MP4 H.264 AAC: ffmpeg -i input.mkv -c:v libx264 -crf 23 -c:a aac -b:a 192k output.mp4 o ( ): ffmpeg -i video.mp4 -vn -c:a copy audio.aac o ( ): ffmpeg -i input.mp4 -r 1 -f image2 frame_%04d.jpg o 30 : ffmpeg -framerate 30 -i frame_%04d.jpg -c:v libx264 -pix_fmt yuv420p output.mp4 o 1 30 : ffmpeg -ss 00:01:00 -i input.mp4 -t 30 -c copy cut.mp4 (SEE ALSO) ffmpeg-all(1), ffplay(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) (AUTHORS) FFmpeg. Git git log FFmpeg . MAINTAINERS . FFmpeg 2026-09-07 FFMPEG(1)