xpra icon
Bug tracker and wiki

Changes between Version 56 and Version 57 of Encodings


Ignore:
Timestamp:
01/12/17 11:46:41 (3 years ago)
Author:
Antoine Martin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Encodings

    v56 v57  
    1010{{{#!div class="box"
    1111== Introduction ==
    12 Xpra supports a number of picture encodings, provided you have the required libraries installed. Even then, the features of each encoding may vary based on the version of the libraries and other dependencies, both client and server side.
     12Xpra supports a number of picture and video encodings provided you have the required libraries installed. Even then, the features of each encoding may vary based on the version of the libraries and other dependencies, both client and server side.
    1313[[BR]]
    14 Here is the list as of v0.13
     14Here is the list as of v1.0
    1515* lossless encodings:
    16  * {{{rgb}}}: {{{rgb24}}} for regular windows, {{{rgb32}}} for transparency support (compressed with zlib or lz4, just like [/wiki/PacketEncoding#Compression packet compression])
     16 * {{{rgb}}}: {{{rgb24}}} for regular windows, {{{rgb32}}} for transparency support (compressed with zlib, lzo or lz4, just like [/wiki/PacketEncoding#Compression packet compression])
    1717 * {{{png}}} (24/32-bit colour), {{{png/L}}} (8-bit grayscale) and {{{png/P}}} (8-bit colour palette)
    18  * [/wiki/Encodings/webp webp] (lossless mode)
     18 * [/wiki/Encodings/webp webp] (lossless mode - deprecated)
    1919* lossy encodings:
    2020 * {{{jpeg}}}
    21  * [/wiki/Encodings/webp webp] (lossy mode)
     21 * [/wiki/Encodings/webp webp] (lossy mode - deprecated)
    2222 * [/wiki/Encodings/vpx vpx] (VP8 and VP9)
    2323 * [https://sidbala.com/h-264-is-magic/ H264] (H264 is Magic): either using [/wiki/Encodings/x264 x264] or [/wiki/Encodings/nvenc nvenc]
    2424 * {{{h265}}} using {{{x265}}} (not usable, far too slow)
    25  * {{{xvid}}} slower than x264 and vpx (see #1142)
     25 * {{{xvid}}} slower than x264 and vpx (see #1142 - deprecated)
    2626
    2727Good read: [https://haasn.xyz/posts/2016-12-25-falsehoods-programmers-believe-about-%5Bvideo-stuff%5D.html Falsehoods programmers believe about video]
     
    3131== Choosing an Encoding ==
    3232The default mode is automatic and should be the best option in most cases: it will adapt to changes in both bandwidth conditions and content.
     33
    3334But if you have specific needs, the best thing to do is to try them all and choose the one that provides the best results.
     35
     36[[BR]]
    3437
    3538Here are some rough guidelines:
    3639* if you have the required hardware, use [/wiki/Encodings/nvenc NVENC]
    37 * on LANs with 100Mbps or higher: {{{rgb}}} + zlib/lz4 should give you the best latency possible (whilst consuming quite a lot of bandwidth in the process..)
    38 * to save a little bit of bandwidth at the expense of framerate and latency but keep a lossless picture, try {{{png}}} or {{{webp}}}
     40* on LANs with 100Mbps or higher: {{{rgb}}} + zlib/lz4 should give you the best latency possible but consume quite a lot of bandwidth in the process..
     41* to save a little bit of bandwidth at the expense of framerate and latency but keep a lossless picture, try {{{png}}} - this is very CPU intensive
    3942* otherwise, choose {{{h264}}}, {{{vp8}}} or {{{vp9}}} and tune the speed/quality to suit your needs (see below)
    4043
     
    4851== [/wiki/CSC Colourspace conversion step - CSC] ==
    4952
    50 Before passing the pixels to the video encoder, we may or may not include a colourspace conversion step, (some newer versions of x264 support {{{BGRA}}} pixels as input directly) it is required when downscaling the video.
     53Before sending the pixels to the video encoder, xpra may need to first call a colourspace conversion step, (some newer versions of x264 support {{{BGRA}}} pixels as input directly) it is also required when downscaling the video.
    5154
    5255See: [/wiki/CSC Colourspace conversion step - CSC]
    5356}}}
     57
    5458
    5559{{{#!div class="box"
     
    6064Be aware that the lossless auto-refresh will trigger a lossless frame encoded using png or rgb. If the delay is too low, it may negate the benefits of using efficient compression.
    6165
    62 
    6366=== Notes ===
    6467When comparing performance, make sure that you use the right metrics... The number of updates per second is not always a good one (if there are more small regions, this can be a good or a bad thing), more examples here: [/wiki/Testing#MisleadingStatistics Misleading Statistics]
    65 }}}
    66 
    67 
    68 {{{#!div class="box"
    69 == Statistics ==
    70 
    71 As part of encoding improvements (mostly in #419), we have collected encoding performance statistics for 4 still test pictures using the current crop of codec code (pre-release version 0.13).
    72 These encodings are also used when a video encoding is selected as primary encoding, this is done to optimize bandwidth and CPU usage: video encodings require a full frame everytime, so we use still picture encodings for smaller regions and for automatic lossless refresh.
    73 
    74 |||||||||| Mode ||||=Desktop 2560x1600=||||=Browser 1920x1080=||||=Diagram 640x800||||=Small Alpha 64x48||
    75 ||Encoding||Compressor||Preset||Quality||Speed||MPixels/s||comp||MPixels/s||comp||MPixels/s||comp||MPixels/s||comp||
    76 ||png||PIL (old)||optimized|| || 0|| 1.6|| 8.1||
    77 ||png||PIL (old)|| || || 100|| 6.5|| 8.5||
    78 ||png||PIL|| || || 100|| 11.6|| 10.0|| 16.1|| 3.1|| 14.6|| 5.0|| 6.0|| 30.1||
    79 ||png/P||PIL|| || || 100|| 21.8|| 4.7|| 17.2|| 9.0|| 23.9|| 3.9|| 2.2|| 14.0||
    80 ||png/L||PIL|| || || 100|| 24.3|| 3.8|| 31.1|| 1.4|| 29.7|| 2.6|| 7.6|| 4.7||
    81 ||webp||PIL|| || 0|| || 5.5|| 0.5|| 6.3|| 0.5|| 5.9|| 0.7|| 0.4|| 13.4||
    82 ||webp||PIL|| || 50|| || 5.1|| 2.1|| 6.0|| 1.1|| 5.6|| 1.6|| 0.4|| 16.7||
    83 ||webp||PIL|| || 100|| || 4.3|| 6.2|| 5.9|| 3.1|| 5.3|| 4.3|| 0.4|| 28.8||
    84 ||jpeg||PIL||optimized|| 0|| || 71.0|| 0.5|| 68.5|| 0.4|| 80.6|| 0.5|| 16.6|| 3.2||
    85 ||jpeg||PIL|| || 50|| || 86.0|| 3.1|| 68.1|| 1.9|| 68.2|| 2.5|| 12.7|| 8.8||
    86 ||jpeg||PIL||optimized|| 100|| || 48.0|| 10.8|| 56.8|| 5.7|| 56.0|| 7.7|| 9.5|| 26.1||
    87 ||jpeg||PIL|| || 100|| || 72.0|| 13.0|| 58.4|| 5.7|| 56.5|| 7.7|| 8.4|| 26.1||
    88 ||rgb||lz4|| || || 100|| 224.0|| 15.0|| 497.0|| 4.3|| 526.0|| 6.9|| 76.7|| 56.0||
    89 ||rgb||zlib|| || || 50|| 21.0|| 9.1|| 30.2|| 2.5|| 27.8|| 3.1|| 11.3|| 39.4||
    90 ||webp||python-webm|| || 0|| || 6.0|| 0.8|| 6.7|| 0.5|| 6.2|| 0.7|| 0.5|| 13.4||
    91 ||webp||python-webm|| || 50|| || 5.3|| 2.1|| 6.5|| 1.1|| 5.7|| 1.6|| 0.6|| 16.7||
    92 ||webp||python-webm|| || 100|| || 0.3|| 4.8|| 1.0|| 0.7|| 0.7|| 1.6|| 0.1|| 25.0||
    93 ||webp||Cython||TEXT|| 0|| 100|| 18.6|| 0.6|| 19.4|| 0.4|| 18.9|| 0.6|| 1.5|| 2.9||
    94 ||webp||Cython||TEXT|| 50|| 100|| 15.5|| 2.7|| 17.7|| 1.5|| 16.6|| 2.2|| 1.2|| 11.9||
    95 ||webp||Cython||TEXT|| 99|| 100|| 12.6|| 6.7|| 15.2|| 3.3|| 13.9|| 4.6|| 0.8|| 29.7||
    96 ||webp||Cython||TEXT + lossless|| 100|| 0|| 0.1|| 4.9|| 0.6|| 0.7|| 0.3|| 1.6|| 0.0|| 24.7||
    97 ||webp||Cython||TEXT + lossless|| 100|| 100|| 2.3|| 5.9|| 27.8|| 1.3|| 27.2|| 1.9|| 1.5|| 26.9||
    98 
    99 Notes:
    100 * all tests were performed on an AMD FX-8150 (octa-core 3GHz AMD CPU)
    101 * video encodings are not included, and should generally be preferred to the single picture encodings shown here
    102 * this shows both speed in mega pixels per second (higher is better), and compression ratio (lower is better)
    103 * Low quality at low speed doesn't really make much sense, so some values have been omitted
    104 * changing the {{{webp}}} preset does not affect speed or output size much, it probably does affect the perceived picture quality (seems best to stick with TEXT to ensure that text remains readable)
    105 * The new {{{webp}}} encoder seems to perform about the same with speeds >50%, only low speed is really slow, and lossless is unbearably slow (it can take more than 30 seconds to encode a single frame using lossless + low speed!)
    106 * quality is not the same for each encoder, some have lossless modes others not, etc..
    107 * for data showing the differences between the various {{{png}}} compression types ({{{HUFFMAN_ONLY}}}, {{{FIXED}}}, {{{RLE}}}, {{{FILTERED}}}, {{{DEFAULT}}}), see ticket:419#comment:6
    108 
    109 [[BR]]
    110 You can find a much more detailed analysis (but which is limited to lossy formats in {{{YUV420}}} colourspace mode...) here: [http://people.mozilla.org/~josh/lossy_compressed_image_study_july_2014/ Lossy Compressed Image Formats Study]
    11168}}}
    11269