Last active
May 9, 2025 22:02
-
-
Save Clybius/103bdf0ebde254c348e38f023191f494 to your computer and use it in GitHub Desktop.
Embed AV1/No File Size Capped Videos in Discord
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<meta property="og:image" content="GifToEmbedURL"> # Change the content to the link of a gif of your choice, which will be shown as the embed. | |
<meta property="og:type" content="video.other"> | |
<meta property="og:video:url" content="VideoToEmbedURL"> # Change the content to the link of a video of your choice. Will work with videos over 50 MB, and even unsupported codecs such as AV1! | |
<meta property="og:video:width" content="1920"> # Set this to the video's width and height, not required, but will show the video as intended if the aspect ratio and size is correct. | |
<meta property="og:video:height" content="1080"> | |
</head> |
We will improve the situation. The code that deals with unfurling videos has a bit of tech debt and has not received much love. Additionally av1 support isn't ubiquitous just yet (with mobile clients right now not supporting it.)
However, the exploit here shouldn't need to exist since we should just do the right thing. Right now, we just give up under most circumstances if the video is too large, rather than looking at a subset of the video data to calculate enough metadata to render an embed. We have added this to the backlog and once resources free up we will look into improving this situation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are right that its expected behavior from OG tags, I'd consider only it unexpected in how Discord handles the files though. This is just essentially a way of working around the embed limit in Discord, which limits itself to H.264/VP9/WhateverElseOldCodec. It was originally intended to be a way to embed AV1 after I had noticed people doing this trick with gif/video swapping, but after further testing it worked on almost all file sizes and more codecs.
Also since this seems to be getting some attention, I'd recommend uploading to one's own file server (shoutout BuyVM & their slabs) instead of using a gracefully provided public service to do such. Especially for large H.264 clips which gamers love to record with, and love to not compress efficiently.
More importantly, maybe Discord could just fix this whole scenario by actually allowing AV1 embeds? And update their decoders?