CAE 指南

內容感知編碼 (CAE) 會分析每個來源視訊,並智慧地為每個內容建立自訂位元速率階梯 (一組轉譯)。此外,「內容感知編碼」會考慮與用來檢視內容的傳遞網路和裝置相關的限制。它決定了需要多少轉譯,以及每個節目使用哪些解析度和位元率,同時在所有標題中仍保持一致的品質水平。這樣可大幅節省儲存空間和頻寬成本,同時改善使用者的播放體驗。有關其他信息,請參見上下文感知編碼概述

概覽

處理

通過設置在Zencoder作業上啟用CAE generate_dynamic_profile真實並添加dynamic_profile_rendition值到作業的輸出。另外,您可以添加dynamic_profile_options,但這不是必需的。下載並檢查作業的輸入源文件後,Zencoder在源文件上運行CAE動態配置文件生成器。生成的動態輪廓梯形圖設置在編碼之前已添加到每個相應的輸出。對於具有dynamic_profile_rendition值的輸出,將自動設置以下設置:

  • width
  • height
  • frame_rate
  • video_codec
  • video_codec_profile
  • video_codec_tier
  • video_codec_level
  • video_reference_frames
  • video_bframes
  • video_bitrate
  • decoder_bitrate_cap
  • decoder_buffer_size
  • keyframe_rate
  • fixed_keyframe_interval

混合編解碼器輸出:您可以輸出混合的HEVC / H.264再現。看到CAE設置有關詳細信息。

其他輸出沒有dynamic_profile_rendition將在動態配置文件生成器運行時同時檢查輸入源後立即開始編碼。

配置準則dynamic_profile_options

渲染數量

創建的最小和最大演繹次數由min_renditionsmax_renditions設置。為了獲得最佳性能,建議在這些限制之間留出一定的差距(例如,min_renditions到2和max_renditions到10),允許CAE配置文件生成器選擇最適合每個內容的編號。為了易於編碼內容,它可以產生更少的演繹,而對於更複雜的內容,它可以產生更多。還建議將min_renditions設置得盡可能小,以在不需要更多再現時節省帶寬。

決議案

默認情況下,CAE使用大約30種標準分辨率的階梯,範圍從192x1087680x4320。可以通過以下方式將其限制在低端或高端最小分辨率max_resolution設置。或者,可以在屏幕上提供分辨率和相關編解碼器設置的自定義列表。video_configurations設置。

GOP長度

keyframe_rate設置控制最大值GOP編碼內容的長度。將此設置為與segment_seconds用於HLS / DASH編碼。否則,建議值為0.5,相當於2秒GOP長度。

比特率覆蓋

可以使用的比特率限制可以通過min_bitratemax_bitrate設置。這將指示CAE至少分配min_bitrate第一次重演的Kbps,並將最後一次重演限制為最大max_bitrate Kbps。

為確保演繹比特率間隔適當,請使用min_granularitymax_granularity設置。例如,這些可用於確保從一個比特率到下一個比特率的步幅不小於50%的比特率增加或大於100%的比特率增加。請注意,大多數流創作指南均建議粒度不超過100%。

啟動延遲,惡劣網絡條件下的可靠性

為確保比特率階梯始終以足夠低的比特率開始,請使用max_first_rendition_bitrate設置。設置的第一個再現比特率越低,由於連接速度低,視頻播放器需要緩衝的可能性就越小。此外,如果流式清單表明首先加載最低比特率,則這也將直接影響啟動延遲。

支持舊設備

支持僅能Baseline配置文件H.264播放,請使用select_baseline_profile_configuration設置。設定此項後,至少一個演繹將被編碼為Baseline個人資料。附加約束(編解碼器配置文件,級別,參考幀數,b幀等)可以通過自定義進行控制video_configurations設置。

注意select_baseline_profile_configurationtrue默認情況下,它要求至少一次演繹具有512x288或以下的分辨率。

VBR可變性控制

最大峰值比特率可以通過bitrate_cap_to_bitrate_ratiobitrate_cap_offset設置。如果是比特率“R選擇“”進行演繹,然後coder_bitrate_cap計算為:

  decoder_bitrate_cap = R * bitrate_cap_to_bitrate_ratio + bitrate_cap_offset

同樣,解碼器緩衝區限制可以通過buffer_size_to_bitrate_ratiobuffer_size_offset設置。的decoder_buffer_size計算為:

  decoder_buffer_size = R * buffer_size_to_bitrate_ratio + buffer_size_offset

