{"id":2033,"date":"2020-04-21T16:15:07","date_gmt":"2020-04-21T14:15:07","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=2033"},"modified":"2020-08-20T17:33:52","modified_gmt":"2020-08-20T15:33:52","slug":"how-fast-is-your-amd-h-264-and-h-265-hevc-gpu-encoder","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/2033","title":{"rendered":"How fast is your AMD H.264 and H.265\/HEVC GPU encoder?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Just a small tool here to try a few of a popular resolutions and measure video encoding latency. The encoder is running in configuration to address needs of real-time encoding with speed over quality setup. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note that the performance might be affected by side load, such as graphics application (I often use <a href=\"https:\/\/alax.info\/blog\/1956\">this application<\/a> for my needs with parameters that produce higher or lower GPU load). Also, the application itself is using Direct2D to generate actual input video frames so this activity also has certain impact, presumably low enough due to primitive operations, yet still. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The main point here is to measure the latency in first place for a particular piece of hardware, see how things possibly improve with driver updates, and how codecs compare one to the other and what is the effect of the resolution choice. Also, the question is whether the encoder is fast enough to process data real-time in first place.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The application keeps drawing a simple chart and then the same data is fed into encoder. The application writes raw elementary stream into .H264 and .H265 files respectively (use <a href=\"https:\/\/mpc-hc.org\/\">Media Player Classic<\/a> to play them out), also saves last frame as a .PNG file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/04\/20200421-150830-1280x720@120.h265-800x450.png\" alt=\"\" class=\"wp-image-2034\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/04\/20200421-150830-1280x720@120.h265-800x450.png 800w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/04\/20200421-150830-1280x720@120.h265-320x180.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/04\/20200421-150830-1280x720@120.h265-768x432.png 768w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/04\/20200421-150830-1280x720@120.h265-600x338.png 600w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/04\/20200421-150830-1280x720@120.h265-1040x585.png 1040w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/04\/20200421-150830-1280x720@120.h265.png 1280w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">You will need to let the application run for a bit because it attempt to encode 30 seconds for every resolution. Finally there also is a summary printout (also also the app would share the summary with a Telegram bot).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Below, for example, are results with my Radeon RX 570 Series video card in development machine.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\>AmaEncode\nDXGI_ADAPTER_DESC1.Description: Radeon RX 570 Series\nVideo: 1280 x 720, 32-bit RGB, 60.00 frames per second, 30 seconds\nFile: C:\\20200421-151329-1280x720@60.h264\nAverage Encoding Time: 6.32 ms\nElapsed Time: 30.0 seconds (100.05% to expected)\n\nVideo: 1280 x 720, 32-bit RGB, 120.00 frames per second, 30 seconds\nFile: C:\\20200421-151359-1280x720@120.h264\nAverage Encoding Time: 6.26 ms\nElapsed Time: 30.0 seconds (100.08% to expected)\n\nVideo: 1920 x 1080, 32-bit RGB, 60.00 frames per second, 30 seconds\nFile: C:\\20200421-151429-1920x1080@60.h264\nAverage Encoding Time: 10.64 ms\nElapsed Time: 30.0 seconds (100.16% to expected)\n\n&#91;...]\n\nVideo: 3840 x 2160, 32-bit RGB, 30.00 frames per second, 30 seconds\nFile: C:\\20200421-151846-3840x2160@30.h264\nAverage Encoding Time: 36.38 ms\nElapsed Time: 30.1 seconds (100.34% to expected)\n\n&#91;...]\n\n1280x720@60     6.32\n1280x720@120    6.26\n1920x1080@60    10.64\n1920x1080@72    10.60\n1920x1080@90    10.88\n1920x1080@120   12.35\n1920x1080@144   FAIL\n2560x1440@60    17.46\n2560x1440@72    215.39\n2560x1440@90    FAIL\n3840x2160@30    36.38\n3840x2160@60    FAIL\n\nVideo: 1280 x 720, 32-bit RGB, 60.00 frames per second, 30 seconds\nFile: C:\\20200421-152014-1280x720@60.h265\nAverage Encoding Time: 6.25 ms\nElapsed Time: 30.0 seconds (100.06% to expected)\n\n&#91;...]\n\nVideo: 3840 x 2160, 32-bit RGB, 30.00 frames per second, 30 seconds\nFile: C:\\20200421-152521-3840x2160@30.h265\nAverage Encoding Time: 31.29 ms\nElapsed Time: 30.1 seconds (100.33% to expected)\n\n&#91;...]\n\n1280x720@60     6.25\n1280x720@120    6.15\n1920x1080@60    10.01\n1920x1080@72    10.01\n1920x1080@90    10.14\n1920x1080@120   10.08\n1920x1080@144   FAIL\n2560x1440@60    15.71\n2560x1440@72    15.91\n2560x1440@90    FAIL\n3840x2160@30    31.29\n3840x2160@60    FAIL\n\nFinalizing... results submitted\n\nC:\\><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">AMD&#8217;s implementation here is a bit faster and more performant in the case of HEVC codec, compared to AVC. The numbers are close but as it can be seen H.265\/HEVC can process 2560&#215;1440@72. In the case of H.264\/AVC encoding the encoder is choking &#8211; yet it can still process 2560&#215;1440@60.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, there will be a run for H.264 encoding, and then &#8211; if the hardware has a capable encoder of course &#8211; H.265\/HEVC run. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And yeah, it&#8217;s AMD only (via <a href=\"https:\/\/github.com\/GPUOpen-LibrariesAndSDKs\/AMF\">AMF<\/a>). NVIDIA goes next week.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On your marks!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Download links<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Binaries:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li> 64-bit: <a href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/08\/AmaEncode-20200820-0bab464f84e7ebf3e6a2ac41f0d4dc5dfd679bf7.zip\">AmaEncode.exe<\/a>  (in .ZIP archive)<\/li><li> License: This software is free to use<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just a small tool here to try a few of a popular resolutions and measure video encoding latency. The encoder is running in configuration to address needs of real-time encoding with speed over quality setup. Note that the performance might be affected by side load, such as graphics application (I often use this application for&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/2033\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[553,554,379,504,540,486],"class_list":["post-2033","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-amd","tag-amf","tag-h-264","tag-h-265","tag-hevc","tag-video"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/2033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=2033"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/2033\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=2033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=2033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=2033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}