FFMPEG H265 Video re-encode only

As a video with h265 can have a size divided by 2 for the same quality, i think that knowing how to convert video to h265 without changing anything else is a good things

If we want to re-encode just the video streams, but copy all the other streams (like audio, subtitles, attachments, etc), we might use something like this:

ffmpeg -i input.mkv -map 0 -c copy -c:v libx265 -crf 23 output.mkv

It will tell ffmpeg to:

  • read the input file 'input.mkv'
  • select all the input streams (first input = 0) to be processed (using "-map 0")
  • mark all the streams to be just copied to the output (using "-c copy")
  • mark just the video streams to be re-encoded (using "-c:v libx265")
  • write the output file 'output.mkv'

The "-crf 23" part should be adjust with your quality wish, the better the quality is, the slower the conversion will be.

For your help i've prepared a script that will handle this command for you and can take jocker "*" :

Good conversion !