Получить все задачи на транскодирование

URL: https://apicdn.rcloud.ru/app/storage/v1/<your_account_name>/transcode


curl 'https://apicdn.rcloud.ru/app/storage/v1/testaccount/transcode?start=2021-10-10T00:00:00Z&end=2022-10-10T00:01:02Z' -H "CDN-AUTH-TOKEN: $TOKEN"


{
  "status": "Completed",
  "end": "2022-10-10T00:01:02Z",
  "start": "2021-10-10T00:00:00Z",
  "data": [
    {
      "id": "934136bf48c2412f9f1bb853f92a4c8a",
      "status": "Completed",
      "description": "Encoding video success."
    },
    {
      "id": "ba27bc62e9da46e48a406adabc50aec8",
      "status": "Completed",
      "description": "Encoding video success."
    }
  ]
}


Получить конкретную задачу на транскодирование

URL: https://apicdn.rcloud.ru/app/storage/v1/<your_account_name>/transcode/<task_id>

curl 'https://apicdn.rcloud.ru/app/storage/v1/testaccount/transcode/ba27bc62e9da46e48a406adabc50aec8' -H "CDN-AUTH-TOKEN: $TOKEN"


{
  "status": "Completed",
  "data": {
    "id": "ba27bc62e9da46e48a406adabc50aec8",
    "status": "Completed",
    "description": "Encoding video success."
  }
}

Получить пресеты транскодирования

Пресеты транскодирования - это наборы настроек, описывающие параметры видео- и аудиопотоков выходного файла процесса транскодирования.

URL: https://apicdn.rcloud.ru/app/storage/v1/<your_account_name>/transcode/presets

curl 'https://apicdn.rcloud.ru/app/storage/v1/testaccount/transcode/presets' -H "CDN-AUTH-TOKEN: $TOKEN"


{
  "status": "Completed",
  "data": {
    "presets": [
      {
        "id": "5676a27cf9cb101634000002",
        "name": "Fixed iframes: 1080p - watermark",
        "container": "mp4",
        "video": {
          "codec": "H.264",
          "bit_rate": "5400",
          "fps": "30",
          "keyframes_max_dist": "150",
          "max_width": "1920",
          "max_height": "1080",
          "profile": "baseline",
          "level": "4",
          "sizing_policy": "ShrinkToFit",
          "padding_policy": "NoPad",
          "aspect_ratio": "auto"
        },
        "audio": {
          "codec": "AAC",
          "bit_rate": "160",
          "sample_rate": "44100",
          "channels": "2"
        },
        "watermarks": {
          "BottomLeft": {
            "horizontal_align": "Left",
            "horizontal_offset": "10%",
            "vertical_align": "Bottom",
            "vertical_offset": "10%",
            "height": "",
            "width": "",
            "max_height": "10%",
            "max_width": "10%",
            "opacity": "100",
            "sizing_policy": "ShrinkToFit"
          },
          "BottomRight": {
            "horizontal_align": "Right",
            "horizontal_offset": "10%",
            "vertical_align": "Bottom",
            "vertical_offset": "10%",
            "height": "",
            "width": "",
            "max_height": "10%",
            "max_width": "10%",
            "opacity": "100",
            "sizing_policy": "ShrinkToFit"
          },
          "Full": {
            "horizontal_align": "Left",
            "horizontal_offset": "0%",
            "vertical_align": "Top",
            "vertical_offset": "0%",
            "height": "",
            "width": "",
            "max_height": "100%",
            "max_width": "100%",
            "opacity": "100",
            "sizing_policy": "Fit"
          },
          "TopRight": {
            "horizontal_align": "Right",
            "horizontal_offset": "10%",
            "vertical_align": "Top",
            "vertical_offset": "10%",
            "height": "",
            "width": "",
            "max_height": "10%",
            "max_width": "10%",
            "opacity": "100",
            "sizing_policy": "ShrinkToFit"
          }
        },
        "standard": true,
        "tags": [
          "Popular 16:9"
        ]
      },
      ...
    ]
  }
}

Получить статистику по задачам на транскодирование

URL: https://apicdn.rcloud.ru/app/storage/v1/<your_account_name>/transcode/stats

curl 'https://apicdn.rcloud.ru/app/storage/v1/testaccount/transcode/stats?start=2021-10-10T00:00:00Z&end=2022-10-10T00:01:02Z' -H "CDN-AUTH-TOKEN: $TOKEN"


{
  "status": "Completed",
  "end": "2022-10-10T00:01:02Z",
  "start": "2021-10-10T00:00:00Z",
  "data": {
    "transcode_operations": 12,
    "transcode_minutes": {
      "SD": 14,
      "HD": 5
    }
  }
}

Создать задачу на транскодирование $

URL: https://apicdn.rcloud.ru/app/storage/v1/<your_account_name>/transcode

curl 'https://apicdn.rcloud.ru/app/storage/v1/testaccount/transcode' -X POST --data '{"object_id": "617602e6cd0a6b1be6948e2b", "path": "/new_folder", "start": 5, "duration": 4, "send_email": true}' -H "Content-Type: application/json" -H "CDN-AUTH-TOKEN: $TOKEN"


{
  "status": "Completed",
  "data": {
    "task_id": "78e18299a591419fba61d7cab3ccf8b3"
  }
}