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

Videos won't embed

Open babybackribsgivemeback opened this issue 1 year ago • 38 comments

Steps to reproduce

Sometimes when I send a video file, the video does not get embedded.

Here is a file where that issue happens with me.

https://github.com/user-attachments/assets/571abacb-47d9-4965-bb4f-c806da2f3b4d

If i turn on "optimise media quality" then videos from my phone get sent fine and embed, but it would be nice to be able to send them without having to compress the video.

But some stuff downloaded from the internet still seems to be an issue.

Outcome

for the video to be embedded, or atleast easy viewable.

Your phone model

Pixel 8 pro

Operating system version

2025060200

Application version and app store

25.05.4

Homeserver

default matrix homeserver

Will you send logs?

No

Are you willing to provide a PR?

No

babybackribsgivemeback avatar Jun 11 '25 05:06 babybackribsgivemeback

If i turn on "optimise media quality" then videos from my phone get sent fine and embed, but it would be nice to be able to send them without having to compress the video.

For me, it doesn't work if this is enabled or disabled. It doesn't work with any videos at all.

Kidswiss avatar Jun 12 '25 08:06 Kidswiss

I am using ElementX App version 25.06.02 and encountering the same issue: when uploading videos via the EXA + button, others cannot play them, and the file format is displayed as application/octet-stream.

Even when I download the file to my phone, it cannot be played.

This issue significantly affects daily usage, and I hope it can be resolved as soon as possible.

watermelon0339 avatar Jun 12 '25 08:06 watermelon0339

This happens quite often to me as well (Android 14, EXA 25.06.2).

Many videos cannot be encoded and are being sent as "application/octet-stream" which confuses pretty much all media players.

The only option to view the video is to download it and open it from the file manager, which is extremely annoying.

profitrollgame avatar Jun 15 '25 19:06 profitrollgame

Issue still persists. This feature works fine in the old Element App...

KeenMaron avatar Jun 30 '25 16:06 KeenMaron

I am also experiencing this issue, but seemingly only with mp4 files. The optimize media option makes no difference. Webm and gif files upload without issue, but mp4 files upload with application/octet-stream. This is with a synapse homeserver that is making full use of workers for handling media. Everything works without issue from Element Desktop.

Downgrading to 25.05.0 solves the issue.

ODeadlock avatar Jul 01 '25 08:07 ODeadlock

One of my family reproduced this yesterday, I noticed the msgtype was set to m.file. If I edit and resend the event in Element Web, by setting msgtype to m.video and the MIME type to video/mp4, the video plays normally. So it's seems to just be an issue with the client-side logic that detects the media type and chooses whether to display as a file or video.

reivilibre avatar Jul 11 '25 12:07 reivilibre

This is an issue that's affecting me and friends with whom I'm chatting that use Element X and are uploading videos. This issue does not appear to occur on the desktop version. My thought at first was that it occurred only with small, short duration video files, but I'm not sure if that is the case.

I performed tests today on my desktop and my mobile device with relevant files as two mp4 files and two webm files, one of each small in size and one of each larger. The smaller of each file type sent but did not show a thumbnail, and the larger (within the 100MB upload limit) of my particular files hung on "Sending..." with the indefinite loading animation until it just quit (mp4) or took so long I decided to stop waiting (webm), which I suppose indicates other issues with the app. I did not test using "Optimize Media" because that shouldn't be required anyway.

I can confirm through viewing sources on my desktop Element that, as indicated by the other users above, the files uploaded by Element X were done so as "application/octet-stream" and "m.file" for the "mimetype" and "msgtype", respectively, whereas the mp4's and webm's uploaded through desktop were not. Tests were performed on Android 16 and Element X v25.06.2 (mobile).

Personally, I would consider this to be a critical regression, because it worked just fine before the last month or so, and uploading and sharing videos is an important part of our discourse and that of others. Having to download videos and view them rather than view them in the app itself considerably degrades user experience.

