R
RunPod•6mo ago
agentpietrucha

Video processing

Hey, What are your approaches and/or recommendations for processing videos in serverless workers?
9 Replies
justin
justin•6mo ago
too generic of a question - what do you want to do? ffmpeg is the best way to do it
digigoblin
digigoblin•6mo ago
Yeah and you can use cpu for ffmpeg, don't need a gpu endpoint
agentpietrucha
agentpietruchaOP•6mo ago
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
justin•6mo 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
agentpietruchaOP•6mo ago
Got it, thanks
Encyrption
Encyrption•6mo 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!
gabrielgq
gabrielgq•3mo ago
Hey, I currently have some python scripts to automate video editing with moviepy and some direct ffmpeg calls and was looking into using runpod serverless due to the speed of GPU with nvenc and add the functionality to our webtool so other members of my team can use it. Would this be cost effective and is the performance change worth it? Or is should I just upgrade my VPS CPU?
Encyrption
Encyrption•3mo ago
It depends on your workflow. With a VPS you are paying for full use of that system for the month. If you can keep that server busy throughout the month that may be your least expensive route. If you have a lot of idle time throughout the month, you might be better of with serverless. Since with serverless you are not charged for the idle time. If you start getting a LOT of requests you'll find serverless a lot easier to scale where you will have to do your own scaling with VPS.
gabrielgq
gabrielgq•3mo ago
Thanks, I'll give serverless a try 🙂
Want results from more Discord servers?
Add your server