I had a few ideas, I’m suspicious that handbrake is falling back to CPU, maybe check the logs of the container to make sure it isn’t falling back to CPU decoding. Otherwise here are a few things I would check next:
- If you are not using docker locally so you are already doing this, you will need to configure the docker container to pass through the GPU for quicksync to work inside the container.
- If you are already doing that then I would make sure the device is the same name on the synology, it probably is but just to be sure.
- you will likely need to add your user to the video and/or render group on the synology if you haven’t, especially if you are running the container as your user instead of root
- make sure you are reading and writing to volumes that use bind mounts and not docker volumes, overlayfs is not what I would call fast and writing especially.
I think you already decided what I would have recommended (just write to a log file in your python script) but I wanted to hopefully help with the rest of the question hah.
So the first thing to remember is that a pipe (
|
) in Linux is a unidirectional data channel that passesstdout
from the left command the right command’sstdin
and this is its only function. Also notable is that exit status of a pipeline is the exit status of the last command in the pipeline (unless thepipefail
option is enabled but this isn’t the behavior you wanted either), this is what is available in$?
as well immediately after the pipe exits in a script, problem with that is that tee can exit successfully while the previous command failed because it did its job redirecting output.To get the behavior you are after you would probably need to write a script that does the signal handling or it might work if you use exec to wrap your python+tee command in your dockerfile because then the bash process will get replaced by python or tee, I’m not sure which or how tee will interact with exec without testing though.
Anyway, hope that helps, here are the docs on pipe which are worth a read. In fact when double checking something just now, I learned I can do
|&
today instead of2>&1 |
which is neat hah!Edit: I forgot to mention, signal handing in docker is a whole other animal so depending on how you are specifically running it the behavior and signals might not be what is expected or the same as running the commands outside of docker.
Great article about it: https://medium.com/@gchudnov/trapping-signals-in-docker-containers-7a57fdda7d86
Repost if you can’t read it on medium: https://www.cloudbees.com/blog/trapping-signals-in-docker-containers