

Join multiple video files into one: printf "file '%s'\n". Split video file into multiple parts of 20 seconds each: ffmpeg -i input.mp4 -map 0 -c copy -segment_time 00:20:00 -f segment -reset_timestamps 1 output%03d.mp4 Get information about file: ffmpeg -i input.mp4 -hide_bannerĬonvert from MP4 container to MKV: ffmpeg -i input.mp4 output.mkvĬopy everything but re-encode audio: ffmpeg -i input.mp4 -map 0 -c copy -c:a libmp3lame output.mp4Ĭopy everything but re-encode video: ffmpeg -i input.mkv -map 0 -c copy -c:v mpeg2video output.mkvĬreate sample of 2 minutes: ffmpeg -ss 00:10:00 -i input.mp4 -t 00:02:00 output.mp4Įxtract audio track only from video file: ffmpeg -i input.mp4 -vn audio.mp3Įxtract video track only from video file: ffmpeg -i input.mp4 -an video.mp4Įxtract video, audio and subtitle to separate files: ffmpeg -i input.mkv -map 0:0 video.mkv -map 0:1 audio.mkv -map 0:2 subtitle.srtĮxtract and convert WebVTT subtitle to SubRip format: ffmpeg -txt_format webvtt -i input.mkv subtitle.srtĮxtract and convert multiple WebVTT subtitles to SubRip format: ffmpeg -txt_format webvtt -i input.mkv -map 0:2 -map 0:3 Īdd subtitles to a video (with appropriate metadata): ffmpeg -i input.mp4 -i -i -map 0 -map 1 -map 2 -metadata:s:s:0 language=spa -metadata:s:s:1 language=eng -c copy output.mp4Ĭhange resolution of video: ffmpeg -i input.mp4 -filter:v scale=1280:720 output.mp4Ĭrop video: ffmpeg -i input.mp4 -filter:v crop=640:480:100:100 output.mp4 Show supported protocols: ffmpeg -protocols Show supported demuxers and muxers: ffmpeg -formats Show supported encoders: ffmpeg -encoders Show supported decoders: ffmpeg -decoders See FFmpeg version and compile flags: ffmpeg -version
