> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pnplayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Encoding & Transcoding

> Learn how videos are processed into multiple streaming-ready formats and resolutions after upload.

When a video is uploaded, the system automatically processes it in the background to make it ready for streaming. Below is how **encoding and transcoding** are performed step-by-step.

## Video Upload

* The original video file is uploaded to the server.
* It is stored securely as the **source file**.
* Processing begins immediately after upload.

***

## Encoding Process

* The system reads the source video.
* It compresses the video using a streaming-friendly codec (such as H.264).
* Audio is encoded separately and then combined with the video stream.
* The result is a compressed, optimized version suitable for playback.

## Transcoding Into Multiple Resolutions

If multiple resolutions are enabled (for example 1080p, 720p, 480p):

* The system creates separate output versions for each selected resolution.
* Each version is resized and assigned an appropriate bitrate.
* Lower resolutions use lower bitrates to reduce bandwidth usage.
* Higher resolutions preserve more detail but require more storage.

***

## Adaptive Streaming Packaging

* All generated resolutions are segmented into small chunks.
* A master playlist file (such as HLS `.m3u8`) is created.
* The video player reads the playlist and automatically switches quality based on internet speed.

***

## Storage & Availability

* All transcoded versions are stored.
* Encoding progress is tracked in real-time.
* Once processing is complete, the video becomes available for preview and public playback.

<Warning>
  Enabling more resolutions increases processing time and storage usage.
</Warning>
