Re-encode video while preserving audio, subtitles, chapters, etc.
ffmpeg -i input.mkv -map 0 -c:a copy -c:s copy -c:v libx264 -preset slow -tune film output.mkvffmpeg -i input.mkv -map 0 -c:a copy -c:s copy -c:v libx264 -preset slow -tune animation output.mkvgrain: preserves the grain structure in old, grainy film materialstillimage: good for slideshow-like contentfastdecode: allows faster decoding by disabling certain filterszerolatency: good for fast encoding and low-latency streaming
Read Encode/H.264 for more details.
ffmpeg -i input.mkv -map 0 -c copy output.mkvffmpeg -i input.mkv -map 0 -c copy -an output-no-audio.mkvffmpeg -i input.mkv -map 0 -c copy -vn output-no-video.mkv