safijari / decky-recorder-fork

Other
48 stars 13 forks source link

How to set image quality? #12

Open dopeytree opened 11 months ago

dopeytree commented 11 months ago

How do we set the image quality? At the moment it looks like a bad cctv camera with block compression.

Usually with anything media this can be avoided by changing whatever the quality setting is. For example most cctv cameras by default have crappy compression on to save space but most of us save to a NAS so storage is NOT an issue and we turn the quality back up to 100.

Just need to know where it is set?

Thanks

safijari commented 11 months ago

You are free to look in the code and suggest changes. If you find where to set quality, I'll happily implement it. As best as I know currently we're using the default values for the codec.

It's worth considering the base resolution here is 800p if you recorded in handheld mode. If you're viewing those recordings on a big screen, they will look bad through no real fault of the compression. I also highly doubt that most people using this plugin even have a NAS set up so defaults will still remain lower quality

dopeytree commented 11 months ago

I'll see if I can find the setting.

It's not an 800p issue it's the quality setting. Quality & resolution are different things.

For examples see these attached stills.

One is 720p but blocky because of bad quality settings & the other is 360p but set to 100 quality and is crystal clear.

snapshot-1696920434 55361-nipz7w

snapshot-1689440638 598931-azwxx3

safijari commented 11 months ago

I'll see if I can find the setting.

It's not an 800p issue it's the quality setting. Quality & resolution are different things.

For examples see these attached stills.

One is 720p but blocky because of bad quality settings & the other is 360p but set to 100 quality and is crystal clear.

snapshot-1696920434 55361-nipz7w

snapshot-1689440638 598931-azwxx3

I understand the distinction. I also know that the recordings from this plugin do not look like the second picture. Can you share your problematic recording perchance because if it looks worse than usual there might be another issue?

There's some compression artifacts for sure but they're pretty light and not something you can truly escape when using compression. When you say "100 quality", do you mean recording uncompressed or are you referring to quality in the jpeg context? If you mean uncompressed, then that's not something a quality setting is going to handle. It would be a completely different data pipeline (and 180 megabytes per second).

safijari commented 11 months ago

https://gstreamer.freedesktop.org/documentation/vaapi/vaapih264enc.html?gi-language=c

This is the component that controls the quality. The specific setting is bitrate which defaults to 0, causing gstreamer to auto calculate it. I suppose I can expose a setting to allow people to change this value.

dopeytree commented 11 months ago

Sure yeah thats it the bitrate.

Sorry I work in film so am always trying to get the best image we can.

This is an example https://www.youtube.com/watch?v=KqRynwCRxCk

Yes it's also been through youtube but the original file also has blocking mainly on the edge of frame but I would like to experiment to see if the steamdeck is capable of doing a highbit rate recording.

I'd say its probably at about 50% and could probably go to 80% quality easily.

I know screen capture can be CPU intensive so maybe it wont work.. in the past when that was a bottle kneck I used jpeg screen capture and then had to process the files into video.

dopeytree commented 11 months ago

Anyway I forgot to say thanks man for maintaining this awesome plugin 🤓

safijari commented 11 months ago

Sure yeah thats it the bitrate.

Sorry I work in film so am always trying to get the best image we can.

This is an example https://www.youtube.com/watch?v=KqRynwCRxCk

Yes it's also been through youtube but the original file also has blocking mainly on the edge of frame but I would like to experiment to see if the steamdeck is capable of doing a highbit rate recording.

I'd say its probably at about 50% and could probably go to 80% quality easily.

I know screen capture can be CPU intensive so maybe it wont work.. in the past when that was a bottle kneck I used jpeg screen capture and then had to process the files into video.

Oh oof. Yeah that recording is not doing so hot and uploading an 800p video on youtube actually hits you with an even worse bitrate penalty (people often upload in higher resolutions just to avoid that). Then with the shattering glass everything just completely goes to shit.

I can expose the bitrate option. Some experimentation will be needed with it as the sky is effectively the limit. The screen capture here primarily taxes the GPU as that's where the encoding happens and it should be capable of doing much higher bitrates without issue.

dopeytree commented 11 months ago

Ace yeah I have heard it's better to drag 1080p onto a 4k timeline sometimes to upload to youtube and then you end up with a sharper 1080p image than if you had uploaded 1080p direct to youtube. Now the deck is 800p so I might try a 2k edit & upload instead of 4k.