I have a web app that allows users to insert short advert videos (30 to 60 seconds) into a longer main video (typically 45 minutes, but file sizes can vary widely).
The entire process involves:
- Importing all selected files from s3
- Encoding each to a common scheme,
ipad-high
. - Extracting clips from the main video.
- Concatenating all clips from the main video with the advert videos.
For n videos to be inserted into the main video, n + 1 clips will be extracted.
Since Transloadit does not provide any estimates on how long an assembly may run, I'm looking to find a way to estimate this myself so I can display a progress bar or just an ETA to give users an idea of how long their jobs will take.
My first thought is to determine the total size of all files in the assembly and save that to some redis database, along with the completion time for that.
Subsequent runs will use this as a benchmark of sorts, i.e if 60GB took 50 minutes, how long will 25GB take.
The data on redis will be continually updated (I guess I could make the values a running average of sorts) to make the estimates a reliable as possible.
Any ideas are welcome, thanks :)