Automatic media compression on upload, on by default

(#1441) Feature Under consideration media

Current problem

Storage of Media can be expensive. In fact Fluxer has that 3 year expiration date, so.

Proposed change

Automatic Image/video compression of uploaded images. This feature can branch from the singular uploaded media in the chat, to server-IMPOSED setting, which if branched more it expand to FORCE users to go through a process of compression of their media (every uploaded media must go through the process of compression in that specific server)
  1. You can start by adding a setting on the user client side that handles this:
  • "Do you want compression to be turned on as default for every media u upload?" (can be turned off in the singular Edit Attachment) ON/Off
  • A setting to sub-choose if the compression must be on/off for image-only, video-only or both.
Note: [[ I suggest for Fluxer to have the compression of images-only to be set to ON as default, users can change it if they wish in the settings. It is a "dirty" move but storage can cost. ]]
  1. Server-side settings, where the server admin choses if users are allowed to upload Uncompressed.
-"Force the compression of media?" On/Off (users cannot turn off compression in this server, if they want to upload the must compress) -same as above, image-only, video only, or both You can work out the details, for example when the image is too small already, less than 100kb or 200kb, maybe the compression isnt needed. If a video is 10mb, and 2-4 minutes long, and with a resolution of 450p, compression is NOT needed just based on these the first two parameters. It is to not overdo the compression time on the users, which takes time. A kind of video-size/video-duration parameter to see if it is worth to compress seems very fair.

Additional information

Users dont care about the size of what they upload, nor do I. Modern phones do a screenshot and the image might be sized 800kb, 500kb. Even worse with screenvideo records. If you compress them on a basic website like this one: https://image.online-convert.com/convert-to-png a basic 700kb image can become easly 100-150kb without touching any extra setting and directly click convert, it comes out smaller, a lot smaller. So I suggest you to pick the fastest OFFLINE algorithm you can pick, and put that for the feature I described above.

4 comments

Sign in with Fluxer to comment and vote.
Comment by @Palloxin
RexSystem 1 vote originally by @Palloxin on GitHub OP 1 reply
Just compressing a screen video, it reduced its size by SO MUCH. Note that the resolution and fps and quality is almost the same image Before compression: a After compression: a2
  • 663971273-b6bd7fb0-b000-48e8-ac1f-c66dcc484f9c.jpg

    663971273-b6bd7fb0-b000-48e8-ac1f-c66dcc484f9c.jpg

    573×672 | 42 kB

  • 663976481-351816d1-5e24-42e9-aeeb-72f58a330954.jpg

    663976481-351816d1-5e24-42e9-aeeb-72f58a330954.jpg

    720×1021 | 134 kB

  • 663977091-c9548982-286d-498b-be43-3795229d3c28.jpg

    663977091-c9548982-286d-498b-be43-3795229d3c28.jpg

    720×1061 | 135 kB

Comment by @Palloxin
RexSystem 1 vote originally by @Palloxin on GitHub OP
My android 8, low-tier device, took 80 seconds to compress the video. Modern devices will take at least 3 times less. 663990928-56ebfd8f-62bf-41fb-bb55-1af43ec436b2.mp4 I am not even sure if the android app I used is the most efficent.
663990928-56ebfd8f-62bf-41fb-bb55-1af43ec436b2.mp4 | 3.0 MB
Comment by Fullest
FullestReviewer 1 vote originally by @Emptiest on GitHub 1 reply
Video compression is pretty expensive and is always lossy. I doubt this will be feasible at scale for video, and might not have desirable outcomes for users when they see obvious degradation in the quality. Might be possible for static images, but the benefits are fairly limited at that point.
Comment by @Palloxin
RexSystem 1 vote originally by @Palloxin on GitHub OP
That's why it should be a user preference. The expensive part is just users using their hardware to compress it. Although it is lossy, in very very few occasions I needed the video precision to show text inside videos. The length of the compression process cannot be that much since max file size is 25mb. If the user has plutonium, I dont think they need compression at all