docker-handbrake icon indicating copy to clipboard operation
docker-handbrake copied to clipboard

Multi worker idea

Open kitobelix opened this issue 4 years ago • 5 comments

Hello Jocelyn, it's really a pleasure to use your images.

I'm looking forward to making this image work the automatic conversions in a distributed way. I was thinking about making a shared volume where you can put a tracker file (the same way you used successful_conversions) that several images can read at the same time (as if using an NFS mounted volume) and check that no repeated work is done. This would help to be able to build a server rig while compressing the same list of files using - let's say- 3 runners for a 1080p profile, thus making the same job in less time.

I think a simple way to do this would be to take advantage of the same mechanism you have used to check if a file has already been converted, but this time in a second stage just to check if there is another instance already converting it.

kitobelix avatar May 28 '20 21:05 kitobelix

I think that someone did something similar using custom hooks. I will try to find the info...

jlesage avatar Jun 08 '20 01:06 jlesage

OMG that would be awesome. Specially the part where you have to do nothing :D

kitobelix avatar Jun 08 '20 17:06 kitobelix

Howdy! Sorry to barge in here but I wrote a quick pair of scripts that should load balance jobs as requested. It's not live (tracking active conversions via shared file as described) but it does batch distribute files to be encoded, so you could set up a cron job to run every couple minutes/hours/days for the automated functionality.

jlesage let me know if you find it inappropriate posting this here or if you want to steal these, feel free if so inclined.

spschoen avatar Aug 01 '20 22:08 spschoen

Hey looks like a perfectly good idea, but I think it will not fit into my servers structure. I use a shared file storage across four powerful servers, that could perfectly manage to have for example, 4 instances of handbrake running to create 1080p30 outputs. I was thinking about using a shared mount across them and in some way let them know about what file is being encoded in realtime.

To be more graphic:

I have a shared mount, accessible from all servers, like NFS: /home/fs/watchfolder

Also have four instances of Handbrake running in docker, with that same folder mounted as /input. They also output to a folder mount at -v /home/fs/output:/output . The four docker instances are running one in each server, so I have four servers in total. Goal would be letting them know about what task are doing each other, so every server would be doing a different file from the same input folder and outputting to the same place at the same time. Right now that is impossible, because they would select the same file.

kitobelix avatar Sep 17 '20 02:09 kitobelix

Something like clustercode but something that works on a rpi, it can work out of a single folder. Can you apply it's functionality to your build?

shandshellin avatar Feb 14 '21 01:02 shandshellin