๊ตฌ์„ฑ ์˜ˆ

์ด ํŽ˜์ด์ง€์—์„œ๋Š” ์ž…๋ ฅ ๋ฏธ๋””์–ด ํŒŒ์ผ ์ธ์ฝ”๋”ฉ(์ฆ‰, ElementaryStream)์˜ ์ผ๋ถ€ ๊ตฌ์„ฑ ์˜ˆ์‹œ๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

๋™์˜์ƒ ์ŠคํŠธ๋ฆผ

VideoStream ์†์„ฑ์€ ์„œ๋กœ ์ข…์†์ ์ด์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•ด์ƒ๋„(๋†’์ด ๋ฐ ๋„ˆ๋น„), ๋น„ํŠธ ์ „์†ก๋ฅ , ํ”„๋ ˆ์ž„ ์†๋„์™€ ๊ฐ™์€ ์†์„ฑ์„ ๊ฐœ๋ณ„์ ์œผ๋กœ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

{
  "videoStream": {
    "h264": {
      "profile": "high",
      "preset": "veryfast",
      "heightPixels": 360,
      "widthPixels": 640,
      "pixelFormat": "yuv420p",
      "bitrateBps": 550000,
      "rateControlMode": "vbr",
      "crfLevel": 21,
      "vbvSizeBits": 550000,
      "vbvFullnessBits": 495000,
      "gopDuration": "3s",
      "entropyCoder": "cabac",
      "bFrameCount": 3,
      "frameRate": 30,
      "aqStrength": 1
    }
  },
  "key": "video-stream0"
}

์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ

ํŠน์ • AudioStream ์†์„ฑ์€ ์„œ๋กœ์—๊ฒŒ ์ข…์†์ ์ž…๋‹ˆ๋‹ค. channelCount ์†์„ฑ ๊ฐ’์€ channelLayout ๋ฐฐ์—ด์˜ ๋ ˆ์ด์•„์›ƒ ์ˆ˜์™€ ๊ฐ™์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ ์ด ๊ฐ’์€ ๋งคํ•‘๋œ ์ž…๋ ฅ ์ŠคํŠธ๋ฆผ์˜ ์ฑ„๋„ ์ˆ˜์™€ ๊ฐ™์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ๋ณธ ์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ

๋‹ค์Œ์€ ๋งคํ•‘๋˜์ง€ ์•Š๊ณ  ๋ฏน์‹ฑ๋˜์ง€ ์•Š์€ ์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ์˜ ์˜ˆ์‹œ์ž…๋‹ˆ๋‹ค.

{
  "audioStream": {
    "codec": "aac",
    "bitrateBps": 64000,
    "channelCount": 2,
    "channelLayout": [
      "fl",
      "fr"
    ],
    "sampleRateHertz": 48000,
    "languageCode": "en-US",
    "displayName": "English"
  },
  "key": "audio-stream0"
}

๋งคํ•‘๋œ ์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ

๋‹ค์Œ์€ ์ž…๋ ฅ์ด ๋งคํ•‘๋œ ์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ์˜ ์˜ˆ์‹œ์ž…๋‹ˆ๋‹ค. ์ถœ๋ ฅ ์Šคํ…Œ๋ ˆ์˜ค AudioStream์€ ๋‹ค์Œ ์ž…๋ ฅ์œผ๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.

  • ํŠธ๋ž™ 1
    • ์ฑ„๋„ 0
  • ํŠธ๋ž™ 1
    • ์ฑ„๋„ 1

channelCount ์†์„ฑ ๊ฐ’์€ mapping ์•„๋ž˜์— ์ •์˜๋œ ๊ฐ์ฒด ์ˆ˜์™€ ๊ฐ™์•„์•ผ ํ•˜๋ฉฐ ๊ฐ ๊ฐ์ฒด๋งˆ๋‹ค ๊ณ ์œ  outputChannel์ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

{
  "key":  "audio-stream0",
  "audioStream": {
    "codec": "aac",
    "bitrateBps": 64000,
    "channelCount": 2,
    "channelLayout": [
      "fl",
      "fr"
    ],
    "sampleRateHertz": 48000,
    "languageCode": "en-US",
    "displayName": "English",
    "mapping": [
      {
        "atomKey": "atom0",
        "inputKey": "video_and_stereo_audio",
        "inputTrack": 1,
        "inputChannel": 0,
        "outputChannel": 0,
        "gainDb": 0
      },
      {
        "atomKey": "atom0",
        "inputKey": "video_and_stereo_audio",
        "inputTrack": 1,
        "inputChannel": 1,
        "outputChannel": 1,
        "gainDb": 0
      }
    ]
  }
}

