# OvenMediaEngine Configuration for DRM

## Configuration 단계

### DRM Info 파일 지정하기

`Server.xml`이 위치한 디렉토리를 기준으로 DRM 정보를 가지는 파일 (`.xml`)의 상대 경로 또는 절대 경로를 설정 할 수 있습니다.

```xml
<LLHLS>
    <ChunkDuration>0.5</ChunkDuration>
    <PartHoldBack>1.5</PartHoldBack>
    <SegmentDuration>6</SegmentDuration>
    <SegmentCount>10</SegmentCount>
    <DRM>
        <Enable>false</Enable>
        <InfoFile>path/to/file.xml</InfoFile>
    </DRM>
    <CrossDomains>
        <Url>*</Url>
    </CrossDomains>
</LLHLS>
```

### DRM Info 파일 구성하기

DRM Info 파일 (`.xml`)을 분리시켜 파일에 동적 변경을 적용할 수 있습니다. 새로운 Stream이 생성될 때마다 변경 사항이 적용됩니다.

DRM Info 파일을 다음과 같이 구성할 수 있습니다:

```xml
<?xml version="1.0" encoding="UTF-8"?>

<DRMInfo>
    <DRM>
        <Name>MultiDRM</Name>
        <VirtualHostName>default</VirtualHostName>
        <ApplicationName>app</ApplicationName>
        <StreamName>stream*</StreamName> <!-- Can be a wildcard regular expression -->
        <CencProtectScheme>cbcs</CencProtectScheme> <!-- cbcs, cenc -->
        <KeyId>572543f964e34dc68ba9ba9ef91d4xxx</KeyId> <!-- Hexadecimal -->
        <Key>16cf4232a86364b519e1982a27d90xxx</Key> <!-- Hexadecimal -->
        <Iv>572547f914e34dc68ba9ba9ef91d4xxx</Iv> <!-- Hexadecimal -->
        <Pssh>0000003f7073736800000000edef8ba979d64acea3c827dcd51d21ed0000001f1210572547f964e34dc68ba9ba9ef91d4c4a1a05657a64726d48f3c6899xxx</Pssh> <!-- Hexadecimal, for Widevine -->
        <!-- Add Pssh for FairPlay if needed -->
        <FairPlayKeyUrl>skd://fiarplay_key_url</FairPlayKeyUrl> <!-- FairPlay only -->
    </DRM>
    <DRM>
        <Name>MultiDRM2</Name>
        <VirtualHostName>default</VirtualHostName>
        <ApplicationName>app2</ApplicationName>
        <StreamName>stream*</StreamName> <!-- Can be a wildcard regular expression -->
         ...........
    </DRM>
</DRMInfo>
```

DRM이 적용될 `<VirtualHostName>`, `<ApplicationName>`, `<StreamName>`을 지정하여, Multiple `<DRM>` 설정이 가능합니다. 이때, `<StreamName>`은 와일드카드 정규 표현식 `*`을 지원합니다.

현재 `<CencProtectScheme>`은 "cbcs"과 "cenc"를 지원합니다. 다른 Schemes 추가 가능성은 제한적입니다.

`<KeyId>`, `<Key>`, `<Iv>`, `<Pssh>` 값은 필수이며, DRM Provider가 제공해야 합니다. `<FairPlayKeyUrl>`은 FairPlay에만 필요하며, 스트림에 FairPlay를 활성화하려면 필수로 설정해야 합니다. 이 값 또한 DRM provider가 제공해야합니다.

{% hint style="warning" %}
현재, DRM은 H.264 및 AAC 코덱만 지원하며, H.265에 대한 지원은 곧 추가될 예정입니다.
{% endhint %}

{% hint style="info" %}
세부 가이드: <https://docs.ovenmediaengine.com/streaming/low-latency-hls#drm-beta>
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ovenmediaengine-enterprise.gitbook.io/guide/ko-kr/features/access-control-and-security/digital-rights-management-drm/ovenmediaengine-configuration-for-drm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
