Repository navigation
feat: Matroska(.mkv) and OggS(.ogg) support - #1092
Conversation
|
thanks, does this also correctly detect the mime type of an mkv file when you upload through commet? |
Also, slightly unrelated, but I couldn't get opus to work no matter what, would you mind taking a look at this? Sorry if this is not the right place to ask, I just wanted to add both as a part of this PR, but gave up when I couldn't make it work. |
After sending the message, you can view the event source and see which (if any) mime type was detected. If sending the message properly embeds the video, then its probably working. Worth checking the same thing with opus, it might be supported by the player but just not detecting the file type properly |
|
Ok yes, just checked, and it correctly detects matroska. |
|
And yep, you nailed it, opus is not being detected. "info": {
"mimetype": "application/octet-stream",
"size": 2831204
}This is the only reference to |
|
yea basically thats just the mime type for any generic sequence of bytes that it cant detect, you might want to take a look here commet/commet/lib/utils/mime.dart Line 89 in b52451e to see how you can make it detect a different type based on the header of the file |
|
Ok, so I tried doing what you suggested, but it still doesn't find it: resolver.addMagicNumber([0x4F, 0x67, 0x67, 0x53, 0x00, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64], "audio/opus"); // '<opusI tried Do I have to populate the dictionaries above too? |
|
Ok, so I managed to make this work actually, and I had to use a shorter magic number for some reason: resolver.addMagicNumber([0x4F, 0x67, 0x67, 0x53], "audio/opus"); // '<opusAnd I also had to add Now, I'd appreciate your guidance on what mime I should actually use here. Sorry for a bit of a spam, I didn't think I'd resolve it this quickly. |
|
I think the magic number you are using, Since afaik opus files are just ogg containers, it should be fine to treat them this way |
|
I guess it could also be worth adding |
|
for the UI scaling thing, i would just check that in the event source, the provided width/height for the file seems accurate, otherwise im happy to look in to that myself, i think its a side effect of something else i had changed recently |
|
I am assuming As for the video scaling thing, you called it, it doesn't actually add that data when uploading original. Processed: Original: Should I open an issue/pr for this? |
|
ah okay, yea thats a bug on my end, im happy to take a look in to that one |
|
pushed a fix for that, let me know if that works for you!
I think yea just having |
|
Thanks! |
Merge Upstream Changes - feat: Matroska(.mkv) and OggS(.ogg) support ([Pull Request](/commetchat/pull/1092)) - Add context menu entry for copying links ([Pull Request](/commetchat/pull/1094)) - Sort autofill search users by recent messages in timeline ([Pull Request](/commetchat/pull/1095)) - full-tab / window screenshare ([Pull Request](/commetchat/pull/901))



This just works, so I don't see any harm in having it.

Preview is a bit ugly, but that's unrelated to .mkv.
The ugly preview seems to happen with both .mkv and .mp4 when you send the original, but compressing either just fixes them.
I could open a separate issue for this if you'd like.
It would be neat if we could have an option to remux a .mkv file to .mp4 when uploading(would be useful for bridges, like to discord for example, as discord doesn't support .mkv).
Remuxing can easily be done with the following ffmpeg command:
closes #1052