---
title: "도브러너 DRM CLI 패키저 가이드"
description: "본 문서는 도브러너 멀티 DRM 클라우드 서비스에 사용되는 CLI(Command Line Interface) 기반 콘텐츠 패키징 툴의 기본 개념과 사용 방법을 설명합니다."
---
> For the complete documentation index, see [llms.txt](https://docs.doverunner.com/llms.txt).

본 문서는 도브러너 멀티 DRM 클라우드 서비스에 사용되는 CLI(Command Line Interface) 기반 콘텐츠 패키징 툴의 기본 개념과 사용 방법을 설명합니다.

콘텐츠 패키징은 아래와 같이 다섯 가지 유형이 있습니다.

1. `DASH` : MPEG-DASH CENC 규격으로 스트리밍 콘텐츠를 패키징하여 PlayReady와 Widevine Modular 또는 Huawei WisePlay DRM을 적용하는 방식
2. `HLS` : HLS-AES 스트리밍 콘텐츠를 패키징하여 FPS(FairPlay Streaming) DRM을 적용하는 방식
3. `CMAF` : Common Media Application Format 방식 출력으로 단일 콘텐츠에 Widevine, PlayReady, FPS DRM 적용
4. `NCG` : 도브러너의 자체 규격인 NCG(Netsync Content Guard) DRM으로 콘텐츠를 암호화하여 다운로드 또는 Progressive Download용 콘텐츠로 패키징하는 방식
5. `HLS-NCG` : SAMPLE-AES 방식의 클리어키 HLS 콘텐츠를 NCG DRM을 통해 보호하는 방식

:::caution[FairPlay 사전 준비 사항]
FairPlay Streaming DRM(`--hls` 또는 `--cmaf`)으로 콘텐츠를 패키징할 계획이라면, 먼저 도브러너에 FPS 인증서를 발급받아 등록해야 합니다 — 이 과정은 Apple Developer **계정 소유자(Account Holder)** 권한이 필요하며 처리에 상당한 시간이 소요될 수 있습니다. 패키징을 시작하기 전에 [FairPlay 인증서 등록](https://docs.doverunner.com/ko/content-security/multi-drm/license/fps-cert-tutorial/)을 완료하세요.

또한 FairPlay는 CENC가 아닌 **CBCS** 암호화 모드를 필요로 합니다. `--dash` 패키징(DASH-CENC)은 FairPlay를 지원하지 않으므로, CBCS를 자동으로 적용하는 `--hls` 또는 `--cmaf`를 사용하세요. CENC 방식으로 FairPlay를 패키징하면 사용할 수 없는 결과물이 생성됩니다.
:::

> 본 문서는 4.3.0 버전의 DRM CLI 패키져를 기준으로 작성되었습니다. DRM CLI 패키져는 [Github 저장소](https://github.com/doverunner/drm-cli-packager)에서 다운받을 수 있습니다.

:::note 

도브러너 DRM CLI 패키저는 파일 기반의 온디멘드(VOD) 콘텐츠 전용 패키저입니다. 라이브 스트림 콘텐츠에 대한 DRM 패키징이 필요한 경우, Wowza, AWS Elemental 등 각종 서드파티 라이브 솔루션을 도브러너 키 서버와 연동해 사용할 수 있습니다.

:::

## Shaka Packager vs. DRM CLI Packager

Doverunner는 Shaka Packager에 기반한 두 가지 패키징 옵션을 제공합니다. 필요에 따라 선택하세요.

| 특징 | [Shaka Packager 연동](https://docs.doverunner.com/ko/content-security/multi-drm/packaging/shaka-packager-integration/) | DRM CLI Packager |
|------|---------------------|------------------|
| **적합한 사용자** | 기존 Shaka 워크플로우가 있는 개발자 | 추가 설정 없이 빠르게 시작하려는 사용자 |
| **유연성** | 모든 Shaka Packager 기능 사용 가능 | 일반적인 사용 사례에 맞게 사전 구성됨 |
| **설정** | Python 환경 및 수동 구성 필요 | 독립 실행형, 최소한의 설정 |
| **커스터마이징** | 패키징 파라미터 완전 제어 | 표준 시나리오를 위한 간소화된 옵션 |
| **업데이트** | 최신 Shaka Packager 버전 독립적으로 사용 가능 | Doverunner 호환성 검증된 관리형 릴리스 |

:::tip[어떤 것을 선택해야 할까요?]
Doverunner Multi-DRM과 바로 연동되는 턴키 솔루션을 원한다면 본 가이드의 **DRM CLI Packager**를 사용하세요.
고급 Shaka 기능이 필요하거나 기존 인코딩 파이프라인이 있다면 [**Shaka Packager 연동**](https://docs.doverunner.com/ko/content-security/multi-drm/packaging/shaka-packager-integration/)을 사용하세요.
:::

## 동영상 튜토리얼

도브러너 DRM CLI 패키저에 대한 설명과 윈도우즈 OS에서의 사용 방법에 대한 튜토리얼 영상입니다. (영문 버전)

[동영상: YouTube](https://www.youtube.com/watch?v=6ND1Oaaqrhw)

> **Doverunner Lab에서 따라 하기**: 단계별 레슨 [DRM CLI Packager로 콘텐츠 패키징하기](https://lab.doverunner.com/ko/academy/courses/getting-started-multi-drm/package-with-cli-packager)

## 연동 구조 및 설치 환경

```mermaid
flowchart TB
  %% pa: 1=MP4 2=PK 3=CLOUD 4=CDN 5=HLS,DASH,MOB 6=CLOUD>HLS,CLOUD>DASH,CLOUD>MOB
  subgraph grp_b["고객사 서비스"]
    direction LR
    MP4@{ icon: "doverunner-video", form: "square", h: 72, label: "MP4 파일" } --> PK@{ icon: "doverunner-package", form: "square", h: 72, label: "도브러너 패키저" }
    PK -->|"패키징된 스트림"| CDN@{ icon: "doverunner-cloud", form: "square", h: 72, label: "CDN" }
  end
  subgraph grp_a["도브러너"]
    CLOUD@{ icon: "doverunner-cloud", form: "square", h: 72, label: "멀티 DRM 클라우드" }
  end
  subgraph grp_c["최종 사용자"]
    direction LR
    HLS@{ icon: "doverunner-player", form: "square", h: 72, label: "HLS 플레이어" }
    DASH@{ icon: "doverunner-player", form: "square", h: 72, label: "HTML5 DASH 플레이어" }
    MOB@{ icon: "doverunner-player", form: "square", h: 72, label: "모바일 플레이어" }
    HLS ~~~ DASH ~~~ MOB
  end
  CDN -->|"m3u8, ts 파일 (AES)"| HLS
  CDN -->|"mpd, m4s 파일 (CENC)"| DASH
  CDN -->|"mp4.ncg 파일 (NCG)"| MOB
  PK <-->|"키 정보"| CLOUD
  CLOUD <-->|"라이선스 (키, 규칙)"| HLS
  CLOUD <-->|"라이선스 (키, 규칙)"| DASH
  CLOUD <-->|"라이선스 (키, 규칙)"| MOB
```

도브러너 DRM CLI 패키저는 도브러너 멀티 DRM 클라우드 서버와 연동되어 동작 합니다. 도브러너 클라우드 서버는 서비스 사이트 별 콘텐츠 키 정보를 관리하며, 클라이언트에서 DRM 라이선스 정보 요청 시 CID에 연결된 키(CEK) 정보를 찾아서 라이선스를 발급합니다. 

- 지원 OS: 64비트 기반의 Windows, Linux(Ubuntu, CentOS), macOS(Intel, Apple Silicon) 지원
- 리눅스 환경의 경우 gcc와 g++ 라이브러리 9.0 버전 이상이 설치되어 있어야 합니다.
- macOS 환경은 도커 또는 Apple Container를 이용해 Ubuntu 빌드를 실행하는 방식으로 지원됩니다.
- 패키징 하는 디스크에 콘텐츠 크기의 최소 2배 이상의 여유 공간이 있어야 정상적으로 패키징이 진행됩니다.
- 입출력 파일 명으로는 영문, 숫자 조합만 허용됩니다.

도브러너 DRM CLI 패키저 v4.3.0은 [Shaka Packager v3.7.0](https://github.com/shaka-project/shaka-packager/releases/tag/v3.7.0)을 기반으로 개발되었습니다. Shaka Packager에 대한 상세 설명과 문서, 소스 코드 등은 해당 [Github 페이지](https://github.com/shaka-project/shaka-packager)를 참고하시기 바랍니다.

### 리눅스 환경에서의 패키저 실행

리눅스 환경에서는 OS 배포판 및 버전에 따라 특정 버전의 라이브러리가 필요할 수 있습니다.

#### Ubuntu 환경

Ubuntu 18.04 이하 버전의 경우, 더 높은 버전의 glibc 라이브러리가 필요하므로 아래와 같이 `gcc/g++` 버전 9를 설치합니다.

```sh
$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt update
$ sudo apt install gcc-9 g++-9
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 900 --slave /usr/bin/g++ g++ /usr/bin/g++-9
```

Ubuntu 22.04 이상 버전에서는 기본적으로 `OpenSSL` 버전 3.x만 설치되어 있으므로 아래와 같이 버전 1.1.x를 설치합니다.

```sh
$ sudo apt-get update
$ sudo apt-get install -y gcc make perl wget
$ wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz
$ sudo tar -zxvf openssl-1.1.1o.tar.gz
$ cd openssl-1.1.1o
$ ./config && make
$ export LD_LIBRARY_PATH=<installed_directory_path>:$LD_LIBRARY_PATH
```

#### CentOS 환경

1.16.0 버전 이상의 `c-ares` 라이브러리를 설치합니다.

```sh
$ sudo yum c -y "Development Tools"
$ wget https://c-ares.haxx.se/download/c-ares-1.16.1.tar.gz
$ sudo tar -zxvf c-ares-1.16.1.tar.gz
$ cd c-ares-1.16.1
$ ./configure && make
$ sudo make install
$ sudo ldconfig
$ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
```

### macOS 환경에서의 패키저 실행

DRM CLI 패키저 v3.9.0 이후 버전은 다음과 같은 방법으로 macOS 실행 환경을 지원합니다.

Mac 환경과 사용 목적에 따라 Docker와 Apple Container 중 하나를 선택합니다.

| | Docker Desktop | Apple Container |
|---|---|---|
| 지원 Mac | 인텔, Apple Silicon | Apple Silicon만 지원 |
| 지원 macOS | 다양한 버전 지원 | macOS 26 이상 |
| 설치 | 설치 프로그램 또는 Homebrew | GitHub Releases의 서명된 `.pkg` (Homebrew cask 없음) |
| 비용 | 일정 규모 이상 기업은 유료 구독 필요 | 무료, 오픈소스 |
| 생태계 | 성숙함 (Compose, Docker Hub 연동, GUI) | 비교적 새로운 도구이며 CLI 중심의 제한된 기능 |
| Dockerfile 및 옵션 | 표준 | 동일한 Dockerfile과 `build`/`run` 옵션 사용 |
| 비대화형 환경 설정 | 지원 | 최초 `container system start`는 대화형 터미널 필요 |

- **Docker Desktop 권장**: 인텔 Mac이거나 이전 버전의 macOS를 사용하거나, 이미 Docker를 사용 중인 경우
- **Apple Container 권장**: macOS 26 이상의 Apple Silicon Mac에서 Docker Desktop 설치 없이 무료로 가볍게 사용하려는 경우


1. `Dockerfile 생성`: 다음과 같은 스크립트로 Dockerfile을 생성합니다.
  ```dockerfile
  FROM ubuntu:20.04
  
  RUN apt-get update -y && apt-get install -y --no-install-recommends \
      git ca-certificates libc-ares2 \
      && rm -rf /var/lib/apt/lists/*

  RUN git clone --depth 1 https://github.com/doverunner/drm-cli-packager /drm-cli-packager

  # Select the binary that matches the build architecture (Intel: amd64, Apple Silicon: arm64)
  ARG TARGETARCH
  RUN case "$TARGETARCH" in \
        amd64) ARCH=x86_64 ;; \
        arm64) ARCH=aarch64 ;; \
        *) echo "unsupported arch: $TARGETARCH" >&2; exit 1 ;; \
      esac \
      && chmod 755 "/drm-cli-packager/bin/Ubuntu/${ARCH}/doverunner-drm-packager" \
      && ln -s "/drm-cli-packager/bin/Ubuntu/${ARCH}/doverunner-drm-packager" /usr/local/bin/doverunner-drm-packager

  ENTRYPOINT ["doverunner-drm-packager"]
  ```

2. `Ubuntu 이미지 빌드`: 생성한 Dockerfile을 이용해 Ubuntu 이미지를 빌드합니다. 
```sh
docker build -t <user-name>/ubuntu-packager .
```

3. `패키저 커맨드 실행`: Ubuntu 컨테이너에서 다음과 같은 커맨드로 패키저를 실행합니다. (예시)
```sh
docker run \
	-v /Users/my/workspace/contents:/contents \
	-v /Users/my/workspace/packaging-output:/packaging-output \
	-it \
	--rm \
	<user-name>/ubuntu-packager \
	-o /packaging-output -i /contents/sintel/Sintel.2010.480P.mp4 --disable_encryption --dash
```

:::note 

위 Dockerfile은 사용 중인 Mac(인텔 또는 애플 실리콘)에 맞춰 `x86_64` 또는 `aarch64` 용 Ubuntu 바이너리를 자동으로 선택합니다. 런타임에 `libc-ares2`가 필요하며, 설치하지 않으면 `libcares.so.2: cannot open shared object file` 오류와 함께 패키저가 실행되지 않습니다.

:::

#### 도커 대신 Apple Container 사용하기

macOS 26 이상의 Apple Silicon Mac에서는 Docker Desktop 대신 [Apple Container](https://github.com/apple/container)를 사용할 수 있습니다. 위와 동일한 Dockerfile을 그대로 사용하며, `container build`와 `container run`은 `docker` 명령과 같은 옵션을 지원하므로 위 1~3단계를 그대로 적용할 수 있습니다.

1. `Apple Container 설치`: [GitHub Releases 페이지](https://github.com/apple/container/releases)에서 서명된 설치 패키지(`.pkg`)를 내려받아 설치합니다. Homebrew cask는 제공되지 않습니다.

2. `컨테이너 서비스 시작`: 다음 명령을 실행합니다. 최초 실행 시 기본 커널 설치 여부를 묻는데, `Y`를 입력합니다.
```sh
container system start
```

3. `이미지 빌드 및 패키저 실행`: 도커 단계와 동일한 Dockerfile과 인자를 사용하되, `docker`를 `container`로 바꿔 실행합니다.
```sh
container build -t <user-name>/ubuntu-packager .

container run \
	-v /Users/my/workspace/contents:/contents \
	-v /Users/my/workspace/packaging-output:/packaging-output \
	--rm \
	<user-name>/ubuntu-packager \
	-o /packaging-output -i /contents/sintel/Sintel.2010.480P.mp4 --disable_encryption --dash
```

:::note

비대화형 셸(CI, 스크립트 등)에서는 커널 설치 질문에 답할 수 없어 `container system start`가 `failed to read user input` 오류로 실패합니다. 먼저 대화형 터미널에서 한 번 실행해 주세요.

:::

## 실행 인자 및 에러 코드

실행 명령 형식, 전체 명령어 옵션, 외부 키 옵션, 에러 코드는 [DRM CLI 패키저 실행 인자 및 에러 코드](https://docs.doverunner.com/ko/content-security/multi-drm/packaging/cli-packager-reference/) 문서에서 확인할 수 있습니다.

## 예제

:::note 

입력 값 중 `--enc_token` (KMS 토큰) 파라미터는 `--site_id`와 `--access_key`의 조합으로 대체할 수 있습니다. (이전 버전 호환성 지원) 해당 값들은 도브러너 서비스 가입 후 콘솔 사이트에서 확인할 수 있으며, 아래 예제의 입력 값들은 고객사의 도브러너 계정에 발급된 값으로 변경하셔야 합니다.

:::

### DASH 패키징

PlayReady, Widevine DRM으로 보호되는 DASH 스트림 패키징입니다. 일반적으로 HLS 패키징과 함께 실행합니다. (`--dash --hls` 입력)

```sh
./doverunner-drm-packager --enc_token YOUR-KMS-TOKEN-VALUE --content_id test-content-1 --dash -i ./input/test-content-1.mp4 -o ./output/test-content-1
```

### HLS 패키징

FairPlay Streaming DRM으로 보호되는 HLS 스트림 패키징입니다. 일반적으로 DASH 패키징과 함께 실행합니다. (`--dash --hls` 입력

```sh
./doverunner-drm-packager --enc_token YOUR-KMS-TOKEN-VALUE --content_id test-content-1 --hls -i ./input/test-content-1.mp4 -o ./output/test-content-1
```

### CMAF 패키징

PlayReady, Widevine, FPS DRM으로 보호되는 CMAF 방식 스트림 패키징입니다.

```sh
./doverunner-drm-packager --enc_token YOUR-KMS-TOKEN-VALUE --content_id test-content-1 --cmaf -i ./input/test-content-1.mp4 -o ./output/test-content-1
```

### NCG 패키징

다운로드 또는 Progressive Download 시나리오에 사용되는 NCG DRM으로 암호화된 MP4 파일 패키징입니다. (`.ncg` 확장자 파일 생성)

```sh
./doverunner-drm-packager --enc_token YOUR-KMS-TOKEN-VALUE --content_id test-content-1 --ncg -i ./input/test-content-1.mp4 -o ./output/test-content-1
```

### HLS-NCG 패키징

NCG DRM으로 clear key를 보호하는 SAMPLE-AES 방식 HLS 스트림 패키징입니다. 이 유형은 DASH 또는 HLS(FPS) 등 다른 유형의 출력과 함께 실행할 수 없습니다.

```sh
./doverunner-drm-packager --enc_token YOUR-KMS-TOKEN-VALUE --content_id test-content-1 --hls_ncg -i ./input/test-content-1.mp4 -o ./output/test-content-1
```

### WisePlay 패키징

Huawei 기기 지원을 위해 WisePlay DRM으로 보호되는 DASH 콘텐츠를 패키징하는 경우입니다.

```sh
./doverunner-drm-packager --enc_token YOUR-KMS-TOKEN-VALUE --content_id test-content-1 --dash --wiseplay_drm -i ./input/test-content-1.mp4 -o ./output/test-content-1
```

### Adaptive-Streaming 패키징

DASH 또는 HLS 패키징 시, 여러 해상도의 콘텐츠를 입력해 Adaptive Streaming 형태로 패키징하는 방법입니다.

```sh
./doverunner-drm-packager --enc_token YOUR-KMS-TOKEN-VALUE --content_id test-content-1 --dash --hls -i ./input/test-content-1-480p.mp4 ./input/test-content-1-720p.mp4 ./input/test-content-1-1080p.mp4 -o ./output/test-content-1
```

### 외부 키 입력 (DASH, HLS)

도브러너 키 서버에서 생성하는 암호 키 대신, 서비스 사이트가 직접 관리하는 키를 이용해 멀티 DRM으로 패키징하는 방법입니다.

```sh
./doverunner-drm-packager --content_id test-content-1 --dash --hls --enable_raw_key_encryption --keys label=:key_id=f3c5e0361e6654b28f8049c778b23946:key=a4631a153a443df9eed0593043db7519 -i ./input/test-content-1.mp4 -o ./output/test-content-1
```

### 외부 키 입력 (NCG, HLS-NCG)

도브러너 키 서버에서 생성하는 암호 키 대신, 서비스 사이트가 직접 관리하는 키를 이용해 NCG DRM으로 패키징하는 방법입니다.

```sh
./doverunner-drm-packager --site_id SITE --content_id test-content-1 --enable_raw_key_encryption --ncg_cek a4631a153a443df9eed0593043db7519f3c5e0361e6654b28f8049c778b23946 --ncg --hls_ncg -i ./input/test-content-1.mp4 -o ./output/test-content-1
```

### 설정 파일 사용

입력 파라미터 중에서 고정된 설정 값들을 별도의 설정 파일로 저장해 사용하는 방법입니다.

```sh
./doverunner-drm-packager --config_file ./config.txt --content_id test-content-1 -i ./input/test-content-1.mp4 -o ./output/test-content-1
```

#### 설정 파일 예제

-  config.txt (Default = Json) 
    ```json 
    {
        "site_id": "SITE",
        "access_key": "DgBluIlxajZpPPjSIuqS6NcknqqG7RCt"
    }
    ```

- config.xml 
    ```xml
    <?xml version="1.0" encoding="UTF-8"?>
    <config> 
      <site_id>SITE</site_id> 
      <access_key>DgBluIlxajZpPPjSIuqS6NcknqqG7RCt</access_key>
    </config>
    ```

### 자막 패키징 

> VTT 포맷의 외부 자막만 지원됩니다.

```sh
./doverunner-drm-packager --enc_token YOUR-KMS-TOKEN-VALUE --content_id test-content-1 -i ./input/test-content-1.mp4 -o ./output/test-content-1 --dash --hls --subtitle ./input/test-content-1-en.vtt:lang=en:name=English ./input/test-content-1-ko.vtt:lang=ko:name=Korean ./input/test-content-1-fr.vtt:lang=fr:name=French ... 
```

### 멀티 키 패키징

```sh
./doverunner-drm-packager --enc_token YOUR-KMS-TOKEN-VALUE --content_id test-content-1 -i ./input/test-content-1-720p.mp4 ./input/test-content-1-1080p.mp4 -o ./output/test-content-1 --dash --multi_key
```

### 멀티 키 패키징 (외부 키 사용 시)

```sh
./doverunner-drm-packager --content_id test-content-1 --dash --enable_raw_key_encryption --keys label=SD:key_id=f3c5e0361e6654b28f8049c778b23946:key=a4631a153a443df9eed0593043db7519, label=HD:key_id=8f8049c778b23946f3c5e0361e6654b2:key=eed0593043db7519a4631a153a443df9, label=AUDIO:key_id=e0361e6654b28f80f3c549c778b23946:key=1a153a443df9eed0a463593043db7519 -i ./input/test-content-1-480p.mp4 ./input/test-content-1-720p.mp4 ./input/test-content-1-audio.m4a -o ./output/test-content-1
```

### 멀티 매니페스트 생성

```sh
./doverunner-drm-packager --site_id <site id> --access_key <access key> --content_id <content id> -o <output directory> --dash --multi_key -i <input file1> <input file2> ... --generate_tracktype_manifests 
```