Project Soon

Daemon, Controller and Communication

When I started this project I first wanted to make sure that it was viable, that it would be possible to create a scheduler to process videos into another format with a single command and being able to view the progress as it goes. After a couple of months working with it, I finally got to a state where it worked. The next 2 years I only tinkered with it to perfect it, with more useful features and also fix issues and make sure that it works with most formats. It is far from perfect, but at least it works for my own personal usage. I then experimented with JSON-RPC 1 and server/daemon 2 to make it possible to move to the next step.

Like previously mentioned, the first thing was to pick necessary technologies and protocols, and then learn to use them to the project. JSON-RPC, python-daemon 3 4 and FastAPI 5 are the obvious choices for now, mostly because they are well known, but also because they are easy to use. The protocol JSON-RPC allows for quick integration with JavaScript later down the line, while being easy to understand; python-daemon is just well known to “just work” whenever that was released to how people previously did 6; FastAPI not only is easy to use, it also enables the use of websockets 7 for faster communication.

As for the implementation, I added the HTTP endpoints, stitched them together with RPC and then added the controller. Currently the client needs to ask the server for information about the current progress of the transcoding, as adding some sort of streamable process is a bit too complex for this stage. Lastly, the CLI was modified to support transcoding both local (for now) and distributed/remote through the daemon. The worker is also residing within the controller daemon, but will later be moved out to its individual one, to allow complete parallel and distributed transcoding.

The result is a CLI where one can choose to transcode locally or through the daemon. It is also possible to reconnect to the daemon to see the progress. While there is still a lot more to do, this is a great start to go further before the webui is created.

Two terminal windows with the usage of transcoaster on the left and daemon logging to the right

Shows transcoaster usage, including displaying progress


  1. https://www.jsonrpc.org/specification ↩︎

  2. https://en.wikipedia.org/wiki/Daemon_(computing) ↩︎

  3. https://pypi.org/project/python-daemon/ ↩︎

  4. https://peps.python.org/pep-3143/ ↩︎

  5. https://fastapi.tiangolo.com/ ↩︎

  6. https://stackoverflow.com/a/473702 ↩︎

  7. https://en.wikipedia.org/wiki/WebSocket ↩︎