Finally MediaCoder is stepping on its way to becoming a distributive transcoder. I decided to design a frame level distributing mechanism instead of file-level distributing. The system is made up of a master, which performs decoding and data distribution, and one or more agents, which receive raw video frame, encode them and send the encoded stream back to the master. Users will feel like still using a desktop version of MediaCoder, while the encoding is actually done on another one or more machines. This approach has several advantages:
- No need to expose the whole file to the encoding machine with OS file sharing.
- It’s possible to implement segmented + distributed transcoding
- The decoding is still done by a Windows box (where MediaCoder runs), which has better decoding capability. This also helps to unify the decoding standard in a distributed transcoding system.
- The transcoding agents need no storage for intermediate data during transcoding. The frames are transmited over LAN, encoded and send back over LAN.
However, nothing is perfect. The downsides are:
- A fast (Gigabyte) LAN is required. Otherwise, the transmission of raw video frame over LAN will be the bottleneck of the system
- The master will have heavy load if there are too many agents to be fed
Currently the finished work is still limited. The MediaCoder Agent is written from scratch and only supports x264 meanwhile. It’s OS portable already however and I decided to make it open-source. So that some one will help with the improvement and porting hopefully.
Here is what current implementation can do and the limitations:
- MediaCoder Agent wait for incoming connection from MediaCoder upon running
- When MediaCoder is put into the new “Distributive” mode, it will off-load video encoding to MediaCoder Agent running on the other machine or locally.
- During the transcoding in distributive mode, MediaCoder decodes video into raw frames, send the frames to the agent over TCP and wait for the agent to return encoded stream in the return channel
- MediaCoder Agent can literally run on any OS (32 or 64 bit) with x264 installed (in /usr/bin by default, the location can be altered in MediaCoder’s Settings dialog)
- Audio encoding is not off-loaded and still done locally
- Currently only x264 is tested and only a single agent is supported