๋ฏน์‹ฑ๋œ ์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ

๋‹ค์Œ์€ ๋ฏน์‹ฑ๋œ ์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ์˜ ์˜ˆ์‹œ์ž…๋‹ˆ๋‹ค. ์ถœ๋ ฅ ์Šคํ…Œ๋ ˆ์˜ค AudioStream์€ ๋‹ค์Œ ์ž…๋ ฅ์œผ๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.

  • ํŠธ๋ž™ 2
    • ์ฑ„๋„ 0
    • ์ฑ„๋„ 2
    • ์ฑ„๋„ 4
  • ํŠธ๋ž™ 2
    • ์ฑ„๋„ 1
    • ์ฑ„๋„ 3
    • ์ฑ„๋„ 5
{
  "key":  "audio-stream0",
  "audioStream":  {
    "codec":  "aac",
    "bitrateBps":  128000,
    "channelCount":  2,
    "mapping":  [
      {
        "atomKey": "atom0",
        "inputKey": "video_and_stereo_audio",
        "inputTrack": 2,
        "inputChannel": 0,
        "outputChannel": 0,
        "gainDb": 0
      },
      {
        "atomKey": "atom0",
        "inputKey": "video_and_stereo_audio",
        "inputTrack": 2,
        "inputChannel": 2,
        "outputChannel": 0,
        "gainDb": 0
      },
      {
        "atomKey": "atom0",
        "inputKey": "video_and_stereo_audio",
        "inputTrack": 2,
        "inputChannel": 4,
        "outputChannel": 0,
        "gainDb": 0
      },
      {
        "atomKey": "atom0",
        "inputKey": "video_and_stereo_audio",
        "inputTrack": 2,
        "inputChannel": 1,
        "outputChannel": 1,
        "gainDb": 0
      },
      {
        "atomKey": "atom0",
        "inputKey": "video_and_stereo_audio",
        "inputTrack": 2,
        "inputChannel": 3,
        "outputChannel": 1,
        "gainDb": 0
      },
      {
        "atomKey": "atom0",
        "inputKey": "video_and_stereo_audio",
        "inputTrack": 2,
        "inputChannel": 5,
        "outputChannel": 1,
        "gainDb": 0
      }
    ],
    "sampleRateHertz":  44100
  }
}

๋‹จ์ผ ํŒŒ์ผ์˜ ๋‹ค๊ตญ์–ด ์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ

๋‹ค์Œ์€ ์„œ๋กœ ๋‹ค๋ฅธ ์–ธ์–ด๋กœ ๋œ ๋™์˜์ƒ ๋ฐ ์—ฌ๋Ÿฌ ์˜ค๋””์˜ค ํŠธ๋ž™์ด ํฌํ•จ๋œ ๋‹จ์ผ ์ž…๋ ฅ ๋™์˜์ƒ ํŒŒ์ผ์˜ ๊ตฌ์„ฑ ์˜ˆ์‹œ์ž…๋‹ˆ๋‹ค. mapping[] ๊ฐ์ฒด๋Š” ์–ธ์–ด๋‹น ํ•˜๋‚˜์”ฉ ์—ฌ๋Ÿฌ ๊ฐœ์˜ ์ถœ๋ ฅ ์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ์„ ๋งŒ๋“œ๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ๋™์˜์ƒ ๋ฐ ๊ฐ ์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ์€ HLS ๋ฐ DASH ๋งค๋‹ˆํŽ˜์ŠคํŠธ ๋ชจ๋‘์— ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