Very much would like to see some developer attention on this. It's hard enough to get people to use Element enough as-is let alone when there are bugs of this magnitude.

Valenthyne avatar Jul 14 '25 16:07 Valenthyne

I agree with @Valenthyne's statements:

I am experiencing the same behaviour. For me, it makes no difference whether I use media optimisation or not.

Videos are not sent as videos, but as ‘application/octet-stream’. I can only reproduce this behaviour with Element X. Element Classic, Element X on iPhone, Element Desktop and Element Web App do not exhibit this behaviour when I upload the same video.

Me with Element X on Android:

{
  "content": {
    "body": "1000132298.mp4",
    "info": {
      "mimetype": "application/octet-stream",
      "size": 3605765
    },
    "msgtype": "m.file",
    "url": "mxc://techniverse.net/HinAYKNNymluuJcrJDhykzDi"
  },
  "origin_server_ts": 1754754694499,
  "sender": "@patrick:techniverse.net",
  "type": "m.room.message",
  "unsigned": {
    "membership": "join"
  },
  "event_id": "$pwIaeK_0A4K_g3lmqKk3kBUCqZ65sIjNrdPzWGjf9Rk",
  "room_id": "!erXGCxpywfDCDAQJpo:matrix.sp-codes.de"
}

vs. as it should be:

"content": {
    "body": "1000132298.mp4",
    "info": {
      "duration": 41794,
      "h": 1276,
      "mimetype": "video/mp4",
      "size": 3605765,
      "thumbnail_info": {
        "h": 600,
        "mimetype": "image/jpeg",
        "size": 94970,
        "w": 337
      },
      "thumbnail_url": "mxc://matrix.org/VZHUkjLGfgaAykvmXKUJspTd",
      "w": 718,
      "xyz.amorgan.blurhash": "TvQ]j4o}n*ofofWB_NV@f+M{Rjt7"
    },
    "m.mentions": {},
    "msgtype": "m.video",
    "url": "mxc://matrix.org/WmfYUhhCWySPiXzMRgpBktSB"
  },
  "origin_server_ts": 1754757914642,
  "sender": "@jokergermany:matrix.org",
  "type": "m.room.message",
  "unsigned": {
    "membership": "join",
    "age": 480,
    "transaction_id": "m1754757914364.0"
  },
  "event_id": "$bWnRB0-ZMwkMZvbDvdExYiNfhitKdHoA-Gnja9pSKv4",
  "room_id": "!erXGCxpywfDCDAQJpo:matrix.sp-codes.de"
}

I was able to reproduce this behaviour with the latest Playstore version ‘25.07.1’ and also with the latest version here on Github (also version 25.07.1). I was able to help myself by downgrading to version ‘25.05.0’.

I would like to add that, due to some issues with the Element X app, I am finding it increasingly difficult to convince people to use Element/Matrix.

pscriptos avatar Aug 10 '25 17:08 pscriptos

This should be fixed as soon as possible. It is a UX feature that every non-technical user expects to work without issues.

KeenMaron avatar Aug 11 '25 07:08 KeenMaron

@pscriptos @Valenthyne Can you explain the exact steps of how you send these medias which end up being sent as files? Note that selecting the attachment option will always send everything as a generic application/octet-stream file.

Also @babybackribsgivemeback I can't reproduce the problem with the media you provided, and by selecting the plus button and select the gallery option and pick the media you provided. I'm running Element X Android 25.08.3.

ShadowRZ avatar Aug 19 '25 15:08 ShadowRZ

@ShadowRZ

  1. I open the chat in which I want to share the video.
  2. I tap on the plus sign (+) at the bottom left.
  3. I select ‘Photo and Video Library’.
  4. I select the mp4 file.
  5. I then tap on the green Send button at the bottom right.

A file is then displayed, but no thumbnail.

pscriptos avatar Aug 19 '25 19:08 pscriptos

