DEV Community

Cover image for Can You Combine a Transcoder, Packager, and DRM/CAS Scrambler All in One?
Elecard
Elecard

Posted on

Can You Combine a Transcoder, Packager, and DRM/CAS Scrambler All in One?

In modern TV and OTT projects, the same technical challenges can be addressed in different ways: by distributing functions across multiple systems or by consolidating them into a single solution. In practice, the choice depends on network architecture, content protection requirements, and the diversity of end-user devices.

Let’s take a closer look at what a contemporary video delivery chain really consists of — from classic “old-school” DVB to OTT, DRM, and CAS.

From "Old-School" Multiplexer to Modern OTT

The multiplexer is a technology that's been around for over 30 years. It emerged in 1992 for DVB broadcasting and still works flawlessly today. It’s like an axe—a simple, reliable tool that does its job perfectly. The 188-byte transport stream structure, tables, transmission intervals—everything was designed so thoughtfully that the technology has outlived several generations of computers.

But the world has changed. With the growth of the internet came OTT platforms that deliver video over IP. And this is where things got interesting.

Packager: When You Need to "Slice" the Stream

Early OTT solutions were based on the same transport stream—it was simply sliced into chunks and transmitted over HTTP. Why? To solve several problems at once:

Adaptive bitrate — when bandwidth narrows, the player automatically switches to lower quality. In the worst case, at 128 Kbps, you'll see a frozen picture but still hear the commentators.

Support for different devices — some require high quality, others can only play SD content.

Over time, the industry shifted from transport stream to MP4 containers. Why? About 10% bitrate savings by eliminating redundant service tables needed only for DVB broadcasts.

Apple HLS and MPEG-DASH: Two Sides of the Same Coin

Apple HLS started with transport stream, then moved to MP4. The system is straightforward: there's a master manifest (playlist) describing available quality profiles, and media playlists with links to video segments.

MPEG DASH was designed for MP4 from the start and supports more capabilities.

It would seem that moving to MP4 opens new horizons: you can create long GOPs (up to 10 seconds instead of 0.5 seconds in DVB) and use pyramidal B-frame structures. However, real-world constraints often interfere: some devices do not support long GOPs, certain players fail with B-pyramid structures, buffer and codec profile limitations vary widely. As a result, engineers frequently have to balance optimal encoding theory with the practical limitations of client devices.

Content Protection: Multi-DRM as a Necessity

If you're a serious operator, you'll need to support three major DRM systems:

- Widevine (Google) — for Android devices and browsers

- FairPlay (Apple) — for iPhone, iPad, Apple TV

- PlayReady (Microsoft) — for Samsung, LG, and other Smart TVs

Each system requires its own encryption format. At minimum, you need 4 playlists, but in practice—often all 7, because some devices are finicky even with formats they're supposed to support according to specifications.

Technical Details That Complicate Life

  • Teletext — in DVB it's one technology, but in OTT you need to support five different formats (in DASH—two: TTML and WebVTT).

  • Ad markers — there are at least three standards (Amazon, SCTE-35, and others), and you need to support them all.

  • Subtitles — while ready-made subtitles are straightforward (TTML or WebVTT), recognizing DVB subtitles becomes a quest. Especially when dealing with Arabic or other complex languages.

CAS Systems and Scrambling Optimization

DVB broadcasting uses CAS systems with DVB-CSA1, 2, and 3 algorithms. This is where the Elecard team faced an interesting technical challenge.

The problem: block scrambling doesn't parallelize well—each subsequent block depends on the previous one. Even with AVX512 optimization, they only achieved a 20% speedup, getting 50 Mbps on a 4-core processor.

The solution was unexpected: instead of speeding up processing of one service, the developers began processing 8 services in parallel, loading them into a single 512-bit register. The result—a 7x speedup! Now the same 4-core processor handles 350 Mbps.

Conclusions

Modern video content delivery is a balance between technological capabilities and real-world limitations. A 30-year-old multiplexer coexists with modern OTT formats, while the desire to use advanced encoding features crashes against the quirks of client devices.

Can you "wrap everything at once"—transcoder, packager, and content protection? Technically—yes. But be prepared to support множество formats, standards, and versions of protection systems. This isn't just combining modules; it's a complex engineering challenge requiring deep understanding of the entire video delivery chain.

Top comments (0)