I am using a ubuntu 16.04 server from Microsoft Azure. I want to use the server to reencode(from h24 to h265) video(mp4,mkv) files on it. I am using SSH to connect to the server. My server specs are 300GB SSD, 16GB RAM and a quad core processor. I used the following commands in handbrake 

HandBrakeCLI -i /path/to/input/file -o /path/to/output/ -e x265_10bit --width 854 -O

The process of re-encoding takes a lot of time over two hours for a 40 min 150MB video file. So are there any other tools I can use to speed up the process?

2 Answers 2


HEVC/H.265 encoding is extremely CPU/GPU intensive, therefore the only performance gains will be done by different hardw OR encode to 240P resolution.If you insist on using a virtualized instance on Azure you'll need an instance with GPU acceleration like the "NVv2 VM" and then you can use handbrake to convert faster because they give you access to a GPU from that VM. Using the GPU you can re-encode much faster then with CPU only. Personally I run on an 8th gen i3 running Ubuntu for a Plex server because it has the Intel HD630 which supports Quicksync which is one of the fastest ways to convert video. The HD630 is exactly the same in the i5 and i7 so there's no benefit to buying a more powerful CPU when using Quicksync. Handbrake when used with Quicksync the encoding speed will be MUCH faster. It boils down to choosing between paying for a VM with a GPU every month VS a new i3 8100 with the HD630 which is integrated with the CPU if you want to go faster with encoding at the original resolution since you are hitting physical hardware limitations on the Azure VM and no software can perform any faster at the same settings of exporting the file over handbrake.

  • So your recommended software... is to buy a new computer? Or gpu?
    – Xen2050
    Mar 16, 2019 at 4:33
  • The problem here is not of software nature but the actual hardware not being able to perform the task as fast as possible. So yes, I would have proposed the same. @Xen2050
    – Sonamor
    Mar 16, 2019 at 9:15
  • You see how your answer (to buy new hardware) is inappropriate for "Software Recommendations", maybe it should have been a comment instead
    – Xen2050
    Mar 17, 2019 at 4:25

There are a few other programs you can try, and many have lots of settings you can tweak to make them faster, lowering the quality should speed it up, if that's acceptable. I'm not sure which will happen to be faster on your system but you can time each with a smaller sample file to compare.

  • See this answer on askubuntu for more details on:

      1. sudo apt-get install ffmpeg libavcodec-extra
      2. ffmpeg -i input -c:v libx265 -preset slow -x265-params crf=22 -c:a libmp3lame -b:a 128k output.mp4
    • ffmpeg -i input_file.mpg -pix_fmt yuv420p -f yuv4mpegpipe - | x265-10bit --profile main10 --preset slower --crf 20 --input - --y4m -o output_file.mpg

  • See this answer on Unix & Linux if you want a lossless conversion with ffmpeg:

    • ffmpeg -i INPUT.mkv -c:v libx265 -preset ultrafast -x265-params lossless=1 OUTPUT.mkv

    • I've recently gone through the trouble of Transcoding my whole video catalog over to HEVC. I use https://github.com/FallingSnow/h265ize with the following settings.

      h265ize -v -m medium -q 20 -x --no-sao --aq-mode 3 --delete --stats


      I've started to transcode all my Movies over too, however, that's an ongoing process, as I have to ID quality levels (Radarr fortunately labels then nicely) and use one of three transcode settings:

      -m slower -q 18 -x --no-sao --aq-mode 3 for 720p transcodes

      -m medium -q 20 -x --no-sao --aq-mode 3 for 1080p

      -m medium -q 22 -x --no-sao for 2160p

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.