element-x-android icon indicating copy to clipboard operation
element-x-android copied to clipboard

Uploading certain video files is very slow and "compresses" them to a much larger file size

Open 90vgt opened this issue 11 months ago • 1 comments

Steps to reproduce

When uploading some videos to a room, the "upload" screen sometimes sits with a spinning circle for minutes before finally uploading. Presumably this is when compression of the file is occurring, and if so it may be more user friendly to display some kind of progress to avoid the user believing the process has failed. Uploading a 22MB, 5 minute long video took just over 2 minutes.

After uploading, certain videos have been "compressed" to a much larger file size. This occurs in both DM and multi-user rooms.

The video in question was an .mp4 file using H.264 encoding, 25fps, AAC audio and a resolution of 720p x 720p (1:1 aspect ratio). The original file size was 22MB, but it increased to 84MB once uploaded to the room.

Testing with an .mp4 1080p video with 16:9 aspect ratio seemed to work as intended, reducing the file size from 15.4MB to 11MB. For this video, the time taken to upload it was also significantly less, spending only 20 seconds or so with the spinning upload progress indicator.

Outcome

What did you expect?

Video is compressed to a smaller size (or not at all if it's already small).

What happened instead?

Video ended up being much larger in size than the original, and took about 2 minutes to send. Expecting compression to reduce the size of the video for optimal network performance, or leave it be if no compression required.

Your phone model

Samsun S20 Ultra

Operating system version

Android 13

Application version and app store

Element X Android 0.7.6 (40007060)

Homeserver

Synapse 1.121.1

Will you send logs?

Yes

Are you willing to provide a PR?

No

90vgt avatar Jan 23 '25 17:01 90vgt

Yeah, the re-encoding is a real PITA. it regularly ends up with files bigger than before, taking forever to send short videos, and we're not even talking about battery usage. Is there an option to disable this? The old Element client had an option to send unmodified media (although it was. often buggy), any chance we can get something like that again?

xpac1985 avatar Mar 20 '25 13:03 xpac1985