-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compress video, images and audio before sending #14047
Comments
This is hard to implement on a web client for things other than images. For images it is easy using browser canvases but for Audio/Video it would mean importing very large libraries if at all possible for more than a couple of file types. Images are already tracked in #4144 https://stackoverflow.com/questions/9635835/solutions-to-compress-audio-in-browser Cannot even find such a library for Video. |
What about the desktop client? As far as I know it is just the web client with electron. But maybe there it should be easier to add. |
Sure, it'd be more reasonable to add to the desktop client given that ability for native extensions. Could add an FFmpeg dependency or whatever |
FWIW, ffmpeg has been compiled to wasm: https://github.com/ffmpegwasm/ffmpeg.wasm |
Lacks Safari and Firefox support seemingly according to the readme |
Also, when resize image - please, save exif information (date of photo, geo-tags and etc.). |
Has there been any internal progress on this feature? |
Just noticed that for uploading an avatar, it supports a whole boatload of file formats. Including WebP. So modern file formats are absolutely supported, at least in "some" way.
Then don't do it on those browsers? I don't see why you'd wait for that. But also, there's some work done (or being done) on getting libvips to compile to WA so it doesn't need to only work in the desktop app. Speaking of which, on the desktop app you could just include Sharp as it is today, and immediately start converting whatever image data to WebP. That way, you'll fix the problem for everybody that uses the desktop app (no idea how many % users that is, do we know this?) |
I'm assuming this was due to the wasm port using SharedArrayBuffer? Support is much better these days :-) https://caniuse.com/sharedarraybuffer But even if videos wouldn't work, I think even image compression would be quite useful. libSquoosh even goes as far as supporting many modern formats and parameters locally (in the client browser). |
Is there currently any kind of way to have Element compress images before sending them? If not, is there an alternative way to do this, e.g. on the server? |
@vladh Element on the desktop can already implement this perfectly fine. As it runs on Electron, by extension it must also run Node.js in the background, and therefor Sharp can be implemented without too much effort, I reckon. The tricky bit is the web client. The good thing, at least in my mind, is there is no law that says the web client and desktop client have to be identical. The problem is purely in compressing images to a modern format. Displaying such images has been possible for years on every browser. |
Users expect to be able to just drop a video in the chat and it gets send. Often this videos are to big and so they need to be recompressed.
It would be nice if there would be a message which let you choose to recompress the video at different quality levels (with a hint how large they will be) and also without recompression.
For Images there should be the same options when the image size exceeds a certain size.
Same goes for audio.
I think this is absolutely needed in all Matrix clients.
The text was updated successfully, but these errors were encountered: