Video processing

Hey, What are your approaches and/or recommendations for processing videos in serverless workers?
6 Replies
justin
justin4w ago
too generic of a question - what do you want to do? ffmpeg is the best way to do it
digigoblin
digigoblin4w ago
Yeah and you can use cpu for ffmpeg, don't need a gpu endpoint
agentpietrucha
For example, cv2.VideoCapture requires that the file to be on filesystem to read it. Downloading video, saving saving it to file system and then reading frame by frame is a good approach? Eg imageio (https://pypi.org/project/imageio/) allows to read videos from bytes (actually I don't know it's implementation, maybe it is using filesystem along the way) So I'd probably ask whether should I use filesystem or in memory for videos
PyPI
imageio
Library for reading and writing a wide range of image, video, scientific, and volumetric data formats.
justin
justin4w ago
You can do anything you want - i mean, at some point the video will be in the file system before reading it to memory so doesn't really matter much imo You'll have to download it > and the load to memory to process it whatever package you use
agentpietrucha
Got it, thanks
Encyrption
Encyrption4w ago
For Python I would suggest Moviepy and FFmpeg. Moviepy is very easy to use and can do most anything. FFmpeg is so feature rich it can be overwhelming but it can do absolutely anything. I am currently running a serverless worker that converts videos into ASCII art videos and moviepy handles everything like a champ!