도브러너 DRM CLI 패키저 가이드
본 문서는 도브러너 멀티 DRM 클라우드 서비스에 사용되는 CLI(Command Line Interface) 기반 콘텐츠 패키징 툴의 기본 개념과 사용 방법을 설명합니다.
콘텐츠 패키징은 아래와 같이 다섯 가지 유형이 있습니다.
DASH: MPEG-DASH CENC 규격으로 스트리밍 콘텐츠를 패키징하여 PlayReady와 Widevine Modular 또는 Huawei WisePlay DRM을 적용하는 방식HLS: HLS-AES 스트리밍 콘텐츠를 패키징하여 FPS(FairPlay Streaming) DRM을 적용하는 방식CMAF: Common Media Application Format 방식 출력으로 단일 콘텐츠에 Widevine, PlayReady, FPS DRM 적용NCG: 도브러너의 자체 규격인 NCG(Netsync Content Guard) DRM으로 콘텐츠를 암호화하여 다운로드 또는 Progressive Download용 콘텐츠로 패키징하는 방식HLS-NCG: SAMPLE-AES 방식의 클리어키 HLS 콘텐츠를 NCG DRM을 통해 보호하는 방식
본 문서는 4.3.0 버전의 DRM CLI 패키져를 기준으로 작성되었습니다. DRM CLI 패키져는 Github 저장소에서 다운받을 수 있습니다.
Shaka Packager vs. DRM CLI Packager
Section titled “Shaka Packager vs. DRM CLI Packager”Doverunner는 Shaka Packager에 기반한 두 가지 패키징 옵션을 제공합니다. 필요에 따라 선택하세요.
| 특징 | Shaka Packager 연동 | DRM CLI Packager |
|---|---|---|
| 적합한 사용자 | 기존 Shaka 워크플로우가 있는 개발자 | 추가 설정 없이 빠르게 시작하려는 사용자 |
| 유연성 | 모든 Shaka Packager 기능 사용 가능 | 일반적인 사용 사례에 맞게 사전 구성됨 |
| 설정 | Python 환경 및 수동 구성 필요 | 독립 실행형, 최소한의 설정 |
| 커스터마이징 | 패키징 파라미터 완전 제어 | 표준 시나리오를 위한 간소화된 옵션 |
| 업데이트 | 최신 Shaka Packager 버전 독립적으로 사용 가능 | Doverunner 호환성 검증된 관리형 릴리스 |
동영상 튜토리얼
Section titled “동영상 튜토리얼”도브러너 DRM CLI 패키저에 대한 설명과 윈도우즈 OS에서의 사용 방법에 대한 튜토리얼 영상입니다. (영문 버전)
연동 구조 및 설치 환경
Section titled “연동 구조 및 설치 환경”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을 기반으로 개발되었습니다. Shaka Packager에 대한 상세 설명과 문서, 소스 코드 등은 해당 Github 페이지를 참고하시기 바랍니다.
리눅스 환경에서의 패키저 실행
Section titled “리눅스 환경에서의 패키저 실행”리눅스 환경에서는 OS 배포판 및 버전에 따라 특정 버전의 라이브러리가 필요할 수 있습니다.
Ubuntu 환경
Section titled “Ubuntu 환경”Ubuntu 18.04 이하 버전의 경우, 더 높은 버전의 glibc 라이브러리가 필요하므로 아래와 같이 gcc/g++ 버전 9를 설치합니다.
$ 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++-9Ubuntu 22.04 이상 버전에서는 기본적으로 OpenSSL 버전 3.x만 설치되어 있으므로 아래와 같이 버전 1.1.x를 설치합니다.
$ 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_PATHCentOS 환경
Section titled “CentOS 환경”1.16.0 버전 이상의 c-ares 라이브러리를 설치합니다.
$ 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_PATHmacOS 환경에서의 패키저 실행
Section titled “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 설치 없이 무료로 가볍게 사용하려는 경우
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 TARGETARCHRUN 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"]Ubuntu 이미지 빌드: 생성한 Dockerfile을 이용해 Ubuntu 이미지를 빌드합니다.
docker build -t <user-name>/ubuntu-packager .패키저 커맨드 실행: Ubuntu 컨테이너에서 다음과 같은 커맨드로 패키저를 실행합니다. (예시)
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도커 대신 Apple Container 사용하기
Section titled “도커 대신 Apple Container 사용하기”macOS 26 이상의 Apple Silicon Mac에서는 Docker Desktop 대신 Apple Container를 사용할 수 있습니다. 위와 동일한 Dockerfile을 그대로 사용하며, container build와 container run은 docker 명령과 같은 옵션을 지원하므로 위 1~3단계를 그대로 적용할 수 있습니다.
-
Apple Container 설치: GitHub Releases 페이지에서 서명된 설치 패키지(.pkg)를 내려받아 설치합니다. Homebrew cask는 제공되지 않습니다. -
컨테이너 서비스 시작: 다음 명령을 실행합니다. 최초 실행 시 기본 커널 설치 여부를 묻는데,Y를 입력합니다.
container system start이미지 빌드 및 패키저 실행: 도커 단계와 동일한 Dockerfile과 인자를 사용하되,docker를container로 바꿔 실행합니다.
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실행 인자 및 에러 코드
Section titled “실행 인자 및 에러 코드”실행 명령 형식, 전체 명령어 옵션, 외부 키 옵션, 에러 코드는 DRM CLI 패키저 실행 인자 및 에러 코드 문서에서 확인할 수 있습니다.
DASH 패키징
Section titled “DASH 패키징”PlayReady, Widevine DRM으로 보호되는 DASH 스트림 패키징입니다. 일반적으로 HLS 패키징과 함께 실행합니다. (--dash --hls 입력)
./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-1HLS 패키징
Section titled “HLS 패키징”FairPlay Streaming DRM으로 보호되는 HLS 스트림 패키징입니다. 일반적으로 DASH 패키징과 함께 실행합니다. (--dash --hls 입력
./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-1CMAF 패키징
Section titled “CMAF 패키징”PlayReady, Widevine, FPS DRM으로 보호되는 CMAF 방식 스트림 패키징입니다.
./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-1NCG 패키징
Section titled “NCG 패키징”다운로드 또는 Progressive Download 시나리오에 사용되는 NCG DRM으로 암호화된 MP4 파일 패키징입니다. (.ncg 확장자 파일 생성)
./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-1HLS-NCG 패키징
Section titled “HLS-NCG 패키징”NCG DRM으로 clear key를 보호하는 SAMPLE-AES 방식 HLS 스트림 패키징입니다. 이 유형은 DASH 또는 HLS(FPS) 등 다른 유형의 출력과 함께 실행할 수 없습니다.
./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-1WisePlay 패키징
Section titled “WisePlay 패키징”Huawei 기기 지원을 위해 WisePlay DRM으로 보호되는 DASH 콘텐츠를 패키징하는 경우입니다.
./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-1Adaptive-Streaming 패키징
Section titled “Adaptive-Streaming 패키징”DASH 또는 HLS 패키징 시, 여러 해상도의 콘텐츠를 입력해 Adaptive Streaming 형태로 패키징하는 방법입니다.
./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)
Section titled “외부 키 입력 (DASH, HLS)”도브러너 키 서버에서 생성하는 암호 키 대신, 서비스 사이트가 직접 관리하는 키를 이용해 멀티 DRM으로 패키징하는 방법입니다.
./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)
Section titled “외부 키 입력 (NCG, HLS-NCG)”도브러너 키 서버에서 생성하는 암호 키 대신, 서비스 사이트가 직접 관리하는 키를 이용해 NCG DRM으로 패키징하는 방법입니다.
./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설정 파일 사용
Section titled “설정 파일 사용”입력 파라미터 중에서 고정된 설정 값들을 별도의 설정 파일로 저장해 사용하는 방법입니다.
./doverunner-drm-packager --config_file ./config.txt --content_id test-content-1 -i ./input/test-content-1.mp4 -o ./output/test-content-1설정 파일 예제
Section titled “설정 파일 예제”-
config.txt (Default = Json)
{"site_id": "SITE","access_key": "DgBluIlxajZpPPjSIuqS6NcknqqG7RCt"} -
config.xml
<?xml version="1.0" encoding="UTF-8"?><config><site_id>SITE</site_id><access_key>DgBluIlxajZpPPjSIuqS6NcknqqG7RCt</access_key></config>
자막 패키징
Section titled “자막 패키징”VTT 포맷의 외부 자막만 지원됩니다.
./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 ...멀티 키 패키징
Section titled “멀티 키 패키징”./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멀티 키 패키징 (외부 키 사용 시)
Section titled “멀티 키 패키징 (외부 키 사용 시)”./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멀티 매니페스트 생성
Section titled “멀티 매니페스트 생성”./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