Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize videos larger than max allowed resolution #34

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

sneakers-the-rat
Copy link
Collaborator

@sneakers-the-rat sneakers-the-rat commented Dec 18, 2023

Context: https://neuromatch.social/@elduvelle/111597148157826926

tl;dr we want to let people post larger media here, the question is how large?

Description

The current configuration options actually don't modify some of the underlying behavior for handling gifs, and the current behavior is to just reject gifs/videos larger than the max rather than trying to rescale them.

This PR:

  • Increases the maximum allowed sizes for GIFs
  • Creates two tiers of maximums: this allows us to accept a wider range of sizes without the server attempting to transcode an adversarially sized memory bomb.
    • media smaller than the first maximum: unchanged
    • media larger than the first maximum: rescaled down to the maximum, preserving aspect ratio
    • media larger than the second maximum: rejected

TODO

  • Tests
  • ..??

Discussion

this works, but sort of begs the question what we want our storage/media limits to be. There are a few limits that act independent-ish:

  • filesize limit
  • resolution limit
  • frame number limit

and they seem like they sort of should be independent (except for maybe frame number, idk why that wouldn't be better handled by filesize). resolution is the main determinant of bitrate (how much cpu and bandwidth is needed to watch the video) and size is the uh only determinant of storage use.

right now the settings are sorta ridiculous, like i can upload a 4K gif, but it has to be less than 16MB, so it can only be 1 second long.

we want to support ppl being able to upload big stuff, but we might not want to get ourselves in the position of having to guarantee a lot of storage right now. We are committed to preserving whatever is posted to the instance, as we should be, so to what degree do we want to act like an archival video server vs. more limited microblogging server? rn we are not really hungry for storage space, but if we start accepting very large videos, that would be the fastest way for that to happen

Copy link

This pull request has merge conflicts that must be resolved before it can be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant