I want to temporarily store an image and audio file in the tmp directory, run a function on them to merge them with moviepy package, and the resulting mp4 should also be created in the tmp directory. Once the file is created, I am going to use YouTube API to upload the file there, and then delete it from tmp.
The problem I am facing is the function that I am using from moviepy is creating a temporary file “while it is running” that is not getting created in tmp. And possibly therefore it is throwing an error. How can I run a function on files on tmp, while keeping the temporary file function creates in the tmp itself?
Also, apparently I have to rebuild binaries if they need to be built. I am using ffmpeg and not sure how to build them to use in my function. Can you help?
Hi Ashay, I also responded to your email, but I’d recommend the following options to get help using the moviepy package (unless someone here has experience with the package and can help)
I’d also recommend setting the current working directory in the Python script to /tmp , which may store the moviepy temp files there:
import os
def handler(pd: "pipedream"):
# Set the current working directory to the tmp directory
tmp_dir = "/tmp"
os.chdir(tmp_dir)
# Your moviepy code here...