請注意,峰值比特率和緩衝區限制也可能受編解碼器配置文件和/或級別設置的約束。一些一般的設備兼容性問題可以通過限制來避免bitrate_cap_to_bitrate_ratio到2.0或更低,以及buffer_size_to_bitrate_ratio2.0 * GOP length(馬上)。

CAE和分段輸出

CAE與Zencoder中的分段輸出兼容。在Output再現設置,設置typesegmented和適當的segment_seconds值。也,keyframe_ratefixed_keyframe_interval設置必須在dynamic_profile_options

CAE-HLS示例

  {
    "input": "s3://test_bucket/test_media.mp4",
    "generate_dynamic_profile": true,
    "dynamic_profile_options": {
      "max_renditions": 6,
      "min_renditions": 2,
      "select_baseline_profile_configuration": true,
      "keyframe_rate": "0.5",
      "fixed_keyframe_interval": "true"
    },
    "outputs": [
      {
        "label": "CAE1",
        "dynamic_profile_rendition": 1,
        "base_url": "s3://test_bucket/outputs/HLS_CAE/CAE1",
        "filename": "CAE1.m3u8",
        "type": "segmented",
        "segment_seconds": 2,
        "byte_range_segmenting": true,
        "generate_keyframe_manifest": "true",
        "hls_protocol_version": 7,
        "skip_audio": true
      },
      {
        "label": "CAE2",
        "dynamic_profile_rendition": 2,
        "base_url": "s3://test_bucket/outputs/HLS_CAE/CAE2",
        "filename": "CAE2.m3u8",
        "type": "segmented",
        "segment_seconds": 2,
        "byte_range_segmenting": true,
        "generate_keyframe_manifest": "true",
        "hls_protocol_version": 7,
        "skip_audio": true
      },
      {
        "label": "CAE3",
        "dynamic_profile_rendition": 3,
        "base_url": "s3://test_bucket/outputs/HLS_CAE/CAE3",
        "filename": "CAE3.m3u8",
        "type": "segmented",
        "segment_seconds": 2,
        "byte_range_segmenting": true,
        "generate_keyframe_manifest": "true",
        "hls_protocol_version": 7,
        "skip_audio": true
      },
      {
        "label": "CAE4",
        "dynamic_profile_rendition": 4,
        "base_url": "s3://test_bucket/outputs/HLS_CAE/CAE4",
        "filename": "CAE4.m3u8",
        "type": "segmented",
        "segment_seconds": 2,
        "byte_range_segmenting": true,
        "generate_keyframe_manifest": "true",
        "hls_protocol_version": 7,
        "skip_audio": true
      },
      {
        "label": "CAE5",
        "dynamic_profile_rendition": 5,
        "base_url": "s3://test_bucket/outputs/HLS_CAE/CAE5",
        "filename": "CAE5.m3u8",
          "type": "segmented",
          "segment_seconds": 2,
          "byte_range_segmenting": true,
          "generate_keyframe_manifest": "true",
          "hls_protocol_version": 7,
          "skip_audio": true
        },
        {
          "label": "CAE6",
          "dynamic_profile_rendition": 6,
          "base_url": "s3://test_bucket/outputs/HLS_CAE/CAE6",
          "filename": "CAE6.m3u8",
          "type": "segmented",
          "segment_seconds": 2,
          "byte_range_segmenting": true,
          "generate_keyframe_manifest": "true",
          "hls_protocol_version": 7,
          "skip_audio": true
        }
        {
          "label": "Audio",
          "audio_bitrate": "128",
          "type": "segmented",
          "segment_seconds": 2,
          "byte_range_segmenting": true,
          "skip_video": true,
          "base_url": "s3://test_bucket/outputs/HLS_CAE/Audio/128k/",
          "filename": "audio_128k.ac3"
        },
        {
          "base_url": "s3://test_bucket/outputs/HLS_CAE/",
          "filename": "master_playlist.m3u8",
          "hls_protocol_version": 7,
          "type": "playlist",
          "allow_skipped_sources": true,
          "alternate_audio": {
            "128k_audio": {
              "path": "Audio/128k/audio_128k.m3u8",
              "language": "en",
              "source": "Audio"
            }
          }
          ],
          "streams": [
            {
              "path": "CAE1/CAE1.m3u8",
              "source": "CAE1",
              "audio": "128k_audio"
            },
            {
              "path": "CAE2/CAE2.m3u8",
              "source": "CAE2",
              "audio": "128k_audio"
            },
            {
              "path": "CAE3/CAE3.m3u8",
              "source": "CAE3",
              "audio": "128k_audio"
            },
            {
              "path": "CAE4/CAE4.m3u8",
              "source": "CAE4",
              "audio": "128k_audio"
            },
            {
              "path": "CAE5/CAE5.m3u8",
              "source": "CAE5",
              "audio": "128k_audio"
            },
            {
              "path": "CAE6/CAE6.m3u8",
              "source": "CAE6",
              "audio": "128k_audio"
            }
          ]
        }
      ]
    }