{
  "outputUri": "gs://STORAGE_BUCKET_NAME/",
  "config": {
    "inputs": [
      {
        "key": "input0",
        "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO"
      }
    ],
    "editList": [
      {
        "key": "atom0",
        "inputs": [
          "input0"
        ],
        "startTimeOffset": "0s"
      }
    ],
    "elementaryStreams": [
      {
        "key": "video-stream0",
        "videoStream": {
          "h264": {
            "widthPixels": 640,
            "heightPixels": 360,
            "frameRate": 30,
            "bitrateBps": 500000
          }
        }
      },
      {
        "key": "audio-stream0",
        "audioStream": {
          "codec": "aac",
          "bitrateBps": 64000,
          "channelCount": 2,
          "channelLayout": [
            "fl",
            "fr"
          ],
          "mapping": [
            {
              "atomKey": "atom0",
              "inputKey": "input0",
              "inputTrack": 1,
              "inputChannel": 0,
              "outputChannel": 0
            },
            {
              "atomKey": "atom0",
              "inputKey": "input0",
              "inputTrack": 1,
              "inputChannel": 1,
              "outputChannel": 1
            }
          ],
          "sampleRateHertz": 48000,
          "languageCode": "en-US",
          "displayName": "English"
        }
      },
      {
        "key": "audio-stream1",
        "audioStream": {
          "codec": "aac",
          "bitrateBps": 64000,
          "channelCount": 2,
          "channelLayout": [
            "fl",
            "fr"
          ],
          "mapping": [
            {
              "atomKey": "atom0",
              "inputKey": "input0",
              "inputTrack": 2,
              "inputChannel": 0,
              "outputChannel": 0
            },
            {
              "atomKey": "atom0",
              "inputKey": "input0",
              "inputTrack": 2,
              "inputChannel": 1,
              "outputChannel": 1
            }
          ],
          "sampleRateHertz": 48000,
          "languageCode": "es-ES",
          "displayName": "Spanish"
        }
      },
      {
        "key": "audio-stream2",
        "audioStream": {
          "codec": "aac",
          "bitrateBps": 64000,
          "channelCount": 2,
          "channelLayout": [
            "fl",
            "fr"
          ],
          "mapping": [
            {
              "atomKey": "atom0",
              "inputKey": "input0",
              "inputTrack": 3,
              "inputChannel": 0,
              "outputChannel": 0
            },
            {
              "atomKey": "atom0",
              "inputKey": "input0",
              "inputTrack": 3,
              "inputChannel": 1,
              "outputChannel": 1
            }
          ],
          "sampleRateHertz": 48000,
          "languageCode": "fr-Fr",
          "displayName": "French"
        }
      }
    ],
    "muxStreams": [
      {
        "key": "sd",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream0"
        ]
      },
      {
        "key": "audio-0",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream0"
        ]
      },
      {
        "key": "audio-1",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream1"
        ]
      },
      {
        "key": "audio-2",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream2"
        ]
      }
    ],
    "manifests": [
      {
        "fileName": "manifest.m3u8",
        "type": "HLS",
        "muxStreams": [
          "sd",
          "audio-0",
          "audio-1",
          "audio-2"
        ]
      },
      {
        "fileName": "manifest.mpd",
        "type": "DASH",
        "muxStreams": [
          "sd",
          "audio-0",
          "audio-1",
          "audio-2"
        ]
      }
    ]
  }
}

์—ฌ๋Ÿฌ ์˜ค๋””์˜ค ํŒŒ์ผ์˜ ๋‹ค๊ตญ์–ด ์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ

๋‹ค์Œ์€ ๋™์˜์ƒ ๋ฐ ํ•˜๋‚˜์˜ ๊ธฐ๋ณธ ์–ธ์–ด ์˜ค๋””์˜ค ํŠธ๋ž™๋งŒ ํฌํ•จ๋œ ์ž…๋ ฅ ๋™์˜์ƒ ํŒŒ์ผ์˜ ๊ตฌ์„ฑ ์˜ˆ์‹œ์ž…๋‹ˆ๋‹ค. ์–ธ์–ด๋‹น ํ•˜๋‚˜์”ฉ ๋‘ ๊ฐœ์˜ ๋ณ„๋„ ์ž…๋ ฅ ์˜ค๋””์˜ค ํŒŒ์ผ๋„ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. mapping[] ๊ฐ์ฒด๋Š” ์–ธ์–ด๋‹น ํ•˜๋‚˜์”ฉ ์—ฌ๋Ÿฌ ๊ฐœ์˜ ์ถœ๋ ฅ ์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ์„ ๋งŒ๋“œ๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ๋™์˜์ƒ ๋ฐ ๊ฐ ์˜ค๋””์˜ค ์ŠคํŠธ๋ฆผ์€ HLS ๋ฐ DASH ๋งค๋‹ˆํŽ˜์ŠคํŠธ ๋ชจ๋‘์— ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

