Skip to content

Instantly share code, notes, and snippets.

@Clybius
Last active May 9, 2025 22:02
Show Gist options
  • Save Clybius/103bdf0ebde254c348e38f023191f494 to your computer and use it in GitHub Desktop.
Save Clybius/103bdf0ebde254c348e38f023191f494 to your computer and use it in GitHub Desktop.
Embed AV1/No File Size Capped Videos in Discord
<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>
@jhgg
Copy link

jhgg commented May 1, 2024

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