⭠ Back to MegaDB Search

Grenff | 102 points | Aug 30 2017 05:40:26

[How To] Encode in x265/H.265/HEVC for the impatient ones via the graphics card's hardware encoder using XMedia Recode | Megalinks MegaDB [How To] Encode in x265/H.265/HEVC for the impatient ones via the graphics card's hardware encoder using XMedia Recode

I tried to comment a post about x265 encoding in the Everybody Loves Raymond thread, but it looks like I am lacking the rights to comment.

So I start this new thread, about a quick how to encode in x265/H.265/HEVC for the impatient ones who own a NVIDIA graphics card with a x265/H.265/HEVC hardware encoder (e.g. GTX 1060).

Encoding with your graphics card is blindingly fast. Transcoding a full Everybody Loves Raymond season (24 episodes, 9 hours) from 720p/x264 to 720p/HEVC takes only about 19 minutes. The same transcoding would take me probably around 4-5 hours if done by CPU (i7).

Unfortunately, encoding by graphics card needs more bitrate for the same quality the pure CPU encoding would deliver. I usually target only a 50% size reduction when I transcode from x264 to HEVC with the graphics card. But I have not made a science out of this, so I could be wrong.

So here is the quick & dirty How To based on the (freeware) software XMedia Recode (http://www.xmedia-recode.de/en/index.html): | Megalinks MegaDB So here is the quick & dirty How To based on the (freeware) software XMedia Recode (http://www.xmedia-recode.de/en/index.html):

  1. Drag & Drop all the files you like to transcode into XMedia recode.

  2. Mark all the files (assuming you want to encode all of them with the same settings).

  3. Format tab: choose format "Matroska".

  4. Video tab: choose codec "HEVC / H.265 (NVIDIA NVENC)" and adjust the bitrate to your preferences (for Everybody Loves Raymond (720p) I chose min 1500 and max 15000 and went from 670 MB (x264) to 270 MB (HEVC) file size per episode) - for 1080p movies I usually choose min 3500 and max 20000. Sometimes I use more bitrate - especially when there is a lot of film grain, action or eye candy - and sometimes less (e.g. animated movies).

  5. Audio tab: switch mode to copy (add extra tracks if desired).

  6. Subtitle tab: switch the mode to "copy" and then choose the subtitles you like to keep (important: choose "copy" first and then select the subtitles or the subtitles will be rendered into the movie).

  7. Set the destination for the files at the bottom of the main window and then click on the "add to queue" button.

  8. Look in the jobs tab and make sure everything is o.k. ....codecs, bitrates, framerates, copied audio and subtitles...

  9. Hit the "Encode" button.

Check the quality. If you don't like it, increase the video bitrate and encode it again - encoding is so insane fast, you can just do that.

Again, I have not made a science out of these settings, so these are probably not the best. But for me they are getting the job done.

permalink


[-] douchebanner | 25 points | Aug 30 2017 07:51:57

please, dont do this, hardware encoding is a waste of bandwidth, if you care so much about speed just use one of the fast presets on h264 and you should get better quality at a smaller size at a reasonable speed.

just because h265 is newer than h264 doesnt mean that everyone should be using it, specially hw h265.

hw encoding is ok when you dont care about size but for sharing... just dont.

permalink

[-] oeffoeff | 5 points | Aug 30 2017 21:22:42

This. I think hw-encoding is good if you want to stream, otherwise I would always prefer sw encoding. Quality is much better.

permalink

[-] w00denspoon | 3 points | Aug 31 2017 14:16:43

Yea, nvidia hevc looks like garbage when low bitrate. Its simply meant for speed at all costs. https://www.techspot.com/article/1131-hevc-h256-enconding-playback/page7.html

permalink

[-] MrTattyBojangles | 4 points | Aug 30 2017 14:36:30

It works for UTR.

permalink

[-] Axelstrife | 2 points | Aug 30 2017 08:14:52

Isnt hardware encoding the one you use CPU ?

permalink

[-] douchebanner | 6 points | Aug 30 2017 08:58:09

gpu

permalink

[-] EvolutionVII | 1 points | Aug 30 2017 08:54:18

if you care so much about speed just use one of the fast presets on h264 and you should get better quality at a smaller size at a reasonable speed.

but you get a shitty output compared to low bitrate H265

permalink

[-] douchebanner | -4 points | Aug 30 2017 09:12:07

depends on how low you want to go, h264 is sharper at reasonable bit rates compared to the soft diarrhea h265 squirts at any bit rate, and its faster than h265 and more compatible. the small difference in file size is not worth the excessive encoding time and the softer video

permalink

[-] EvolutionVII | 1 points | Aug 30 2017 09:16:45

I'm refering to <4mbits with fast action sequences

permalink

[-] douchebanner | 2 points | Aug 30 2017 09:44:29

hmmm... youre talking 1080p at less than 4mbits... yeah, at that bitrate sw h265 should have the upper hand

i always use 2-pass so thats what im referring to, and i was comparing it to hw h265.

using 2-pass you can have fast and slow scenes on the same movie , the bitrate gets distributed accordingly.

im not saying h265 is shit, but hw encoding tends to be shit at lower bitrates compared to sw fast presets (2pass).

is the "breaking point" of sw h265 lower than h264? sure. is it worth the extra encoding time? not for me.

permalink

[-] sarinth | 1 points | Aug 30 2017 10:17:23

Can you guide me to set up good compression setting in Handbrake? I'm using h.265 encoder, 1500 avg bitrate with 2-pass encoding. This setting is relatively slow but results are very good - compression/quality

permalink

[-] mteg | 2 points | Sep 01 2017 21:00:04

You're wasting both encoding time and hardware space : don't use 2-pass encoding.

Aim for a quality, then you'll sometimes get smaller files than you expected, sometimes bigger but on average (on your hard drive). It will take the same GB than 2 pass, except that two pass will give you some movies where you're wasting space (since you won't notice the quality increase from the quality you were settling for) and some where the quality will be shitty because you didn't spend the bitrate when needed. You'll also have wasted CPU time on the first pass (but that's less of a problem, except your post was about the long time it took to encode in the first place...

permalink

[-] douchebanner | 1 points | Aug 30 2017 17:17:04

i dont use handbrake, sorry. 1500? wow

permalink

[-] Axelstrife | 8 points | Aug 30 2017 07:36:06

Thanks here's one i did Stargate ark of truth original file i had is 7.92GB (largest i could find at the time of download) and after it's 4.26GB x265. http://screenshotcomparison.com/comparison/116088 Not too bad though the original file i had wasn't the best.

permalink

[-] AeroRandy | 2 points | Aug 30 2017 20:56:44

Wouldn't it be better to take a screenshot of a fast paced scene? That's where things usually go to shit in compressed videos.

permalink

[-] Axelstrife | 1 points | Aug 31 2017 04:28:16

Yeah ofc it doesn't look nearly as good. Can't wait for coffeelake CPU's so i can buy I7 8700 or Ryzen 1700 depending on whats better and encode thing in my lifetime. my i5 6400 sucks.

permalink

[-] MrTattyBojangles | 1 points | Aug 30 2017 14:35:43

Nice, the difference is barely noticeable.

permalink

[-] Axelstrife | 1 points | Aug 30 2017 15:10:53

it's not too bad Here is a better example.

https://drive.google.com/open?id=0B2L-MFr5wlCaN0R4RzQ3cl9Eakk

^ Original file Grym 17.3GB x264

https://drive.google.com/file/d/0B2L-MFr5wlCaV0htTVpXRnFJb0k/view

^ x265 8.32GB

Not too bad since it took 15 minutes to cut the size in half with VERY little Image quality loss. Im sure CPU encoding would too a better job at making them file size smaller though.

I used google drive since that site before i noticed massive loss of quality when uploading these images.

permalink

[-] tiederian | 1 points | Sep 01 2017 12:50:03

What settings did you use to achieve this? I tried it with an episode of Elementary and had pretty dire results.

permalink

[-] Mac10Pro | 6 points | Aug 30 2017 22:06:17

Can all refrain from saying 'Little' image quality loss, when that's as far from the truth as you can get. I compared a Guardians of the Galaxy Vol.2 x264 with a x265, 30gb/17gb and the 'little' loss is significant; you can no longer see the individual hair strands of the characters. That's not 'little'. That's a motherfucking shit load of image quality gone... Rant aside, I have a 1080ti so I might do this for fun xD

permalink

[-] riade3788 | 1 points | Feb 25 2018 23:19:08

you are simply wrong ....I encoded such stuff at 4k and lost almost no quality on 50' screen at 4k x265 is just better as long you are using blueray source...

permalink

[-] Redditor20121 | 2 points | Aug 30 2017 14:10:39

For somebody with AMD GPU (RX 480/550 etc..) you can use A's Video converter which is also very fast.

http://bluesky23.yukishigure.com/en/AsVideoConv.html

permalink

[-] R3a1ityCheque | 2 points | Aug 30 2017 16:26:05

Any really solid guides on how to do this with handbrake (and the best settings)?

permalink

[-] ecchh | 2 points | Aug 30 2017 17:53:26

Use handbrake nightly with CRF 20 or CBR 3500k on slow preset.

permalink

[-] R3a1ityCheque | 1 points | Aug 30 2017 18:20:18

Thanks for the advice. Have tried a few encodes with it but haven't been satisfied with the quality so far (too much pixelation in dark scenes) but that's def different to the presets I was using. Cheers!

permalink

[-] mteg | 1 points | Sep 01 2017 21:17:02

CRF 18 or 17 can be necessary for some movies. grain profile also sometimes, heard they even improved it in the latest releases.

Pixelation in dark scenes may also be the sign of a low quality screen, where blacks aren't as black as they should be. If you're not supposed to see anything else than black at the theater, there's little point in keeping them just because somewhere someone on the Internet likes his luminosity at 100% on a crappy LCD screen.

As for problems in moving scenes (other posters), neither x265 nor x264 were made to provide wonderful screenshots. If you're pausing to compare, you're doing it wrong - compare VIDEO samples, not your mom's scrapbook.

permalink

[-] tallgf | 2 points | Aug 30 2017 16:31:19

will this work on a Radeon HD7870?

permalink

[-] ecchh | 2 points | Aug 30 2017 17:52:18

You can also do the same with StaxRip.

permalink

[-] w00denspoon | 2 points | Aug 31 2017 13:23:43

From what I know the only advantage to hardware encoding is for streaming, because otherwise the low quality encoding is simply no different from h.264 quality if not worse from what I remember. The only purpose is to minimize framerate hit when gaming and encoding to share at the same time, hardware encoders still can't do this kind of stuff right at all.

permalink

[-] tiederian | 2 points | Sep 01 2017 12:46:18

I tried this out and the results were abysmal. As you can see, slight loss in quality with CRF 22 SW encoding, massive loss with xmedia HW encoding. I even tried upping the minimum bitrate with xmedia to 8000 out of curiosity, and the quality was still far worse and the file was 900mb larger.

https://drive.google.com/file/d/0B7g69TCdbPEoeFJEc0Roc2c2ZWM

^ Elementary S02E01 1.6gb x264

https://drive.google.com/file/d/0B7g69TCdbPEoUmdjVm5MbkQzWmc

^ 1gb x265 3000-20000 VBR with xmedia

https://drive.google.com/file/d/0B7g69TCdbPEoaVhrM3NILWNXb3M

^ 745mb x265 CRF 22 with Handbrake Nightly

permalink

[-] CameraMan1 | 1 points | Aug 30 2017 08:21:39

link is down

EDIT: jk you just need to delete a couple characters

permalink

[-] YouWantShopped | 1 points | Aug 30 2017 10:13:39

Don't bother reencode 720p with x265. HEVC 50% reduction margin only benefit larger resolution videos. 1080p+

permalink

[-] Plays_You_Wonderwall | 1 points | Aug 30 2017 14:42:33

Not sure if it's related but wonder if you can help.

My roku hates the audio on the x265 4K files. Think it has to do with multiple audio tracks. Trying to encode the audio only to something like ac3 or aac.

When I try to keep video but encode audio on xmedia it doesn't work. Open the 4K file and the radio button only let's me select audio only, the other selections are greyed out.

Another option I've looked at is ffmpeg via command line.

permalink

[-] mteg | 3 points | Sep 01 2017 21:20:42

I use MKVToolnixGUI, extract the audio, run this little script:

!/bin/bash

for a in *.mka; do f="${a[@]/%mka/aac}" ffmpeg -i "$a" -strict experimental -c:a aac -qscale:a 4 "$f" done

(-qscale:a 4 is overkill, but in case I have to share it with DTS weeaboos that makes sure there won't be any audible quality difference with a blind test).

Then remix with MKVToolnixGUI.

permalink

[-] Plays_You_Wonderwall | 2 points | Sep 01 2017 23:16:15

Thanks, I figured out a way to convert it finally last night.

Extract only english audio using MKVTool and encode audio only from DTS to AAC using ffmpeg.

permalink

[-] j3tstream | 1 points | Aug 30 2017 15:35:26

in w7 x64 and totally freezes upon pressing encode... any one know whats up with that?

permalink

[-] DogFriedRice13 | 1 points | Aug 30 2017 20:06:34

Can you do 10bit with XMedia?

permalink

[-] Lemongreen201503 | 1 points | Nov 29 2017 09:47:27

Although performance is significantly improved by using Nvidia’s HEVC encoder, NVENC, but it comes at a cost of quality. Simply put, you’re not going to get as good a quality at the same bitrates using Nvidia’s encoder compared to using Handbrake.

permalink

[-] Nippy69 | 0 points | Aug 30 2017 10:46:04

Can't you also use handbreak to encode x265 wouldn't that be faster since it's not internet based like xmedia.

permalink

[-] AReallyScaryGhost | -1 points | Aug 30 2017 10:21:32

It's beyond me why people are so obsessed with x265 and still talk about quality.

permalink

[-] commit_bat | 18 points | Aug 30 2017 11:54:36

Better quality at same bitrate sounds pretty straightforward to me.

permalink

[-] Apansy | 5 points | Aug 31 2017 07:12:20

A lot of x265 encoders have been doing it wrong and that is why x265 looks bad. But a well encoded x265 without targeting a low bitrate/filesize will look great.

permalink

[-] clrksml | 1 points | Nov 03 2017 18:29:03

It's beyond me why people bother to encode h265. When most android devices on the market don't support h265. You have to transcode it to a playable format like h264 or mpeg.

permalink