russelltg / wl-screenrec

High performance wlroots screen recording, featuring hardware encoding
Apache License 2.0
266 stars 9 forks source link

Recording little blurry #3

Closed roland-5 closed 1 year ago

roland-5 commented 1 year ago

I noticed that recordings are not as sharp as original source and colors are little faded. I checked and wf-recorder do the same. Is it a matter of using some flag or configuring something?

This is screenshot from workspace: ps_20230116011629

roland-5 commented 1 year ago

And this is screen from recording ps_20230116011631

russelltg commented 1 year ago

That's interesting, I dug a little deeper and there may be something I can improve on--see this screenshot of various encoding methods of your screenshot you sent:

Left is original, top right is your output from wl-screenrec, middle is output from encoding with vaapi with ffmpeg, bottom right is encoding with x264. The wl-screenrec one does seem to be a bit undersaturated I think. I'm not entirely sure why.

I will note that some amount of blurring is always going to happen, because there is pixelformat compression being applied here (RGB (24 bits per pixel) -> NV12 (12 bits per pixel) as well as normal video compression.

Probably one of the most reasonable things I could do to get higher quality outputs is to encode with HEVC (or AV1, my hardware does not support it though). Although I personally prefer to stay in h.264 land which is compatible with just about everything at this point--don't have to worry about messaging apps supporting it, etc.

image

roland-5 commented 1 year ago

Thanks for explanation. That's all OK for me. I was more worried, that I do something wrong.

russelltg commented 1 year ago

If your machine supports it, I just added support for alternate pixel formats in https://github.com/russelltg/wl-screenrec/commit/7079f494683c13a6ca6147967b6c4c85376dc594 which means the color planes are the same resolution as the luma planes (instead of half resolution).