{
  "outputUri": "gs://STORAGE_BUCKET_NAME/",
  "config": {
    "inputs": [
      {
        "key": "input0",
        "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO"
      },
      {
        "key": "input1",
        "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_AUDIO1"
      },
      {
        "key": "input2",
        "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_AUDIO2"
      }
    ],
    "editList": [
      {
        "key": "atom0",
        "inputs": [
          "input0",
          "input1",
          "input2"
        ],
        "startTimeOffset": "0s"
      }
    ],
    "elementaryStreams": [
      {
        "key": "video-stream0",
        "videoStream": {
          "h264": {
            "widthPixels": 640,
            "heightPixels": 360,
            "frameRate": 30,
            "bitrateBps": 500000
          }
        }
      },
      {
        "key": "audio-stream0",
        "audioStream": {
          "codec": "aac",
          "bitrateBps": 64000,
          "channelCount": 2,
          "channelLayout": [
            "fl",
            "fr"
          ],
          "mapping": [
            {
              "atomKey": "atom0",
              "inputKey": "input0",
              "inputTrack": 1,
              "inputChannel": 0,
              "outputChannel": 0
            },
            {
              "atomKey": "atom0",
              "inputKey": "input0",
              "inputTrack": 1,
              "inputChannel": 1,
              "outputChannel": 1
            }
          ],
          "sampleRateHertz": 48000,
          "languageCode": "en-US",
          "displayName": "English"
        }
      },
      {
        "key": "audio-stream1",
        "audioStream": {
          "codec": "aac",
          "bitrateBps": 64000,
          "channelCount": 2,
          "channelLayout": [
            "fl",
            "fr"
          ],
          "mapping": [
            {
              "atomKey": "atom0",
              "inputKey": "input1",
              "inputTrack": 0,
              "inputChannel": 0,
              "outputChannel": 0
            },
            {
              "atomKey": "atom0",
              "inputKey": "input1",
              "inputTrack": 0,
              "inputChannel": 1,
              "outputChannel": 1
            }
          ],
          "sampleRateHertz": 48000,
          "languageCode": "es-ES",
          "displayName": "Spanish"
        }
      },
      {
        "key": "audio-stream2",
        "audioStream": {
          "codec": "aac",
          "bitrateBps": 64000,
          "channelCount": 2,
          "channelLayout": [
            "fl",
            "fr"
          ],
          "mapping": [
            {
              "atomKey": "atom0",
              "inputKey": "input2",
              "inputTrack": 0,
              "inputChannel": 0,
              "outputChannel": 0
            },
            {
              "atomKey": "atom0",
              "inputKey": "input2",
              "inputTrack": 0,
              "inputChannel": 1,
              "outputChannel": 1
            }
          ],
          "sampleRateHertz": 48000,
          "languageCode": "fr-Fr",
          "displayName": "French"
        }
      }
    ],
    "muxStreams": [
      {
        "key": "sd",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream0"
        ]
      },
      {
        "key": "audio-0",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream0"
        ]
      },
      {
        "key": "audio-1",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream1"
        ]
      },
      {
        "key": "audio-2",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream2"
        ]
      }
    ],
    "manifests": [
      {
        "fileName": "manifest.m3u8",
        "type": "HLS",
        "muxStreams": [
          "sd",
          "audio-0",
          "audio-1",
          "audio-2"
        ]
      },
      {
        "fileName": "manifest.mpd",
        "type": "DASH",
        "muxStreams": [
          "sd",
          "audio-0",
          "audio-1",
          "audio-2"
        ]
      }
    ]
  }
}

ํ…์ŠคํŠธ ์ŠคํŠธ๋ฆผ

TextStream ์†์„ฑ์€ ์„œ๋กœ ์ข…์†์ ์ด์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์†์„ฑ์„ ๊ฐœ๋ณ„์ ์œผ๋กœ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ํ…์ŠคํŠธ ์ŠคํŠธ๋ฆผ์€ ์ˆ˜์ • ๋ชฉ๋ก์„ ์‚ฌ์šฉํ•˜์—ฌ ์ถœ๋ ฅ ํŒŒ์ผ์„ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ ์„น์…˜์—์„œ๋Š” ์ˆ˜์ • ๋ชฉ๋ก์„ ์‚ฌ์šฉํ•˜์—ฌ ์ž๋ง‰์„ ์ œ๊ณตํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ง‘์ค‘์ ์œผ๋กœ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ ์˜ˆ์‹œ์—์„œ๋Š” ์ˆ˜์ • ๋ชฉ๋ก์— Atom ํ•˜๋‚˜๊ฐ€ ์žˆ๋Š” ํ…์ŠคํŠธ ์ŠคํŠธ๋ฆผ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