CAE-DASH示例

  
  {
    "input": "s3://test_bucket/test.mov",
    "generate_dynamic_profile": true,
    "dynamic_profile_options": {
      "max_renditions": 6,
      "min_renditions": 2,
      "select_baseline_profile_configuration": true,
      "keyframe_rate": "0.5",
      "fixed_keyframe_interval": "true"
    },
    "outputs": [
      {
        "label": "CAE1",
        "dynamic_profile_rendition": 1,
        "base_url": "s3://test_bucket/outputs/DASH_CAE/CAE1",
        "filename": "CAE1.mpd",
        "type": "segmented",
        "segment_seconds": 10,
        "streaming_delivery_format": "dash",
        "skip_audio": true,
        "public": true
      },
      {
        "label": "CAE2",
        "dynamic_profile_rendition": 2,
        "base_url": "s3://test_bucket/outputs/DASH_CAE/CAE2",
        "filename": "CAE2.mpd",
        "type": "segmented",
        "segment_seconds": 10,
        "streaming_delivery_format": "dash",
        "skip_audio": true,
        "public": true
      },
      {
        "label": "CAE3",
        "dynamic_profile_rendition": 3,
        "base_url": "s3://test_bucket/outputs/DASH_CAE/CAE3",
        "filename": "CAE3.mpd",
        "type": "segmented",
        "segment_seconds": 10,
        "streaming_delivery_format": "dash",
        "skip_audio": true,
        "public": true
      },
      {
        "label": "CAE4",
        "dynamic_profile_rendition": 4,
        "base_url": "s3://test_bucket/outputs/DASH_CAE/CAE4",
        "filename": "CAE4.mpd",
        "type": "segmented",
        "segment_seconds": 10,
        "streaming_delivery_format": "dash",
        "skip_audio": true,
        "public": true
      },
      {
        "label": "CAE5",
        "dynamic_profile_rendition": 5,
        "base_url": "s3://test_bucket/outputs/DASH_CAE/CAE5",
        "filename": "CAE5.mpd",
        "type": "segmented",
        "segment_seconds": 10,
        "streaming_delivery_format": "dash",
        "skip_audio": true,
        "public": true
      },
      {
        "label": "CAE6",
        "dynamic_profile_rendition": 6,
        "base_url": "s3://test_bucket/outputs/DASH_CAE/CAE6",
        "filename": "CAE6.mpd",
        "type": "segmented",
        "segment_seconds": 10,
        "streaming_delivery_format": "dash",
        "skip_audio": true,
        "public": true
      },
      {
        "label": "Audio",
        "audio_bitrate": "128",
        "type": "segmented",
        "segment_seconds": 10,
        "streaming_delivery_format": "dash",
        "skip_video": true,
        "base_url": "s3://test_bucket/outputs/DASH_CAE/Audio/128k/",
        "filename": "audio_128k.mpd",
        "public": true
      },
      {
        "base_url": "s3://test_bucket/outputs/DASH_CAE/",
        "filename": "master_playlist.mpd",
        "streaming_delivery_format": "dash",
        "type": "playlist",
        "allow_skipped_sources": true,
        "public": true,
        "streams": [
          {
            "path": "CAE1/CAE1.mpd",
            "source": "CAE1"
          },
          {
            "path": "CAE2/CAE2.mpd",
            "source": "CAE2"
          },
          {
            "path": "CAE3/CAE3.mpd",
            "source": "CAE3"
          },
          {
            "path": "CAE4/CAE4.mpd",
            "source": "CAE4"
          },
          {
            "path": "CAE5/CAE5.mpd",
            "source": "CAE5"
          },
          {
            "path": "CAE6/CAE6.mpd",
            "source": "CAE6"
          },
          {
            "path": "Audio/128k/audio_128k.mpd",
            "source": "Audio"
          }
        ]
      }
    ]
   }