---
Title: Process files
URL Source: https://company-skill.com/p/oss/oss-process-files
Language: en
Description: You want to serve or process media files using Alibaba Cloud OSS, such as creating an HLS stream for live or on-demand playback, ingesting RTMP streams, or securing media delivery with proper CORS…
---

# Process files

Part of **Object Storage Service (OSS)**. Route queries via `POST https://company-skill.com/api/route`.

## What You Want to Do

You want to serve or process media files using Alibaba Cloud OSS, such as creating an HLS stream for live or on-demand playback, ingesting RTMP streams, or securing media delivery with proper CORS and referer policies.

- How to create an HLS stream with OSS?
- Can I ingest RTMP streams into OSS?

## Decision Tree

Pick the best path for your situation:

- **If** you need to create or manage a **LiveChannel**, generate **RTMP ingest** URLs, monitor real-time stream status, or produce **VOD playlist.m3u8** from live content → Use APIRTMP (go to *oss/oss-live*)
- **If** you already have media files (including **TS files**) in OSS and only need to configure **CORS Configuration** and **Anti-Hotlink Protection** (e.g., **Referer Whitelist**, **Allow Empty Referer**, **Origin** rules) for secure **HLS streaming** → Use HLS (go to *oss/oss-video*)
- **Otherwise (default)** → Start with **HLS** if you’re testing, demoing, or lack development resources; otherwise, choose the API path for production-grade live workflows.

## Path Comparison

| Path | Best For | Complexity | Code Required | Automation | Key Fact | Detail Skill |
|------|----------|------------|---------------|------------|----------|-------------|
| APIRTMP | high | Yes | Yes | Billing includes RTMP ingest at 0.0001/MB (input) and live channel creation at 0.001/ | `oss/api/oss-live` |
| HLS | HLS | low | No | No | HLS streaming requests cost 0.0001/ with 1000 free/month | `oss/guide/oss-video` |

## Path Details

### Path 1: APIRTMP

**Brief Description**: OSS LiveChannel API is a synchronous HTTP service that enables **RTMP ingest** into OSS and stores output as **TS files** and **playlist.m3u8** for HLS playback. It supports full lifecycle management via APIs like **PutLiveChannel**, **GetLiveChannelInfo**, and **PostVodPlaylist**, and allows dynamic generation of signed RTMP URLs using **sign_rtmp_url** with **OSS4-HMAC-SHA256** authentication.

**Key technical facts**:
- Billing: 0.001/0.0001/RTMP0.0001/MB0.0002/MB0.001/
- Auth method: OSS Signature Version 4 (HMAC-SHA256) via Authorization header
- Regions available: cn-hangzhou, cn-shanghai, cn-beijing
- Prerequisites: OSS_ACCESS_KEY_IDOSS_ACCESS_KEY_SECREToss2>=2.0.0 (Python) aliyun-sdk-java-oss>=3.10.0 (Java)

- VOD186,400

- LiveChannelFragDurationFragCount

- LiveChannel100 Mbps

### Path 2: HLS

**Best For**: HLS

**Brief Description**: This path uses the OSS console to configure security settings for **HLS streaming**, including **CORS Configuration** (via **Create CORS Rule**) and **Anti-Hotlink Protection** using **Referer Whitelist** and **Allow Empty Referer** toggles. It does not support live ingestion or **RTMP ingest**—it assumes media files (like **TS files** and **playlist.m3u8**) are already present in the bucket.

**Key technical facts**:
- Billing: HLS0.0001/1000
- Auth method: Console SSO
- Prerequisites: OSS Bucket

- RTMPOSS Bucket

- APIautomation_friendly=false
- OriginURLhttp://localhost:3000

## FAQ

Q: Which path should I start with?
A: If you’re building a live system with **RTMP ingest** and need **VOD playlist.m3u8** generation, start with the API path. If you only have pre-uploaded media and need quick security setup (**CORS Configuration**, **Anti-Hotlink Protection**), use the console path.

Q: What if I need to change **FragDuration** or **FragCount** after creating a LiveChannel but used the API path?
A: You’ll hit a hard limitation: **LiveChannelFragDurationFragCount**. Plan these values carefully upfront.

Q: What if I try to build a live stream using only the console path?
A: You’ll find **no option to create a LiveChannel or handle RTMP ingest**—the console path only configures access rules for existing files, so live ingestion won’t work.

Q: Can I automate **Referer Whitelist** and **Origin** settings via code if I choose the console path?
A: No—the console path is **not automation_friendly**. These settings must be done manually in the UI; use the API path if you need infrastructure-as-code.

Q: What happens if I delete a LiveChannel without cleaning up **TS files**?
A: The **TS files** and **playlist.m3u8** remain in your bucket and continue to incur storage costs—you must delete them manually.

Q: Does the console path support **Sensitive Data Protection** for media?
A: Indirectly—via **Anti-Hotlink Protection** (referer rules) and **CORS Configuration**, which prevent unauthorized embedding or hotlinking, acting as a form of access control.

## Related queries

process media files, HLS streaming, create HLS stream, RTMP ingest, live video streaming, video on demand, VOD playlist, media processing, stream video from OSS, how to stream video, can I use OSS for live streaming, setup live channel, generate playlist.m3u8, manage TS files, configure CORS for vid

---
Part of [Object Storage Service (OSS)](https://company-skill.com/p/oss.md) · https://company-skill.com/llms.txt