{
  "editList":[
     {
        "key":"atom0",
        "inputs":[
           "video_input0",
           "caption_input0"
        ],
        "startTimeOffset":"0s",
        "endTimeOffset":"300s"
     }
  ],
  "elementaryStreams":[
    {
      "key": "cea-stream0",
      "textStream": {
        "codec": "cea708",
        "languageCode": "en-US",
        "displayName": "English",
        "mapping": [
          {
            "atomKey": "atom0",
            "inputKey": "caption_input0",
            "inputTrack": 0
          }
        ]
      }
    }
  ]
}

๋‹ค์Œ ์˜ˆ์‹œ์—์„œ๋Š” ํŽธ์ง‘ ๋ชฉ๋ก์— Atom ๋‘ ๊ฐœ๊ฐ€ ์žˆ๋Š” ํ…์ŠคํŠธ ์ŠคํŠธ๋ฆผ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

{
  "editList":[
     {
        "key":"atom0",
        "inputs":[
           "video_input0",
           "caption_input0"
        ],
        "startTimeOffset":"0s",
        "endTimeOffset":"300s"
     },
     {
        "key":"atom1",
        "inputs":[
           "video_input1",
           "caption_input1"
        ],
        "startTimeOffset":"0s",
        "endTimeOffset":"300s"
     }
  ],
  "elementaryStreams":[
    {
      "key": "cea-stream0",
      "textStream": {
        "codec": "cea708",
        "languageCode": "en-US",
        "displayName": "English",
        "mapping": [
          {
          "atomKey": "atom0",
          "inputKey": "caption_input0",
          "inputTrack": 0
          },
          {
          "atomKey": "atom1",
          "inputKey": "caption_input1",
          "inputTrack": 0
          }
        ]
      }
    }
  ]
}

๊ณ ๊ธ‰

๋‹ค์Œ ์„น์…˜์—์„œ๋Š” ๋‹ค์–‘ํ•œ ๊ณ ๊ธ‰ ๊ตฌ์„ฑ์„ ๊ฐ„๋žตํ•˜๊ฒŒ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

์˜ค๋””์˜ค ์ „์šฉ ์ถœ๋ ฅ

๋‹ค์Œ ๊ตฌ์„ฑ์€ ์˜ค๋””์˜ค ์ „์šฉ MP4 ๋ฐ TS ํŒŒ์ผ์„ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

{
  "config": {
    "inputs": [
      {
        "key": "input0",
        "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO"
      }
    ],
    "elementaryStreams": [
      {
        "key": "audio-stream0",
        "audioStream": {
          "codec": "aac",
          "bitrateBps": 64000,
          "languageCode": "en-US",
          "displayName": "English"
        }
      }
    ],
    "muxStreams": [
      {
        "key": "audio-only-ts",
        "fileName": "audio-only.ts",
        "container": "ts",
        "elementaryStreams": [
          "audio-stream0"
        ]
      },
      {
        "key": "audio-only-mp4",
        "fileName": "audio-only.mp4",
        "container": "mp4",
        "elementaryStreams": [
          "audio-stream0"
        ]
      }
    ],
    "manifests": [
    {
      "fileName": "manifest.m3u8",
      "type": "HLS",
      "muxStreams": [
        "audio-only-ts"
      ]
    }
    ],
    "output": {
      "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/"
    }
  }
}

MuxStream ๋ฐ fmp4

fmp4 ์ปจํ…Œ์ด๋„ˆ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” MuxStream์€ ElementaryStream ํ•˜๋‚˜๋งŒ ํฌํ•จํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์ปจํ…Œ์ด๋„ˆ์˜ ๊ฒฝ์šฐ ๋‘ ๊ฐœ์˜ MuxStreams์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ํ•˜๋‚˜๋Š” ์˜ค๋””์˜ค์šฉ์ด๊ณ  ๋‹ค๋ฅธ ํ•˜๋‚˜๋Š” ๋น„๋””์˜ค์šฉ์ž…๋‹ˆ๋‹ค.

"muxStreams":[
  {
    "key": "hd3-video",
    "container": "fmp4",
    "elementaryStreams":["video-stream1"]
  },
  {
    "key": "hd3-audio",
    "container": "fmp4",
    "elementaryStreams":["audio-stream1"]
  }
],

