xpra icon
Bug tracker and wiki

Opened 8 weeks ago

Last modified 2 weeks ago

#1699 new enhancement

pass hints to the encoder

Reported by: Antoine Martin Owned by: J. Max Mena
Priority: major Milestone: 2.3
Component: encodings Version: trunk
Keywords: Cc:

Description (last modified by Antoine Martin)

See ticket:1694#comment:4 and ticket:999#comment:24

We can add some hints to the window-model to try to help the picture encoders make better decisions.
For example:

  • "xterm" / "term" or "terminal" window classes should trigger "text" encoding, with higher quality, and avoid video
  • a media player (not sure about the best way to detect those), should trigger video


The webp encoder (#1694) can use this hint, we can also use this hint for selecting video mode.

Change History (3)

comment:1 Changed 8 weeks ago by Antoine Martin

Description: modified (diff)
Status: newassigned

comment:2 Changed 5 weeks ago by Antoine Martin

Owner: changed from Antoine Martin to J. Max Mena
Status: assignednew

Added in r17665, see commit message for details.
An xterm shows up as:

$ xpra info | grep content-type

A Firefox window correctly shows up as:

$ xpra info | grep content-type

And the webp encoder now shows details on "preset" and "image hint":

webp.compress(XImageWrapper(BGRX: 0, 1317, 1513, 13), 1513, 13, False, browser) buf=0x7f072c8624f4
webp.compress config: lossless=0    , quality= 40, method=0, alpha=  0,  0,  0, preset=text    , image hint=graph

@maxmylyn: this is not finished yet, but already a good time to hand this over to you:

  • to make sure that your application identifiers are added so that we detect it as the correct "content-type" (ie: "browser" for most of your windows)
  • for you to run compression tests using webp on a variety of sample window screenshots to see which ones offer the best results (in terms of efficiency, compression, quality, etc..) - so that we can then tune the webp encoder accordingly

The coarse webp tunings using "preset" and "image hint" may not be enough for our needs - in which case we'll need to enhance the webp encoder logic, see libwebp/enc/config.c for what those preset values do.

Last edited 5 weeks ago by Antoine Martin (previous) (diff)

comment:3 Changed 2 weeks ago by J. Max Mena

Okay part one of comment:2 is done - as far as I can tell most major applications I've tried show up correctly (even a couple Electron applications). I'll write a script to test the webp encoder today or tomorrow depending on when I get to it.

Note: See TracTickets for help on using tickets.