@pscriptos Can you provide the video file that doesn't embed for testing? You might also want update to Element X Android 25.08.3 and see if the video got embedded

ShadowRZ avatar Aug 20 '25 02:08 ShadowRZ

Quoting from @ShadowRZ and responding to them below:

Can you explain the exact steps of how you send these medias which end up being sent as files? Note that selecting the attachment option will always send everything as a generic application/octet-stream file.

I'm fairly certain my steps were the same as @pscriptos indicated above with the same result, but this was for an earlier version of the app than the current release.

You might also want update to Element X Android 25.08.3 and see if the video got embedded

I can report that in upgrading to version 25.08.3, the regression seems to have been fixed! I had uploaded a video before updating, and it failed to embed properly. After updating, uploading a video now embeds as expected.

I'm not sure when exactly the regression was fixed, and I'm also confused why the F-Droid repository hasn't been updated in two months, but I'm satisfied that we've received a contributor response and the issue seems to be resolved.

I encourage my fellow users to try and upgrade to the 25.08.3 version and see if it works for them.

Valenthyne avatar Aug 20 '25 02:08 Valenthyne

@pscriptos Can you provide the video file that doesn't embed for testing?

Yes, I will of course make the video available.

https://github.com/user-attachments/assets/ac7530c6-1691-4b02-bc55-970101c6669a

pscriptos avatar Aug 20 '25 15:08 pscriptos

Quoting from @ShadowRZ and responding to them below:

Can you explain the exact steps of how you send these medias which end up being sent as files? Note that selecting the attachment option will always send everything as a generic application/octet-stream file.

I'm fairly certain my steps were the same as @pscriptos indicated above with the same result, but this was for an earlier version of the app than the current release.

You might also want update to Element X Android 25.08.3 and see if the video got embedded

I can report that in upgrading to version 25.08.3, the regression seems to have been fixed! I had uploaded a video before updating, and it failed to embed properly. After updating, uploading a video now embeds as expected.

I'm not sure when exactly the regression was fixed, and I'm also confused why the F-Droid repository hasn't been updated in two months, but I'm satisfied that we've received a contributor response and the issue seems to be resolved.

I encourage my fellow users to try and upgrade to the 25.08.3 version and see if it works for them.

I still have issues even on 25.08.03

Destinyg133 avatar Aug 21 '25 17:08 Destinyg133

I still have issues even on 25.08.03

That's curious. I just checked again to make sure it wasn't a fluke, but it worked just fine for me, albeit the video is much more crusty when uploaded through Element X than it is on the native desktop application despite "Optimize media quality" not being selected.

I can provide the exact video I tested if anyone wants to see if it works on their end.

Not sure if it really matters in this case, but perhaps removing the app completely from your device, as well as the cache, and fresh installing 25.08.3 might solve the issue? I had updated myself from 2025.06.2 though, so I'm not sure why it may not be working properly on your device but it does mine.

Valenthyne avatar Aug 21 '25 17:08 Valenthyne

https://github.com/user-attachments/assets/81d8fd1b-b5a2-4d6c-a09c-6096b84c09ec

25.08.3 uploaded video as attachment as application/octet-stream see screens and video

Image Image

shu05 avatar Aug 25 '25 11:08 shu05

@pscriptos, @shu05 could you upload some logs after reproducing the issue? We only send the videos as files if we couldn't compress them because of some transcoding issue (usually this means an unsupported codec) but the videos you uploaded are both using the codec we want to transcode to (AVC), so this shouldn't be a problem.

jmartinesp avatar Aug 25 '25 12:08 jmartinesp

@jmartinesp Where can I find the logs? I'll send you everything you need.

shu05 avatar Aug 25 '25 15:08 shu05

After reproducing the issue, go into Settings -> Report a problem and write a description, optionally linking to this issue or mentioning the issue number.

jmartinesp avatar Aug 25 '25 15:08 jmartinesp