์—ฌ๋Ÿฌ ๋งค๋‹ˆํŽ˜์ŠคํŠธ์—์„œ ์ŠคํŠธ๋ฆผ ์žฌ์‚ฌ์šฉ

๋‹ค์Œ ์˜ˆ์‹œ ๊ตฌ์„ฑ์€ HLS ๋งค๋‹ˆํŽ˜์ŠคํŠธ์™€ DASH ๋งค๋‹ˆํŽ˜์ŠคํŠธ ๋ชจ๋‘์—์„œ ์‚ฌ์šฉ๋˜๋Š” 2๊ฐœ์˜ ๋™์˜์ƒ ์ธ์ฝ”๋”ฉ๊ณผ 1๊ฐœ์˜ ์˜ค๋””์˜ค ์ธ์ฝ”๋”ฉ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

{
  "config": {
    "inputs": [
      {
        "key": "input0",
        "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO"
      }
    ],
    "elementaryStreams": [
      {
        "videoStream": {
          "h264": {
            "heightPixels": 360,
            "widthPixels": 640,
            "bitrateBps": 500000,
            "frameRate": 30
          }
        },
        "key": "video-stream0"
      },
      {
        "videoStream": {
          "h264": {
            "heightPixels": 720,
            "widthPixels": 1280,
            "bitrateBps": 3200000,
            "frameRate": 30
          }
        },
        "key": "video-stream1"
      },
      {
        "audioStream": {
          "codec": "aac",
          "bitrateBps": 64000,
          "sampleRateHertz": 48000
        },
        "key": "audio-stream0"
      }
    ],
    "muxStreams": [
      {
        "key": "video-only-sd",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream0"
        ]
      },
      {
        "key": "video-only-hd",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream1"
        ]
      },
      {
        "key": "audio-only",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream0"
        ]
      }
    ],
    "manifests": [
      {
        "fileName": "manifest.m3u8",
        "type": "HLS",
        "muxStreams": [
          "video-only-sd",
          "video-only-hd",
          "audio-only"
        ]
      },
      {
        "fileName": "manifest.mpd",
        "type": "DASH",
        "muxStreams": [
          "video-only-sd",
          "video-only-hd",
          "audio-only"
        ]
      }
    ],
    "output": {
      "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/"
    }
  }
}

์—ฌ๋Ÿฌ ํ”„๋กœํ•„์˜ ํŠธ๋žœ์Šค์ฝ”๋”ฉ ์‹œ ๊ถŒ์žฅ ์„ค์ •

์ถœ๋ ฅ ํ•ด์ƒ๋„์™€ ๋น„ํŠธ ์ „์†ก๋ฅ ์˜ ๊ฒฝ์šฐ ์ž…๋ ฅ ํ•ด์ƒ๋„/ํ”„๋ ˆ์ž„ ์†๋„(50/60FPS)์— ๋”ฐ๋ผ ์ ์šฉ๋˜๋Š” ๊ฒฝ์šฐ 50/60FPS์— ๋” ๋†’์€ ํ”„๋ ˆ์ž„ ์†๋„ ๋‹จ๊ณ„๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. ์ถ”๊ฐ€ ๋‹จ๊ณ„๋ฅผ ์ถ”๊ฐ€ํ•˜๋ ค๋ฉด ๋” ๋งŽ์€ ์ปดํ“จํŒ… ์„ฑ๋Šฅ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ์€ ๊ถŒ์žฅ ๋‹จ๊ณ„์ž…๋‹ˆ๋‹ค.

ํ•ด์ƒ๋„(ScanMode)/ํ”„๋ ˆ์ž„ ์†๋„ H.264 ๋†’์€ ํ”„๋กœํ•„ ๋น„ํŠธ ์ „์†ก๋ฅ (Kbps)
170x96 p12/15 130
256x144 p25/30 240
416x234 p25/30 300
640x360 p25/30 400
768x432 p25/30 750
768x432 p25/30 1100
960x540 p25/30 2200
1280x720 p25/30 3300
1280x720 p50/60 5500
1920x1080 p25/30 6000
1920x1080 p50/60 9000

์˜ค๋””์˜ค์˜ ๊ฒฝ์šฐ ๊ถŒ์žฅ์‚ฌํ•ญ์€ ์ฑ„๋„ ์ˆ˜๋ฅผ ๊ธฐ์ค€์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค.

์ฑ„๋„ AAC ๋น„ํŠธ ์ „์†ก๋ฅ (Kbps)
2.0 64
2.0 160
5.1 384

