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

Proxy AWS S3 assets through the AWS SDK #3817

Open
JonnyBurger opened this issue Apr 30, 2024 · 1 comment
Open

Proxy AWS S3 assets through the AWS SDK #3817

JonnyBurger opened this issue Apr 30, 2024 · 1 comment

Comments

@JonnyBurger
Copy link
Member

JonnyBurger commented Apr 30, 2024

By not loading the assets through HTTP, we could save S3 bandwidth cost

@JonnyBurger JonnyBurger changed the title Optimal for videos under 500MB; not recommended for large files. Proxy AWS S3 assets through the AWS SDK Apr 30, 2024
@JonnyBurger
Copy link
Member Author

Idea:

Allow wrapping an asset in a new API proxyS3()

<Img src={proxyS3(staticFile('bigmovie.mp4'))}>

If we are not rendering or we are not on a S3 Serve URL, this does nothing at all.

Otherwise, we replace the URL with a call to /s3-proxy?url=[original] (similar to offthreadVideo:

}/proxy?src=${encodeURIComponent(
)

Then on the server, we implement a handler for the proxy (similar to

if (!req.url.startsWith('/proxy')) {
) which calls the Lambda SDK instead getS3Client()

But we should not implement this in @remotion/renderer, we should do it in @remotion/lambda or make a new package, and then add it through a "injection" into @remotion/renderer.

We also don't want a full plugin system yet, so I would say we add this to the internal options (RenderInternals.prepareServer)

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

No branches or pull requests

1 participant