← Back to list

Introduction to Our Video Redistribution Platform

In the era of live streaming and multimedia content, the need for robust and scalable solutions for video ingestion and processing is more…

Pkst Tech Blog · 2024-07-09 20:15 · 1 claps · 1.7 min read
#encoder #live-streaming #hls #hlsstreamingserver #webrtc
Open on Medium ↗
Wiki topics: 🎬 · Film & Television

Introduction to Our Video Redistribution Platform

In the era of live streaming and multimedia content, the need for robust and scalable solutions for video ingestion and processing is more crucial than ever. Today, we introduce two key components in our streaming stack: pRouter and Peekoder.

pRouter: The Video Reverse Proxy

pRouter is a video reverse proxy designed to accept connections from multiple sources and formats. This essential component enables video ingestion from any modern browser (via WebRTC and WebSocket) and from software using RTMP. The main features of pRouter include:

  • WebRTC and WebSocket Connections: Facilitates streaming from browsers like Firefox, Chrome, and Safari.
  • RTMP Compatibility: Allows video ingestion from software such as OBS Studio.
  • Byte Transfer via RecordRTC and RTMP: Efficiently transfers video streams to subsequent system components.

Peekoder: Processing and Restreaming

Peekoder operates behind pRouter in a private network, receiving video through SDP, RTMP, and TCP. Its main functions are:

  • Video Decoding: Processes and decodes incoming video streams.
  • Audio Re-encoding: Re-encodes audio to AAC if not already in that format, ensuring compatibility with final destinations.
  • Restreaming to Multiple Destinations: Enables retransmission to various RTMP destinations like Twitch, YouTube, and custom RTMP servers.
  • HLS Generation: Creates an HLS stream and sends it to the CDN (e.g., using S3/CloudFront).

Scalability and Performance

One of the standout advantages of Peekoder is its horizontal scalability. This means we can add more Peekoder instances to handle a larger number of simultaneous video streams, ensuring smooth and uninterrupted transmission.

In our tests, we have found that an instance with 4 cores and 8GB of RAM can support up to 8 simultaneous streams, each with up to 6 different outputs. This optimized performance is partly due to the implementation in Golang, which ensures efficient and fast processing.

Integration with Specialized Libraries

The development of Peekoder includes the use of the libpkst library, written in C. This library acts as a wrapper for libavformat, specifically designed for this purpose. The reason behind this choice is to ensure that multithreading is fully compatible with the Golang runtime, enabling concurrent and efficient processing.

Conclusion

With pRouter and Peekoder, we have developed a comprehensive solution for live video ingestion, processing, and distribution. These tools not only facilitate the integration of multiple video sources but also ensure high-quality delivery to various destinations, optimizing both performance and scalability of the system.


메타데이터
post_id
2c485902b2d9
slug
introduction-to-our-video-redistribution-platform-2c485902b2d9
url
https://medium.com/@pkst/introduction-to-our-video-redistribution-platform-2c485902b2d9
canonical_url
https://medium.com/@pkst/introduction-to-our-video-redistribution-platform-2c485902b2d9
author_url
https://medium.com/@pkst
status
ok
fetched_at
2026-07-16 07:17:41