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

How do I prevent files from being saved to that path? #834

Open
chanung-ki opened this issue Apr 15, 2024 · 2 comments
Open

How do I prevent files from being saved to that path? #834

chanung-ki opened this issue Apr 15, 2024 · 2 comments

Comments

@chanung-ki
Copy link

chanung-ki commented Apr 15, 2024

I am using ffmpeg-python to transcode mp4 files.

I would like to immediately upload the converted video to the s3 bucket using the SDK without saving it to a local path.

However, when you execute the run() function, it is immediately saved to the specified path. If I do this, I have to repeat the process of reloading the file, uploading it to the s3 bucket, and deleting the file.

So, I would appreciate it if you could share a way to assign the files output when executing the run() function to variables.

@AdrKacz
Copy link

AdrKacz commented Apr 25, 2024

How do you upload to s3? s3 reads from a file, you'll have to store it at some point (if you are working with Lambda you are free to use the /tmp folder).

s3 support direct bytes stream, but that's for local (and small) objects. FFmpegdoesn't run in your Python interpreter. ffmpeg-python translates your Python code into command for ffmpeg, it doesn't process any data.

Moreover, I imagine your mp4 files are not a few bytes large, you surely don't want to store it in a local variable. That would eat up all your available memory...

If you really want to go that way, you'll have to find a way to store a video inside a Python variable (and advise you not to do so).

May I know why you don't want to store the output of ffmpeg locally? We could find a more appropriate solution 👍

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

2 participants