Skip to main content

HLS Transformer (Enterprise Video Engine)

A high-performance, multi-threaded C++ video transcoding engine built on top of FFmpeg. This engine converts standard video files (.mp4, .mov, etc.) into highly optimized, Adaptive Bitrate (ABR) HTTP Live Streaming (HLS) formats.

It is designed for production backend environments, featuring real-time AES-128 encryption, broadcast-standard audio normalization, and seamless integration with Python via pybind11.


Key Features

  • Multi-Core ABR Encoding: Spawns isolated threads to simultaneously transcode video into multiple resolutions (e.g., 1080p, 720p, 480p, 360p) to maximize CPU utilization.
  • Content-Aware Scaling: Automatically detects if a video is horizontal (16:9) or vertical (9:16 for Shorts/Reels) and adjusts the output dimensions dynamically.
  • AES-128 DRM Encryption: Encrypts video chunks on the fly to prevent unauthorized downloading and piracy.
  • EBU R 128 Audio Normalization: Analyzes and normalizes audio loudness to standard broadcast levels (-14 LUFS) using FFmpeg's loudnorm filter graph.
  • Thread-Safe Logger: Built-in mutex-locked logging system to prevent terminal text corruption during multi-threaded execution.
  • Python Native Binding: Architected to be compiled as a .so module, allowing you to orchestrate the C++ engine natively from Python scripts.

Prerequisites

You must have the FFmpeg development libraries and a C++ compiler installed on your system.

Ubuntu / Debian:

sudo apt update
sudo apt install g++ libavformat-dev libavcodec-dev libswscale-dev libavutil-dev libavfilter-dev libswresample-dev

Architecture

  • The project is cleanly separated into two main components:
  • hls_engine.cpp: The pure C++ core logic containing all FFmpeg memory management, multithreading, and video processing.
  • ​wrapper.cpp: The lightweight pybind11 bridge that exposes the C++ engine to Python.

##how to use

Step 1: Generate Encryption Keys

  • Before running the engine, you must generate an AES-128 key. The engine looks for a file named enc.keyinfo to encrypt the stream. ​Run this in your terminal:
# 1. Generate a 16-byte hex key
openssl rand 16 > enc.key

# 2. Create the keyinfo file for FFmpeg
echo "enc.key" > enc.keyinfo
echo "enc.key" >> enc.keyinfo
  • Note: In a real production environment, the first line of enc.keyinfo should be the public URL where your web player can fetch the key

#api uses

from vedio_transcoders import  hls_encoder

#The engine will automatically pad missing bitrates using production defaults
#and detect if the video is Vertical or Horizontal.

hls_encoder(
    input="user_upload.mp4",
    output="master.m3u8",
    resolution=["1080p", "720p", "480p"],
    bitrate=[5000000, 2500000],          #480p will auto-default to 1,000,000
    key="enc.keyinfo"                    # Path to your DRM keyinfo file
)

print("Video successfully packaged for HLS delivery!")

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

video_transcoders-10.2.14-cp312-cp312-manylinux_2_34_x86_64.whl (44.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

video_transcoders-10.2.14-cp311-cp311-manylinux_2_34_x86_64.whl (44.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

video_transcoders-10.2.14-cp310-cp310-manylinux_2_34_x86_64.whl (44.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

video_transcoders-10.2.14-cp39-cp39-manylinux_2_34_x86_64.whl (44.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

File details

Details for the file video_transcoders-10.2.14-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for video_transcoders-10.2.14-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 094121944e9cbb5491a674662878f8bf6ecb247e910d00168d0c0e8b45e78c44
MD5 41ddf74e5603511132701caa3e3ab3b5
BLAKE2b-256 a9f2b56fa77a1cbaff55e53ad198b3951414999d6995bae17ee98bd52bd69959

See more details on using hashes here.

File details

Details for the file video_transcoders-10.2.14-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for video_transcoders-10.2.14-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 25254335f913ac67059113366e8dc960fe1fbc64be7880f811e7f9c49b37bffb
MD5 972cebec8eb9978ec5cb05612c2d96ba
BLAKE2b-256 4a41b6a60df79b5ec62c8c4bf1702f9fd03b58c83f007605d19ce8f10b6b8801

See more details on using hashes here.

File details

Details for the file video_transcoders-10.2.14-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for video_transcoders-10.2.14-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 537114643cb7a9ed3d046d289a98f4bcd9d74d6467576ac1771c39289c3b741c
MD5 fa7f9cacea7456402be5e0a1b9e83326
BLAKE2b-256 dbb64ebf2fd06854f9be27d3a2daa97fba535b6b6e76a2eb7c2c50bd54dc5b9a

See more details on using hashes here.

File details

Details for the file video_transcoders-10.2.14-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for video_transcoders-10.2.14-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2727b8d2ccad39bb490c0c6c4b697c4bf747bb73e975eb51b46041c6e0280e2b
MD5 9d6e45d3e585b95ed43d21e11d1625b8
BLAKE2b-256 cb8a8962faec4e10430509539474fb8e538275b398f5ddbbdd36125d473c742e

See more details on using hashes here.

Release history Release notifications | RSS feed

10.2.27

1 file

10.2.25

1 file

10.2.24

1 file

10.2.23

1 file

10.2.22

1 file

10.2.21

1 file

10.2.20

2 files

10.2.19

2 files

10.2.18

2 files

10.2.17

2 files

10.2.16

2 files

10.2.15

2 files

This release

10.2.14 This release

4 files

10.2.13

2 files

10.2.12

2 files

10.2.11

2 files

9.2.11

2 files

9.1.11

2 files

0.1.2

2 files

0.1.0

7 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page