Mohelm97 / screenrecorder

A simple screen recorder app designed for elementary OS.
GNU General Public License v3.0
59 stars 15 forks source link

Scale option #12

Closed peteruithoven closed 5 years ago

peteruithoven commented 5 years ago

Implements: https://github.com/Mohelm97/screenrecorder/issues/9 Allows users to scale the video to reduce file size. Uses ffmpeg's scale filter.

ToDo:

peteruithoven commented 5 years ago

Not sure about the UI. Just adding a column for "%" is a bit awkward? Maybe a small Gtk.Scale would be more appropriate? Maybe starting at 25%, with a marks at 50% and 75%. Although that introduces another UI type in the mix.

screenshot from 2019-01-11 17 32 58

peteruithoven commented 5 years ago

Granite.ModeButton

screenshot from 2019-01-11 20 24 51 Makes the interface a bit wide.

Gtk.Scale

screenshot from 2019-01-11 20 41 35 screenshot from 2019-01-11 20 49 52 Seems appropriate for a scale, but is quite busy.

Gtk.ComboBox

screenshot from 2019-01-11 20 31 43 I like this the most, probably because it kind of blends in.

peteruithoven commented 5 years ago

@Mohelm97 Do you have an opinion on the UI?

Mohelm97 commented 5 years ago

@peteruithoven Oh Thanks Peter, and sorry for not being active this whole time, I think I like the most the ComboBox :D

peteruithoven commented 5 years ago

@Mohelm97 No problem, I've implemented the Combobox. Please let me know if there is anything I should improve.

Mohelm97 commented 5 years ago

@peteruithoven Just some questions to learn some stuff :D Do we need the m library? what do you think is better to scale it in the rendering or in the recording? If the scale option is less than 1, we should add something like 0.5x?

peteruithoven commented 5 years ago

Do we need the m library?

I needed it for Math.floor, but since that's the only usecase there might be a way to floor without this library. In Javascript there are a couple of ways: https://blog.blakesimpson.co.uk/page.php?id=58&title=fastest-alternative-to-math-floor-in-javascript. I could check whether that also applies to Vala?

What do you think is better to scale it in the rendering or in the recording?

I'm not sure, I'm not sure how do those options impact the user? Preferably something where the preview indicates the final result?

If the scale option is less than 1, we should add something like 0.5x?

No, the @2x is to communicate to websites like Github that they can be resized to 50%.

peteruithoven commented 5 years ago

I've now used a simple cast to int to floor a value, this seems fine: https://stackoverflow.com/questions/3300290/cast-to-int-vs-floor I've therefore also removed the math library.

If the scale option is less than 1, we should add something like 0.5x?

No, the @2x is to communicate to websites like Github that they can be resized to 50%.

The issue for screenshot: https://github.com/elementary/screenshot/issues/68 More info: https://ivomynttinen.com/blog/a-guide-for-creating-a-better-retina-web

I am going to change the logic though, I don't think we want websites to downscale images to 25% when users with a HiDPI screen take a recording at 200% scale and we also don't want websites to downscale images to 50% when users with a LoDPI screen take a recording at 200%. I think I'd like it to work like this: LoDPI (1x): 25% > 1x 50% > 1x 75% > 1x 100% > 1x 200% > 1x

HiDPI (2x): 25% > 1x 50% > 1x 75% > ? 100% > 2x 200% > 2x

HiDPI (4x): 25% > 1x 50% > 2x 75% > ? 100% > 4x 200% > 4x

Mohelm97 commented 5 years ago

@peteruithoven Really thanks a lot for this awesome contribution Peter ;)