FFmpeg
Converting and compressing video, cutting without re-encoding, extracting audio and frames, GIFs and file info.
Info
Streams, codecs and duration
ffprobe -hide_banner <file>
Same as JSONadvanced
ffprobe -v quiet -print_format json -show_format -show_streams <file>
Converting
Change container without re-encoding (fast)
ffmpeg -i input.mkv -c copy output.mp4Compress to H.264 (smaller file)
ffmpeg -i input.mov -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k output.mp4CRF 18-28: lower is better quality and bigger file.
Resize to 720p keeping aspect ratio
ffmpeg -i input.mp4 -vf scale=-2:720 -c:a copy output-720p.mp4Web-friendly MP4 (starts playing before fully loaded)advanced
ffmpeg -i input.mp4 -c copy -movflags +faststart output.mp4Cutting and extracting
Cut a fragment without re-encoding
ffmpeg -ss 00:01:30 -to 00:02:45 -i input.mp4 -c copy clip.mp4Extract audio to MP3
ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 audio.mp3Remove the audio track
ffmpeg -i input.mp4 -c copy -an silent.mp4One frame as an image
ffmpeg -ss 00:00:10 -i input.mp4 -frames:v 1 frame.jpgGood-quality GIFadvanced
ffmpeg -i input.mp4 -vf "fps=12,scale=640:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse" out.gifJoin files with the same codecsadvanced
printf "file '%s'\n" part*.mp4 > list.txt && ffmpeg -f concat -safe 0 -i list.txt -c copy joined.mp4