## 3 System Design
### Stream Processing Flexibility and Format Adaptation  
A significant advantage of the decentralized node architecture is that each participant in the chain not only receives the video stream but can also perform local processing operations according to specific requirements. This capability enables a wide range of applications beyond simple viewing, substantially enhancing the system's flexibility and utility across diverse use cases. At each node in the transmission chain, the locally received video can be concurrently processed for multiple purposes. Local recording functionality allows participants to create persistent archives of the stream for later review or distribution, effectively enabling time-shifted viewing without centralized storage infrastructure. This is particularly valuable in educational contexts where lecture recordings can be made available asynchronously or in conference scenarios where presentations can be archived for reference. The implementation utilizes FFmpeg's container multiplexing capabilities to generate standard-format recordings (Algorithm 4):Furthermore, the system supports intelligent transcoding capabilities that can adapt the stream characteristics based on downstream requirements. This adaptive behavior is particularly valuable in heterogeneous environments where downstream nodes may have varying processing capabilities, connectivity constraints, or compatibility requirements. For example, when a high-performance node serves as an upstream source for resource-constrained devices (such as legacy hardware or mobile devices), it can dynamically transcode the stream to reduce computational demands on receivers:  
\[TranscodingProfile= \begin{cases}\{codec:\text{AV1}/\text{HEVC},bitrate:\text{high}\}& \text{for high-performance receivers}\\ \{codec:\text{H.264},bitrate:\text{medium}\}&\text{for mid-range devices}\\ \{codec:\text{H.264},bitrate:\text{low},res:\text{720p}\}&\text{for low-power devices}\\ \{format:\text{FLV}/\text{RTMP}\}&\text{for legacy compatibility}\end{cases}  \tag{21}\]  
This capability enables complex adaptive topologies where content characteristics evolve as they traverse the network. For instance, a high-bitrate AV1-encoded 4K source stream might be maintained through the high-capacity backbone of the network, while branches serving different audience segments automatically transcode to more appropriate formats such as H.264 with lower bit rates for general viewers, reduced resolution for mobile devices, or even legacy formats like FLV for environments with older playback infrastructure. The transcoding operation itself can be parameterized according to specific quality and efficiency requirements. For example, the encoding preset can be tuned based on the node's available computational resources:  
\[EncodingPreset= \begin{cases}\text{versylow}&\text{if }CPU_{available}>80\% \text{and not latency-sensitive}\\ \text{medium}&\text{if }50\%<CPU_{available}<80\%\\ \text{ultrafast}&\text{if }CPU_{available}<50\%\text{or latency-critical}\\ \end{cases}  \tag{22}\]  
As a comparison, in traditional video streaming solutions, including RTMP, RTSP, or M3U8-MPEGTS, each receiver has to rely on the server to perform all transcoding operations. For instance, modern hardware for video processing, including integrated GPUs in Intel(r) N100 or AMD(r) Ryzen(tm)8845H used in this experiment [49; 51], as well as newer dedicated GPUs, supports efficient AV1 hardware decoding, allowing video playback with minimal CPU overhead, which is sometimes even negligible. In contrast, older Intel processors lack hardware decoding for modern codecs, forcing them to rely on software decoding, which can consume a significant portion of their limited performance, frequently exceeding 60% utilization and sometimes making out the CPU. Additionally, different GPUs vary in their decoding capabilities; while some can barely handle 1080p 60 fpsH.264 at their limit, others effortlessly decode 4K or higher resolutions with more complex codecs like HEVC, VP9, or AV1.