์ด ์ถœ๋ ฅ ๋‹จ๊ณ„๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋‹ค์–‘ํ•œ ์กฐํ•ฉ์œผ๋กœ HLS ๋ฐ MPEG-DASH ๋งค๋‹ˆํŽ˜์ŠคํŠธ๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ๊ตฌ์„ฑ์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

{
  "config": {
    "inputs": [
        {
          "key": "input0",
          "uri": "gs://my-bucket/input0.mp4"
        }
      ],
    "elementaryStreams": [
      {
        "key": "video-stream0",
        "videoStream": {
          "h264": {
            "heightPixels": 96,
            "widthPixels": 170,
            "bitrateBps": 130000,
            "frameRate": 15,
            "gopDuration": "4.0s",
            "pixelFormat": "yuv420p",
            "rateControlMode": "crf",
            "crfLevel": 10,
            "bFrameCount": 3,
            "profile": "high",
            "enableTwoPass": true,
            "preset": "medium"
          }
        }
      },
      {
        "key": "video-stream1",
        "videoStream": {
          "h264": {
            "heightPixels": 144,
            "widthPixels": 256,
            "bitrateBps": 240000,
            "frameRate": 30,
            "gopDuration": "4.0s",
            "pixelFormat": "yuv420p",
            "rateControlMode": "crf",
            "crfLevel": 10,
            "bFrameCount": 3,
            "profile": "high",
            "enableTwoPass": true,
            "preset": "medium"
          }
        }
      },
      {
        "key": "video-stream2",
        "videoStream": {
          "h264": {
            "heightPixels": 234,
            "widthPixels": 416,
            "bitrateBps": 300000,
            "frameRate": 30,
            "gopDuration": "4.0s",
            "pixelFormat": "yuv420p",
            "rateControlMode": "crf",
            "crfLevel": 10,
            "bFrameCount": 3,
            "profile": "high",
            "enableTwoPass": true,
            "preset": "medium"
          }
        }
      },
      {
        "key": "video-stream3",
        "videoStream": {
          "h264": {
            "heightPixels": 360,
            "widthPixels": 640,
            "bitrateBps": 400000,
            "frameRate": 30,
            "gopDuration": "4.0s",
            "pixelFormat": "yuv420p",
            "rateControlMode": "crf",
            "crfLevel": 10,
            "bFrameCount": 3,
            "profile": "high",
            "enableTwoPass": true,
            "preset": "medium"
          }
        }
      },
      {
        "key": "video-stream4",
        "videoStream": {
          "h264": {
            "heightPixels": 432,
            "widthPixels": 768,
            "bitrateBps": 1100000,
            "frameRate": 30,
            "gopDuration": "4.0s",
            "pixelFormat": "yuv420p",
            "rateControlMode": "crf",
            "crfLevel": 10,
            "bFrameCount": 3,
            "profile": "high",
            "enableTwoPass": true,
            "preset": "medium"
          }
        }
      },
      {
        "key": "video-stream5",
        "videoStream": {
          "h264": {
            "heightPixels": 540,
            "widthPixels": 960,
            "bitrateBps": 2200000,
            "frameRate": 30,
            "gopDuration": "4.0s",
            "pixelFormat": "yuv420p",
            "rateControlMode": "crf",
            "crfLevel": 10,
            "bFrameCount": 3,
            "profile": "high",
            "enableTwoPass": true,
            "preset": "medium"
          }
        }
      },
      {
        "key": "video-stream6",
        "videoStream": {
          "h264": {
            "heightPixels": 720,
            "widthPixels": 1280,
            "bitrateBps": 3300000,
            "frameRate": 30,
            "gopDuration": "4.0s",
            "pixelFormat": "yuv420p",
            "rateControlMode": "crf",
            "crfLevel": 10,
            "bFrameCount": 3,
            "profile": "high",
            "enableTwoPass": true,
            "preset": "medium"
          }
        }
      },
      {
        "key": "video-stream7",
        "videoStream": {
          "h264": {
            "heightPixels": 720,
            "widthPixels": 1280,
            "bitrateBps": 5500000,
            "frameRate": 60,
            "gopDuration": "4.0s",
            "pixelFormat": "yuv420p",
            "rateControlMode": "crf",
            "crfLevel": 10,
            "bFrameCount": 6,
            "profile": "high",
            "enableTwoPass": true,
            "preset": "medium"
          }
        }
      },
      {
        "key": "video-stream8",
        "videoStream": {
          "h264": {
            "heightPixels": 1080,
            "widthPixels": 1920,
            "bitrateBps": 6000000,
            "frameRate": 30,
            "gopDuration": "4.0s",
            "pixelFormat": "yuv420p",
            "rateControlMode": "crf",
            "crfLevel": 10,
            "bFrameCount": 3,
            "profile": "high",
            "enableTwoPass": true,
            "preset": "medium"
          }
        }
      },
      {
        "key": "video-stream9",
        "videoStream": {
          "h264": {
            "heightPixels": 1080,
            "widthPixels": 1920,
            "bitrateBps": 9000000,
            "frameRate": 60,
            "gopDuration": "4.0s",
            "pixelFormat": "yuv420p",
            "rateControlMode": "crf",
            "crfLevel": 10,
            "bFrameCount": 6,
            "profile": "high",
            "enableTwoPass": true,
            "preset": "medium"
          }
        }
      },
      {
        "key": "audio-stream0",
        "audioStream": {
          "codec": "aac",
          "bitrateBps": 32000
        }
      },
      {
        "key": "audio-stream1",
        "audioStream": {
          "codec": "aac",
          "bitrateBps": 64000
        }
      },
      {
        "key": "audio-stream2",
        "audioStream": {
          "codec": "aac",
          "bitrateBps": 96000
        }
      },
      {
        "key": "audio-stream3",
        "audioStream": {
          "codec": "aac",
          "bitrateBps": 128000
        }
      },
      {
        "key": "audio-stream4",
        "audioStream": {
          "codec": "aac-he",
          "bitrateBps": 160000
        }
      },
      {
        "key": "audio-stream5",
        "audioStream": {
          "codec": "aac-he-v2",
          "bitrateBps": 384000
        }
      }
    ],
    "muxStreams": [
      {
        "key": "1",
        "container": "ts",
        "elementaryStreams": [
          "video-stream0",
          "audio-stream0"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "2",
        "container": "ts",
        "elementaryStreams": [
          "video-stream1",
          "audio-stream0"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "3",
        "container": "ts",
        "elementaryStreams": [
          "video-stream2",
          "audio-stream1"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "4",
        "container": "ts",
        "elementaryStreams": [
          "video-stream3",
          "audio-stream1"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "5",
        "container": "ts",
        "elementaryStreams": [
          "video-stream4",
          "audio-stream2"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "6",
        "container": "ts",
        "elementaryStreams": [
          "video-stream5",
          "audio-stream3"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "7",
        "container": "ts",
        "elementaryStreams": [
          "video-stream6",
          "audio-stream3"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "8",
        "container": "ts",
        "elementaryStreams": [
          "video-stream7",
          "audio-stream4"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "9",
        "container": "ts",
        "elementaryStreams": [
          "video-stream8",
          "audio-stream4"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "10",
        "container": "ts",
        "elementaryStreams": [
          "video-stream9",
          "audio-stream5"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "video-1",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream0"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "video-2",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream1"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "video-3",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream2"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "video-4",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream3"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "video-5",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream4"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "video-6",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream5"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "video-7",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream6"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "video-8",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream7"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "video-9",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream8"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "video-10",
        "container": "fmp4",
        "elementaryStreams": [
          "video-stream9"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "audio-1",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream0"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "audio-2",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream1"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "audio-3",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream2"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "audio-4",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream3"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "audio-5",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream4"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      },
      {
        "key": "audio-6",
        "container": "fmp4",
        "elementaryStreams": [
          "audio-stream5"
        ],
        "segmentSettings": {
            "segmentDuration": "4.0s",
            "individualSegments": true
        }
      }
    ],
    "manifests": [
        {
          "fileName": "manifest.m3u8",
          "type": "HLS",
          "muxStreams": [
            "10",
            "9",
            "8",
            "7",
            "6",
            "5",
            "4",
            "3",
            "2",
            "1"
          ]
        },
        {
          "fileName": "manifest.mpd",
          "type": "DASH",
          "muxStreams": [
            "video-10",
            "video-9",
            "video-8",
            "video-7",
            "video-6",
            "video-5",
            "video-4",
            "video-3",
            "video-2",
            "video-1",
            "audio-6",
            "audio-5",
            "audio-4",
            "audio-3",
            "audio-2",
            "audio-1"
          ]
        }
      ],
      "output": {
        "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/"
      }
  }
}