すべてのプロダクト
Search
ドキュメントセンター

Intelligent Media Services:字幕と字幕テンプレート

最終更新日:Jul 31, 2025

このトピックでは、タイムライン パラメーターを SubmitMediaProducingJob オペレーションで編集して字幕と字幕テンプレートを処理する方法について説明します。

使用方法

  • インテリジェントプロダクションは、ライブストリーム、VOD ファイル、Object Storage Service (OSS) の素材ファイルの編集と合成、エフェクトレンダリング、テンプレートをサポートしています。 詳細については、「インテリジェントプロダクションの概要」をご参照ください。

  • タイムラインパラメーター を構成し、SubmitMediaProducingJob オペレーションを呼び出すことで、1 つ以上のビデオ、オーディオファイル、画像、字幕素材からビデオを制作できます。

  • タイムラインは、素材を追加し、エフェクトを構成してビデオを作成するときに作成されます。 タイムラインは、トラック、素材、エフェクトで構成されます。 詳細については、「タイムラインの構成」をご参照ください。

  • IMS SDK を使用してオーディオファイルとビデオファイルを編集する方法の詳細については、「準備」をご参照ください。

ビデオに字幕を追加する

説明
  1. 字幕は、別のトラック (SubtitleTracks) を作成するか、エフェクトで設定することでビデオに追加できます。

  2. TimelineIn パラメーターと TimelineOut パラメーターを使用して、字幕の開始時刻と終了時刻を定義できます。 これら 2 つのパラメーターを指定しない場合、字幕トラックの字幕はビデオ全体の長さに合わせて生成されます。 デフォルトでは、エフェクトで追加された字幕は、エフェクトが属するビデオクリップの長さに合わせて生成されます。

  3. \N または \n を使用して、複数行で字幕を表示できます。

エフェクト

タイムラインの例

{
	"VideoTracks": [{
		"VideoTrackClips": [{
			"MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
			"Effects": [{
				"Type": "Background",
				"SubType": "Blur",
				"Radius": 0.1
			}]
		}]
	}],
	"SubtitleTracks": [{
		"SubtitleTrackClips": [{
			"Type": "Text",
			"X": 0,
			"Y": 200,
			"Content": "見出し", // 見出し
			"Alignment": "TopCenter",
			"FontSize": 80,
			"FontColorOpacity": 1,
			"EffectColorStyle": "CS0003-000011",
			"FontFace": {
				"Bold": true
			}
		}, {
			"Type": "Text",
			"X": 0,
			"Y": 320,
			"Font": "KaiTi",
			"Content": "小見出し", // 小見出し
			"Alignment": "TopCenter",
			"FontSize": 45,
			"FontColor": "#ffffff",
			"FontFace": {
				"Italic": true,
				"Underline": true
			}
		}, {
			"Type": "Text",
			"X": 50,
			"Y": 740,
			"Font": "AlibabaPuHuiTi",
			"Content": "回転", // 回転
			"FontColor": "#FFD700",
			"Outline": 4,
			"Angle": 350,
			"OutlineColour": "#000000",
			"FontSize": 60,
			"FontFace": {
				"Bold": true
			}
		}, {
			"Type": "Text",
			"X": 0,
			"Y": 900,
			"Font": "AlibabaPuHuiTi",
			"Content": "字幕\n複数行で字幕を表示するために改行を追加できます。", // 字幕、複数行で字幕を表示するために改行を追加できます。
			"Outline": 1,
			"OutlineColour": "000000",
			"Alignment": "TopCenter",
			"FontSize": 40,
			"FontColor": "#ffffff",
			"FontFace": {
				"Bold": true,
				"Italic": false,
				"Underline": false
			}
		}, {
			"Type": "Text",
			"X": 0,
			"Y": 1000,
			"Font": "KaiTi",
			"Content": "字幕の開始時刻と終了時刻", // 字幕の開始時刻と終了時刻
			"Alignment": "TopCenter",
			"FontSize": 40,
			"FontColor": "#ffffff",
			"TimelineIn": 5,
			"TimelineOut": 25,
			"FontFace": {
				"Bold": false,
				"Italic": true,
				"Underline": false
			}
		}]
	}]
}

フォントサイズ、システムフォント、カスタムフォント、ストローク、シャドウ、字幕の回転角度を構成する

説明
  1. FontSize は字幕のフォントサイズを示します。 エフェクトで字幕を追加する場合は、FixedFontSize を使用してフォントサイズを設定することをお勧めします。これにより、字幕がビデオサイズに合わせて変化しなくなります。

  2. Font はシステムフォントを指定し、FontURL はカスタムフォントを格納する OSS オブジェクトへのパスを指定します。 両方のパラメーターが設定されている場合、システムは優先的に FontURL を使用して字幕をレンダリングします。

  3. Outline、OutlineColour、Shadow、BackColour などのパラメーターを使用して、シンプルな単層ストロークとシャドウエフェクトを生成できます。 複雑な多層ストロークエフェクトを実装するには、例 3 のカスタムワードアートの構成例を参照してください。

  4. Angle を使用して、字幕の回転角度を反時計回りに調整できます。

エフェクト

タイムラインの例

{
  "VideoTracks": [
    {
      "VideoTrackClips": [
        {
          "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
          "Effects": [
            {
              "Type": "Background",
              "SubType": "Blur",
              "Radius": 0.1
            }
          ]
        }
      ]
    }
  ],
  "SubtitleTracks": [
    {
      "SubtitleTrackClips": [
        {
          "Type": "Text",
          "X": 0,
          "Y": 200,
          "Content": "フォントサイズ 80 の見出し", // フォントサイズ 80 の見出し
          "Alignment": "TopCenter",
          "FontSize": 80,
          "FontColorOpacity": 1,
          "EffectColorStyle": "CS0003-000023",
          "FontFace": {
            "Bold": true
          }
        },
        {
          "Type": "Text",
          "X": 0,
          "Y": 320,
          "Font": "KaiTi",
          "Content": "イタリック体の小見出し", // イタリック体の小見出し
          "Alignment": "TopCenter",
          "FontSize": 45,
          "FontColor": "#ffffff",
          "FontFace": {
            "Italic": true,
            "Underline": true
          }
        },
        {
          "Type": "Text",
          "X": 50,
          "Y": 740,
          "Font": "AlibabaPuHuiTi",
          "Content": "回転", // 回転
          "FontColor": "#FFD700",
          "Outline": 4,
          "Angle": 350,
          "OutlineColour": "#000000",
          "FontSize": 60,
          "FontFace": {
            "Bold": true
          }
        },
        {
          "Type": "Text",
          "X": 0,
          "Y": 900,
          "Content": "カスタムフォントのバナー字幕 \n幅 1 の黒いストロークを追加", // カスタムフォントのバナー字幕、幅 1 の黒いストロークを追加
          "FontUrl": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/font/fangzhengfangsong.ttf",
          "Outline": 1,
          "OutlineColour": "000000",
          "Alignment": "TopCenter",
          "FontSize": 40,
          "FontColor": "#ffffff",
          "FontFace": {
            "Bold": true,
            "Italic": false,
            "Underline": false
          }
        },
        {
          "Type": "Text",
          "X": 20,
          "Y": 20,
          "Font": "KaiTi",
          "Content": "シャドウ \n エフェクトを \n 追加", // シャドウ エフェクトを 追加
          "Alignment": "BottomRight",
          "FontSize": 40,
          "FontColor": "#ffffff",
          "Shadow": 3,
          "BackColour": "#000000",
          "FontFace": {
            "Bold": false,
            "Italic": true,
            "Underline": false
          }
        }
      ]
    }
  ]
}

ワードアートを構成する

説明
  1. EffectColorStyleId フィールドを使用して、ワードアートエフェクトを簡単に構成できます。 エフェクトの詳細については、「ワードアートエフェクト」をご参照ください。

  2. 字幕の外観をカスタマイズするには、SubtitleEffects フィールドを使用して、複数層のストロークとシャドウエフェクトを構成できます。 詳細については、「SubtitleEffect」をご参照ください。

エフェクト

タイムラインの例

{
  "VideoTracks": [
    {
      "VideoTrackClips": [
        {
          "MediaUrl": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
          "In": 0,
          "Out": 8
        }
      ]
    }
  ],
  "SubtitleTracks": [
    {
      "SubtitleTrackClips": [
        {
          "TimelineIn": 0,
          "TimelineOut": 2,
          "Type": "Text",
          "Y": 0.2,
          "Font": "WenQuanYi Zen Hei Mono",
          "Content": "スマート編集", // スマート編集
          "Alignment": "TopCenter",
          "FontSize": 200,
          "FontColor": "#FFFFFF",
          "SubtitleEffects": [
            {
              "Color": "#0420B6",
              "Type": "Shadow",
              "XBord": 0.07,
              "YBord": 0.07,
              "YShift": 0.06
            },
            {
              "Color": "#F2213F",
              "Type": "Shadow",
              "XBord": 0.07,
              "YBord": 0.07,
              "YShift": 0.03
            },
            {
              "Color": "#000000",
              "Type": "Shadow",
              "XShift": 0.01,
              "YShift": 0.01
            },
            {
              "Color": "#000000",
              "Type": "Outline",
              "XBord": 0.01,
              "YBord": 0.01
            }
          ]
        },
        {
          "TimelineIn": 0,
          "TimelineOut": 2,
          "Type": "Text",
          "Y": 0.6,
          "Content": "高度なワードアート", // 高度なワードアート
          "Alignment": "TopCenter",
          "FontSize": 150,
          "EffectColorStyle": "CS0001-000011"
        },
        {
          "TimelineIn": 2,
          "TimelineOut": 5,
          "Type": "Text",
          "X": 0.1,
          "Y": 0.1,
          "Content": "システム ワードアート", // システム ワードアート
          "FontSize": 150,
          "EffectColorStyle": "CS0001-000004"
        },
        {
          "TimelineIn": 2,
          "TimelineOut": 5,
          "Type": "Text",
          "X": 0.1,
          "Y": 0.3,
          "Content": "システム ワードアート", // システム ワードアート
          "FontSize": 150,
          "EffectColorStyle": "CS0001-000005"
        },
        {
          "TimelineIn": 2,
          "TimelineOut": 5,
          "Type": "Text",
          "X": 0.1,
          "Y": 0.5,
          "Content": "システム ワードアート", // システム ワードアート
          "FontSize": 150,
          "EffectColorStyle": "CS0001-000014"
        },
        {
          "TimelineIn": 2,
          "TimelineOut": 5,
          "Type": "Text",
          "X": 0.1,
          "Y": 0.7,
          "Content": "システム ワードアート", // システム ワードアート
          "FontSize": 150,
          "EffectColorStyle": "CS0001-000007"
        },
        {
          "TimelineIn": 2,
          "TimelineOut": 5,
          "Type": "Text",
          "X": 0.6,
          "Y": 0.1,
          "Content": "システム ワードアート", // システム ワードアート
          "FontSize": 150,
          "EffectColorStyle": "CS0002-000002"
        },
        {
          "TimelineIn": 2,
          "TimelineOut": 5,
          "Type": "Text",
          "X": 0.6,
          "Y": 0.3,
          "Content": "システム ワードアート", // システム ワードアート
          "FontSize": 150,
          "EffectColorStyle": "CS0002-000004"
        },
        {
          "TimelineIn": 2,
          "TimelineOut": 5,
          "Type": "Text",
          "X": 0.6,
          "Y": 0.5,
          "Content": "システム ワードアート", // システム ワードアート
          "FontSize": 150,
          "EffectColorStyle": "CS0002-000009"
        },
        {
          "TimelineIn": 2,
          "TimelineOut": 5,
          "Type": "Text",
          "X": 0.6,
          "Y": 0.7,
          "Content": "システム ワードアート", // システム ワードアート
          "FontSize": 150,
          "EffectColorStyle": "CS0002-000016"
        },
        {
          "Comment": "左側にシャドウエフェクトを追加する", // 左側にシャドウエフェクトを追加する
          "TimelineIn": 5,
          "TimelineOut": 8,
          "Type": "Text",
          "FontSize": 150,
          "Content": "カスタム ワードアート", // カスタム ワードアート
          "Y": 0.1,
          "Alignment": "TopCenter",
          "Font": "HappyZcool-2016",
          "FontColor": "#F688AA",
          "SubtitleEffects": [
            {
              "Color": "#F5D2CC",
              "Type": "Shadow",
              "XBord": 0,
              "YBord": 0,
              "XShift": -0.04,
              "Opacity": 1
            }
          ]
        },
        {
          "Comment": "右側にシャドウエフェクトを追加する", // 右側にシャドウエフェクトを追加する
          "TimelineIn": 5,
          "TimelineOut": 8,
          "Type": "Text",
          "FontSize": 150,
          "Content": "カスタム ワードアート", // カスタム ワードアート
          "Y": 0.3,
          "Alignment": "TopCenter",
          "Font": "HappyZcool-2016",
          "FontColor": "#F688AA",
          "SubtitleEffects": [
            {
              "Color": "#A33952",
              "Type": "Shadow",
              "XBord": 0,
              "YBord": 0,
              "XShift": 0.04,
              "Opacity": 1
            },
            {
              "Color": "#F5D2CC",
              "Type": "Shadow",
              "XBord": 0,
              "YBord": 0,
              "XShift": -0.04,
              "Opacity": 1
            }
          ]
        },
        {
          "Comment": "グローエフェクトの最初のレイヤーを追加する", // グローエフェクトの最初のレイヤーを追加する
          "TimelineIn": 5,
          "TimelineOut": 8,
          "Type": "Text",
          "FontSize": 150,
          "Content": "カスタム ワードアート", // カスタム ワードアート
          "Y": 0.5,
          "Alignment": "TopCenter",
          "Font": "HappyZcool-2016",
          "FontColor": "#F688AA",
          "SubtitleEffects": [
            {
              "Color": "#FFFFA0",
              "Type": "Shadow",
              "Blur": 0.08,
              "XBord": 0.08,
              "YBord": 0.08
            },
            {
              "Color": "#A33952",
              "Type": "Shadow",
              "XBord": 0,
              "YBord": 0,
              "XShift": 0.04,
              "Opacity": 1
            },
            {
              "Color": "#F5D2CC",
              "Type": "Shadow",
              "XBord": 0,
              "YBord": 0,
              "XShift": -0.04,
              "Opacity": 1
            }
          ]
        },
        {
          "Comment": "グローエフェクトの 2 番目のレイヤーを追加する", // グローエフェクトの 2 番目のレイヤーを追加する
          "TimelineIn": 5,
          "TimelineOut": 8,
          "Type": "Text",
          "FontSize": 150,
          "Content": "カスタム ワードアート", // カスタム ワードアート
          "Y": 0.7,
          "Alignment": "TopCenter",
          "Font": "HappyZcool-2016",
          "FontColor": "#F688AA",
          "SubtitleEffects": [
            {
              "Color": "#F688AA",
              "Type": "Shadow",
              "Blur": 0.3,
              "XBord": 0.15,
              "YBord": 0.15
            },
            {
              "Color": "#FFFFA0",
              "Type": "Shadow",
              "Blur": 0.08,
              "XBord": 0.08,
              "YBord": 0.08
            },
            {
              "Color": "#A33952",
              "Type": "Shadow",
              "XBord": 0,
              "YBord": 0,
              "XShift": 0.04,
              "Opacity": 1
            },
            {
              "Color": "#F5D2CC",
              "Type": "Shadow",
              "XBord": 0,
              "YBord": 0,
              "XShift": -0.04,
              "Opacity": 1
            }
          ]
        }
      ]
    }
  ]
}

字幕の一部にエフェクトを構成する

説明

上書きコードを Content フィールドに追加して、字幕の一部にエフェクトを構成できます。 上書きコードを追加する際は、以下の点に注意してください。

  • すべての書き込みコードは、2 つのバックスラッシュ (\\) で始める必要があります。

  • すべての書き込みコードは、中括弧 ({ }) で囲む必要があります。 1 組の中括弧に複数行のコードを含めることができます。

  • 上書きコードは字幕に適用されます。 元の構成に戻すには、対応するコードを追加して上書きをキャンセルします。

次の表に、上書きコードのパラメーターを示します。

パラメーター

説明

Content の例

  • \\1c&[BBGGRR]&

  • \\3c&[BBGGRR]&

  • \\4c&[BBGGRR]&

  • 1c、3c、4c は、フォント、境界線、シャドウの色です。

  • [BBGGRR] は 16 進数の BGR 値を指定します。 BGR は RGB カラーオーダーの逆です。

"{\\1c&00FF7F&}緑色{\\1c} のテキスト"

  • \\bord [幅]

  • \\xbord [幅]

  • \\ybord [幅]

注: このチュートリアルでは、基本的な JavaScript の知識があることを前提としています。

このガイドが WordPress の管理画面を使いこなすためのお役に立てれば幸いです。

\\b1 \\b0

b1 は太字を示し、b0 は太字ではないことを示します。

"{\\b1}太字{\\b0}テキスト"

\\i1 \\i0

i1 はイタリック体を示し、i0 はイタリック体でないことを示します。

"{\\i1}Italicize{\\i0} text"

\\u1 \\u0

u1 は下線を、u0 は下線なしを示します。

"{\\u1}下線{\\u0} テキスト"

\\s1 \\s0

s1 は取り消し線を表し、s0 は取り消し線なしを表します。

"{\\s1}Strikethrough{\\s0} text"

\\fs[フォントサイズ]

字幕のフォントサイズです。単位:ピクセル。

"Size {\\fs100}100{\\fs} text"

\\fn[フォント]

字幕のフォントです。カスタムフォントは指定できません。

"{\\fnKaiTi}Heiti{\\fn} テキスト"

効果

タイムライン例

{
  "VideoTracks": [
    {
      "VideoTrackClips": [
        {
          "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4"
        }
      ]
    }
  ],
  "SubtitleTracks": [
    {
      "SubtitleTrackClips": [
        {
          "Type": "Text",
          "X": 0,
          "Y": 150,
          "Font": "FZKai-Z03S",
          "Content": "{\\1c&0801ea&\\3c&f7fcff&}Crimson{\\1c\\3c} text", 
          "Alignment": "TopCenter",
          "FontSize": 65,
          "FontColor": "#F5FFFA",
          "TimelineIn": 0,
          "TimelineOut": 10,
          "Outline": 2,
          "OutlineColour": "#0e0100"
        },
        {
          "Type": "Text",
          "X": 0,
          "Y": 300,
          "Font": "FZKai-Z03S",
          "Content": "Font size {\\fs}100{\\fs100}",
          "Alignment": "TopCenter",
          "FontColor": "#F5FFFA",
          "FontSize": 65,
          "TimelineIn": 0,
          "TimelineOut": 10,
          "Outline": 2,
          "OutlineColour": "#0e0100"
        },
        {
          "Type": "Text",
          "Y": 450,
          "Font": "FZKai-Z03S",
          "Content": "Text {\\bord3\\3c&CD0000&}stroke{\\bord\\3c}",
          "Alignment": "TopCenter",
          "FontSize": 65,
          "FontColor": "#F5FFFA",
          "TimelineIn": 0,
          "TimelineOut": 10,
          "Outline": 2,
          "OutlineColour": "#0e0100"
        },
        {
          "Type": "Text",
          "Y": 600,
          "Content": "Text {\\bord3\\3c&701919&}background{\\bord\\3c}",
          "Comment": "不透明な背景の場合は、BorderStyle を 3 に設定します", // For opaque background, set BoderStyle to 3
          "Font": "FZKai-Z03S",
          "FontSize": 65,
          "TimelineIn": 0,
          "TimelineOut": 10,
          "Alignment": "TopCenter",
          "FontColor": "#F5FFFA",
          "BorderStyle": 3,
          "Outline": 0,
          "OutlineColour": "#0000CD"
        },
        {
          "Type": "Text",
          "Y": 750,
          "Font": "FZKai-Z03S",
          "Content": "{\\fnKaiTi}KaiTi{\\fn} font",
          "FontSize": 65,
          "TimelineIn": 0,
          "TimelineOut": 10,
          "FontColor": "#F5FFFA",
          "Alignment": "TopCenter",
          "Outline": 2,
          "OutlineColour": "#0e0100"
        },
        {
          "Type": "Text",
          "Y": 900,
          "Font": "FZKai-Z03S",
          "Content": "{\\b1}Bold {\\b0} text",
          "FontSize": 65,
          "TimelineIn": 0,
          "TimelineOut": 10,
          "FontColor": "#F5FFFA",
          "Alignment": "TopCenter",
          "Outline": 2,
          "OutlineColour": "#0e0100"
        },
        {
          "Type": "Text",
          "Y": 1050,
          "Font": "FZKai-Z03S",
          "Content": "{\\i1}Italicize{\\i0} text",
          "FontSize": 65,
          "TimelineIn": 0,
          "TimelineOut": 10,
          "FontColor": "#F5FFFA",
          "Alignment": "TopCenter",
          "Outline": 2,
          "OutlineColour": "#0e0100"
        },
        {
          "Type": "Text",
          "Y": 1200,
          "Font": "FZKai-Z03S",
          "Content": "{\\u1}Underline{\\u0} text",
          "FontColor": "#F5FFFA",
          "FontSize": 65,
          "TimelineIn": 0,
          "TimelineOut": 10,
          "Alignment": "TopCenter",
          "Outline": 2,
          "OutlineColour": "#0e0100"
        },
        {
          "Type": "Text",
          "Y": 1350,
          "Font": "FZKai-Z03S",
          "Content": "{\\s1}Strikethrough{\\s0} text",
          "FontColor": "#F5FFFA",
          "FontSize": 65,
          "TimelineIn": 0,
          "TimelineOut": 10,
          "Alignment": "TopCenter",
          "Outline": 2,
          "OutlineColour": "#0e0100"
        },
        {
          "Type": "Text",
          "Y": 1500,
          "Font": "FZKai-Z03S",
          "Content": "Effect {\\1c&00FF00&\\b1\\fs100\\i1}combination{\\1c\\b0\\fs\\i0}",
          "FontColor": "#F5FFFA",
          "FontSize": 65,
          "TimelineIn": 0,
          "TimelineOut": 10,
          "Alignment": "TopCenter",
          "Outline": 2,
          "OutlineColour": "#0e0100"
        }
      ]
    }
  ]
}

自動改行の設定

説明
  1. 字幕が完全に表示されるようにするには、字幕がウィンドウの範囲を超えた場合に自動改行を有効にするために、AdaptMode を AutoWrap に設定できます。さらに、TextWidth を絶対ピクセル数または再生ウィンドウのパーセンテージで指定して、定義された幅範囲内で改行を制御できます。

  2. 「AdaptMode」: 「AutoWrapAtSpaces」の設定により、英語の単語の途中で改行が発生しないようにすることができます。

効果

タイムライン例

{
  "VideoTracks": [
    {
      "VideoTrackClips": [
        {
          "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4" // メディア URL
        }
      ]
    }
  ],
  "SubtitleTracks": [
    {
      "SubtitleTrackClips": [
        {
          "Type": "Text", // タイプ
          "X": 0, // X 座標
          "Y": 200, // Y 座標
          "Font": "FZKai-Z03S", // フォント
          "Content": "If you do not set auto line wrapping, the subtitle will exceed the playback window if the text is too long.", // 字幕の内容。テキストが長すぎる場合、自動改行を設定しないと、字幕が再生ウィンドウを超えてしまいます。
          "Alignment": "TopCenter", // 配置
          "FontSize": 70, // フォントサイズ
          "FontColor": "#F5FFFA", // フォントの色
          "Outline": 2, // アウトライン
          "OutlineColour": "#0e0100" // アウトラインの色
        },
        {
          "Type": "Text", // タイプ
          "X": 0, // X 座標
          "Y": 600, // Y 座標
          "Font": "FZKai-Z03S", // フォント
          "Content": "Auto line wrapping is triggered when the text exceeds the playback window.", // 字幕の内容。テキストが再生ウィンドウを超えると、自動改行がトリガーされます。
          "AdaptMode": "AutoWrap", // AdaptMode。自動改行。
          "Alignment": "TopCenter", // 配置
          "FontSize": 70, // フォントサイズ
          "FontColor": "#F5FFFA", // フォントの色
          "Outline": 2, // アウトライン
          "OutlineColour": "#0e0100" // アウトラインの色
        },
        {
          "Type": "Text", // タイプ
          "X": 0, // X 座標
          "Y": 1000, // Y 座標
          "Font": "FZKai-Z03S", // フォント
          "Content": "Set TextWidth to enable auto line wrapping within a given width range.", // 字幕の内容。指定された幅範囲内で自動改行を有効にするには、TextWidth を設定します。
          "TextWidth": 0.7, // TextWidth
          "AdaptMode": "AutoWrap", // AdaptMode。自動改行。
          "Alignment": "TopCenter", // 配置
          "FontSize": 70, // フォントサイズ
          "FontColor": "#F5FFFA", // フォントの色
          "Outline": 2, // アウトライン
          "OutlineColour": "#0e0100" // アウトラインの色
        },
        {
          "Type": "Text", // タイプ
          "X": 0, // X 座標
          "Y": 1400, // Y 座標
          "Content": "Subtitles only automatically wrap at spaces.", // 字幕の内容。字幕はスペースでのみ自動的に改行されます。
          "AdaptMode": "AutoWrapAtSpaces", // AdaptMode。スペースで自動改行。
          "Alignment": "TopCenter", // 配置
          "FontSize": 70, // フォントサイズ
          "FontColor": "#F5FFFA", // フォントの色
          "Outline": 2, // アウトライン
          "OutlineColour": "#0e0100" // アウトラインの色
        }
      ]
    }
  ]
}

字幕の配置を設定する

  • 字幕の位置は、配置モードによって異なります。次の表に、配置モードとデフォルトの位置を示します。

    配置

    配置モード

    デフォルトの位置

    TopLeft

    左揃え

    左上隅。

    TopCenter

    中央揃え

    上部中央。

    TopRight

    右揃え

    右上隅。

    CenterLeft

    左揃え

    水平方向は中央揃えですが、テキストは左揃えです。

    CenterCenter

    中央揃え

    水平方向と垂直方向の中央揃え。

    CenterRight

    右揃え

    水平方向は中央揃えですが、テキストは右揃えです。

    BottomLeft

    左揃え

    左下隅。

    BottomCenter

    中央揃え

    下部中央。

    BottomRight

    右揃え

    右下隅。

  • 次の表に、字幕を正確に配置できる3つの配置モード(左、中央、右)を示します。

    配置

    配置モード

    配置基準点

    Left

    左揃え

    字幕テキストボックスの左上頂点。

    Center

    中央揃え

    字幕テキストボックスの上枠線の中点。

    Right

    右揃え

    字幕テキストボックスの右上頂点。

  • 次の図は、さまざまな配置モードのさまざまな配置基準点を示しています。

    image

効果

タイムラインの例

{
    "VideoTracks": [
        {
            "VideoTrackClips": [
                {
                    "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4"
                }
            ]
        }
    ],
    "SubtitleTracks": [
        {
            "SubtitleTrackClips": [
                {
                    "Type": "Text",
                    "Font": "FZKai-Z03S",
                    "Content": "Alignment\nTopLeft",
                    "Alignment": "TopLeft",
                    "FontSize": 70,
                    "FontColor": "#F5FFFA",
                    "Outline": 2,
                    "OutlineColour": "#0e0100",
                    "TimelineIn": 0,
                    "TimelineOut": 4
                },
                // ... その他の字幕設定
            ]
        }
    ]
}

字幕効果の設定

説明
  1. 字幕の開始効果と終了効果を表示する時間を指定し、ループ効果の速度を指定できます。

  2. 開始/終了効果とループ効果は同時に使用できません。

効果

タイムライン例

{
  "VideoTracks": [ // ビデオトラック
    {
      "VideoTrackClips": [ // ビデオトラッククリップ
        {
          "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4" // メディアURL
        }
      ]
    }
  ],
  "SubtitleTracks": [ // 字幕トラック
    {
      "SubtitleTrackClips": [ // 字幕トラッククリップ
        {
          "Type": "Text", // タイプ
          "X": 0, // X座標
          "Y": 200, // Y座標
          "Font": "HappyZcool-2016", // フォント
          "Content": "Entrance effect for 2 seconds", // 内容(開始効果 2秒)
          "Alignment": "TopCenter", // 配置
          "FontSize": 70, // フォントサイズ
          "FontColor": "#F5FFFA", // フォントの色
          "Outline": 2, // アウトライン
          "OutlineColour": "#0e0100", // アウトラインの色
          "AaiMotionInEffect": "rotateflip_in", // 開始効果
          "AaiMotionIn": 2 // 開始効果の時間(秒)
        },
        {
          "Type": "Text", // タイプ
          "X": 0, // X座標
          "Y": 600, // Y座標
          "Font": "HappyZcool-2016", // フォント
          "Content": "Exit effect for 2 seconds", // 内容(終了効果 2秒)
          "AdaptMode": "AutoWrap", // 適応モード
          "Alignment": "TopCenter", // 配置
          "FontSize": 70, // フォントサイズ
          "FontColor": "#F5FFFA", // フォントの色
          "Outline": 2, // アウトライン
          "OutlineColour": "#0e0100", // アウトラインの色
          "AaiMotionOutEffect": "slide_down_out", // 終了効果
          "AaiMotionOut": 2 // 終了効果の時間(秒)
        },
        {
          "Type": "Text", // タイプ
          "X": 0, // X座標
          "Y": 1000, // Y座標
          "Font": "HappyZcool-2016", // フォント
          "Content": "Loop effect at a 2x speed", // 内容(ループ効果 2倍速)
          "TextWidth": 0.7, // テキスト幅
          "AdaptMode": "AutoWrap", // 適応モード
          "Alignment": "TopCenter", // 配置
          "FontSize": 70, // フォントサイズ
          "FontColor": "#F5FFFA", // フォントの色
          "Outline": 2, // アウトライン
          "OutlineColour": "#0e0100", // アウトラインの色
          "AaiMotionLoopEffect": "rainbrush_display", // ループ効果
          "Ratio": 2 // 倍率
        },
        {
          "Type": "Text", // タイプ
          "X": 0, // X座標
          "Y": 1400, // Y座標
          "Font": "HappyZcool-2016", // フォント
          "Content": "Entrance and exit effects", // 内容(開始と終了効果)
          "AdaptMode": "AutoWrapAtSpaces", // 適応モード
          "Alignment": "TopCenter", // 配置
          "FontSize": 70, // フォントサイズ
          "FontColor": "#F5FFFA", // フォントの色
          "Outline": 2, // アウトライン
          "OutlineColour": "#0e0100", // アウトラインの色
          "AaiMotionInEffect": "zoomin_i", // 開始効果
          "AaiMotionIn": 2, // 開始効果の時間(秒)
          "AaiMotionOutEffect": "dissolve_out", // 終了効果
          "AaiMotionOut": 2 // 終了効果の時間(秒)
        }
      ]
    }
  ]
}

字幕の背景を設定する

説明

字幕効果のボックスフィールドを使用して、字幕に単色の背景を追加できます。ワードアート、折り返し、その他のスタイルも設定できます。

効果

タイムラインの例

{
    "VideoTracks": [
      {
        "VideoTrackClips": [
          {
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4"
          }
        ]
      }
    ],
    "SubtitleTracks": [ // 字幕トラック
      {
        "SubtitleTrackClips": [ // 字幕トラッククリップ
          {
            "Type": "Text", // タイプ
            "X": 0, // X 座標
            "Y": 150, // Y 座標
            "Font": "HappyZcool-2016", // フォント
            "Content": "Set the width and height offsets and radius of the solid color background.", // 内容:単色背景の幅と高さのオフセットと半径を設定します。
            "AdaptMode": "AutoWrap", // 適応モード:自動折り返し
            "Alignment": "TopCenter", // 配置:中央上
            "FontSize": 70, // フォントサイズ
            "FontColor": "#F5FFFA", // フォントの色
            "SubtitleEffects": [ // 字幕効果
              {
                "Type": "Box", // タイプ:ボックス
                "Color": "1E90FF", // 色
                "XShift": 20, // X オフセット
                "YShift": -20, // Y オフセット
                "Bord": 20, // ボーダー
                "Radius": 20 // 半径
              }
            ]
          }
        ]
      },
      {
        "SubtitleTrackClips": [ // 字幕トラッククリップ
          {
            "Type": "Text", // タイプ
            "X": 0, // X 座標
            "Y": 500, // Y 座標
            "Font": "HappyZcool-2016", // フォント
            "Content": "Configure the opacity of the subtitle background.", // 内容:字幕背景の不透明度を設定します。
            "AdaptMode": "AutoWrap", // 適応モード:自動折り返し
            "Alignment": "TopCenter", // 配置:中央上
            "FontSize": 70, // フォントサイズ
            "FontColor": "#F5FFFA", // フォントの色
            "SubtitleEffects": [ // 字幕効果
              {
                "Type": "Box", // タイプ:ボックス
                "Color": "1E90FF", // 色
                "Opacity": "0.5", // 不透明度
                "Bord": 20 // ボーダー
              }
            ]
          }
        ]
      },
      {
        "SubtitleTrackClips": [ // 字幕トラッククリップ
          {
            "Type": "Text", // タイプ
            "X": 0, // X 座標
            "Y": 850, // Y 座標
            "Font": "HappyZcool-2016", // フォント
            "Content": "Configure the solid color background when the subtitle needs line wrapping.", // 内容:字幕が折り返しが必要な場合に、単色背景を設定します。
            "AdaptMode": "AutoWrap", // 適応モード:自動折り返し
            "TextWidth": 0.6, // テキスト幅
            "Alignment": "TopCenter", // 配置:中央上
            "FontSize": 70, // フォントサイズ
            "FontColor": "#F5FFFA", // フォントの色
            "SubtitleEffects": [ // 字幕効果
              {
                "Type": "Box", // タイプ:ボックス
                "Color": "1E90FF", // 色
                "Bord": 20 // ボーダー
              }
            ]
          }
        ]
      },
      {
        "SubtitleTrackClips": [ // 字幕トラッククリップ
          {
            "Type": "Text", // タイプ
            "X": 0, // X 座標
            "Y": 1200, // Y 座標
            "Font": "HappyZcool-2016", // フォント
            "Content": "Configure a solid color background, display effect, and word art for the subtitle.", // 内容:字幕の単色背景、表示効果、ワードアートを設定します。
            "AdaptMode": "AutoWrapAtSpaces", // 適応モード:スペースで自動折り返し
            "Alignment": "TopCenter", // 配置:中央上
            "FontSize": 70, // フォントサイズ
            "EffectColorStyle": "CS0003-000006", // 効果の色スタイル
            "AaiMotionInEffect": "zoomin_i", // AAI モーションイン効果
            "AaiMotionIn": 2, // AAI モーションイン
            "AaiMotionOutEffect": "dissolve_out", // AAI モーションアウト効果
            "AaiMotionOut": 2, // AAI モーションアウト
            "SubtitleEffects": [ // 字幕効果
              {
                "Type": "Box", // タイプ:ボックス
                "Color": "1E90FF", // 色
                "Bord": 20 // ボーダー
              }
            ]
          }
        ]
      },
      {
        "SubtitleTrackClips": [ // 字幕トラッククリップ
          {
            "Type": "Text", // タイプ
            "X": 0, // X 座標
            "Y": 1550, // Y 座標
            "Font": "HappyZcool-2016", // フォント
            "Content": "Set an image as the background texture and the text box radius.", // 内容:画像を背景テクスチャとして設定し、テキストボックスの半径を設定します。
            "AdaptMode": "AutoWrapAtSpaces", // 適応モード:スペースで自動折り返し
            "Alignment": "TopCenter", // 配置:中央上
            "FontSize": 70, // フォントサイズ
            "EffectColorStyle": "CS0003-000006", // 効果の色スタイル
            "AaiMotionInEffect": "zoomin_i", // AAI モーションイン効果
            "AaiMotionIn": 2, // AAI モーションイン
            "AaiMotionOutEffect": "dissolve_out", // AAI モーションアウト効果
            "AaiMotionOut": 2, // AAI モーションアウト
            "SubtitleEffects": [ // 字幕効果
              {
                "Type": "Box", // タイプ:ボックス
                "Color": "1E90FF", // 色
                "Bord": 20, // ボーダー
                "Radius": 20, // 半径
                "ImageURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/image/subtitle_background.png" // 画像 URL
              }
            ]
          }
        ]
      }
    ]
  }

吹き出しテキストを設定する

説明
  1. BubbleStyleId を使用して、吹き出しスタイルの ID を指定できます。 吹き出しスタイルの詳細については、「吹き出しテキスト」をご参照ください。

  2. BubbleWidth と BubbleHeight を設定して、吹き出しテキストの幅と高さを調整できます。 X と Y は、それぞれビデオの左上隅を基準とした吹き出しテキストの左上隅の座標を示します。

  3. SubtitleEffects の Box スタイルを使用すると、画像を追加してカスタムの吹き出し効果を実現できます。 このスタイルでは、Width と Height を指定して吹き出しの元の画像の幅と高さを示し、TextArea を指定して吹き出しに対するテキストボックスの位置とサイズを定義する必要があります。 TextArea の 4 つのフィールドは、吹き出しに対する吹き出しテキストボックスの左上隅の座標、および吹き出しに対するテキストボックスの幅と高さを示します。

  4. 吹き出しテキスト機能を使用すると、テキストは吹き出し内で自動的に折り返され、拡大縮小されます。

効果

タイムライン例

{
  "VideoTracks": [
    {
      "VideoTrackClips": [
        {
          "MediaUrl": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4"
        }
      ]
    }
  ],
  "SubtitleTracks": [
    {
      "SubtitleTrackClips": [
        {
          "TimelineIn": 0,
          "TimelineOut": 4,
          "Type": "Text",
          "X": 0.1,
          "Y": 0,
          "FontSize": 150,
          "BubbleHeight": 0.18,
          "Alignment": "TopCenter",
          "BubbleStyleId": "BS0001-000001"
        },
        {
          "TimelineIn": 0,
          "TimelineOut": 4,
          "Type": "Text",
          "X": 0.1,
          "Y": 0.2,
          "FontSize": 150,
          "BubbleHeight": 0.18,
          "Alignment": "TopCenter",
          "BubbleStyleId": "BS0001-000002"
        },
        {
          "TimelineIn": 0,
          "TimelineOut": 4,
          "Type": "Text",
          "X": 0.1,
          "Y": 0.4,
          "FontSize": 150,
          "BubbleHeight": 0.18,
          "Alignment": "TopCenter",
          "BubbleStyleId": "BS0001-000003"
        },
        {
          "TimelineIn": 0,
          "TimelineOut": 4,
          "Type": "Text",
          "X": 0.1,
          "Y": 0.6,
          "FontSize": 150,
          "BubbleHeight": 0.18,
          "Alignment": "TopCenter",
          "BubbleStyleId": "BS0001-000004"
        },
        {
          "TimelineIn": 0,
          "TimelineOut": 4,
          "Type": "Text",
          "X": 0.1,
          "Y": 0.8,
          "FontSize": 150,
          "BubbleHeight": 0.18,
          "Alignment": "TopCenter",
          "BubbleStyleId": "BS0001-000005"
        },
        {
          "TimelineIn": 0,
          "TimelineOut": 4,
          "Type": "Text",
          "X": 0.6,
          "Y": 0,
          "FontSize": 150,
          "BubbleHeight": 0.18,
          "Alignment": "TopCenter",
          "BubbleStyleId": "BS0002-000001"
        },
        {
          "TimelineIn": 0,
          "TimelineOut": 4,
          "Type": "Text",
          "X": 0.6,
          "Y": 0.2,
          "FontSize": 150,
          "BubbleHeight": 0.18,
          "Alignment": "TopCenter",
          "BubbleStyleId": "BS0002-000002"
        },
        {
          "TimelineIn": 0,
          "TimelineOut": 4,
          "Type": "Text",
          "X": 0.6,
          "Y": 0.4,
          "FontSize": 150,
          "BubbleHeight": 0.18,
          "Alignment": "TopCenter",
          "BubbleStyleId": "BS0002-000003"
        },
        {
          "TimelineIn": 0,
          "TimelineOut": 4,
          "Type": "Text",
          "X": 0.6,
          "Y": 0.6,
          "FontSize": 150,
          "BubbleHeight": 0.18,
          "Alignment": "TopCenter",
          "BubbleStyleId": "BS0002-000004"
        },
        {
          "TimelineIn": 0,
          "TimelineOut": 4,
          "Type": "Text",
          "X": 0.6,
          "Y": 0.8,
          "FontSize": 150,
          "BubbleHeight": 0.18,
          "Alignment": "TopCenter",
          "BubbleStyleId": "BS0002-000005"
        },
        {
          "TimelineIn": 4,
          "TimelineOut": 8,
          "Type": "Text",
          "Content": "Custom bubble text", // カスタム吹き出しテキスト
          "FontColor": "#000000",
          "X": 0.1,
          "Y": 0.3,
          "BubbleWidth": 0.8,
          "Alignment": "TopCenter",
          "SubtitleEffects": [
            {
              "Type": "Box",
              "Width": 1050,
              "Height": 250,
              "TextArea": "0.1,0.2,0.8,0.6",
              "ImageURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/image/round_rectangle.png"
            }
          ]
        }
      ]
    }
  ]
}

字幕のスクロールを設定する

説明
  • 垂直スクロール: TimelineOut を空のままにすると、システムはスクロールサイクルに基づいて字幕の継続時間を自動的に推定します。字幕スクロールの開始 (ScrollStartY) 位置と終了 (ScrollEndY) 位置、スクロールが開始位置 (ScrollStartFreeze) と終了位置 (ScrollEndFreeze) で一時停止する時間、開始時 (ScrollStartShift) と終了時 (ScrollEndShift) のオフセット、およびスクロール速度 (ScrollSpeed) を指定できます。

  • 水平スクロール: 字幕スクロールの開始 (ScrollStartX) 位置と終了 (ScrollEndX) 位置、スクロール速度 (ScrollSpeed)、およびスクロールをループするかどうか (ScrollLoop) を指定できます。

  • 字幕は他のメディア要素と位置合わせできます。たとえば、垂直スクロールを設定するときに、ClipIdScrollSubtitle に設定できます。背景画像、背景音声、またはバナーテキストをスクロール字幕に合わせるには、ReferenceClipIdScrollSubtitle に設定します。垂直スクロールの開始時間は、ビデオトラックのオープニングの継続時間と一致する必要があります。

効果

タイムラインの例

{
	"VideoTracks": [{
			"VideoTrackClips": [{
					"Type": "Image",
					"MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/image/a1.png",
					"AdaptMode": "Cover",
					"Comment": "オープニング", // Opening
					"Width": 1,
					"Height": 1,
					"Duration": 3
				},
				{
					"Type": "Image",
					"MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/image/back.png",
					"AdaptMode": "Cover",
					"Comment": "背景画像", // Background image
					"Width": 1,
					"Height": 1,
					"ReferenceClipId": "ScrollSubtitle"
				},
				{
					"Type": "Image",
					"MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/image/01.jpg",
					"AdaptMode": "Cover",
					"Comment": "アウトロ", // Outro
					"Width": 1,
					"Height": 1,
					"Duration": 3
				}
			]
		},
		{
			"VideoTrackClips": [{
				"Type": "GlobalImage",
				"MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/aliyun_logo_white.png",
				"Comment": "ロゴ", // logo
				"X": 10,
				"Y": 10,
				"Width": 247,
				"Height": 74
			}]
		}
	],
	"SubtitleTracks": [{
			"SubtitleTrackClips": [{
				"TimelineIn": 3,
				"ClipId": "ScrollSubtitle",
				"Type": "Text",
				"Content": "Alibaba Cloud Intelligent Media Servicesは、クラウドコンピューティング、ビッグデータ、AI技術を統合した包括的なマルチメディア処理ソリューションです。ビデオ・オン・デマンド、ライブストリーミング、コンテンツレビュー、スマート編集などの効率的で便利な機能をユーザーに提供します。企業や開発者がマルチメディア アプリケーションを構築および管理し、ユーザーエクスペリエンスを向上させ、運用コストを削減できるようにすることを目的としています。\n\n主な機能:\n\nビデオ・オン・デマンド:ビデオのアップロード、トランスコード、ストレージから配信まで、ワンストップ サービスを提供します。複数のフォーマット変換をサポートし、視聴者の場所に最適なノードを自動的に選択して、スムーズな再生を保証します。\n\nリアルタイムコミュニケーション:WebRTCテクノロジーを活用して、低遅延、高解像度の音声通話およびビデオ通話または会議サービスを提供し、オンライン教育、遠隔医療、その他のさまざまなシナリオに適しています。\n\nライブストリーミング:ストリーミング、トランスコード、録画から再生までの全プロセスを網羅し、超大規模な同時視聴をサポートし、スポーツ競技やコンサートなどの大規模イベントの需要に対応します。\n\nコンテンツレビュー:AIアルゴリズムを使用して、画像、テキスト、ビデオにおけるポルノや暴力などの違反を自動的に検出し、企業が規制要件に対応できるように支援します。\n\nスマート編集と特殊効果:AIテクノロジーを通じてビデオコンテンツを自動的に分析し、ハイライトリールを生成したり、字幕や背景音楽などの要素を追加して視聴体験を向上させます。\n\nデータ分析:詳細なアクセス統計レポートを提供し、ユーザーが視聴者の行動とプリファレンスを理解してコンテンツ戦略を最適化できるように支援します。\n\n適用可能なシナリオ:\n\nオンライン教育プラットフォーム\n\nソーシャル エンターテインメント プラットフォーム\n\n企業研修システム\n\nEコマース プロダクト ショーケース\n\nニュースメディア コンテンツ公開\n\n利点:\n\n拡張性が高い:ビジネスニーズに応じてリソースを柔軟に調整できます。\n\n安全で信頼性が高い:複数の暗号化対策を実施してデータ セキュリティを保護します。\n\n費用対効果が高い:従量課金モデルを使用して費用を管理します。\n\n統合が容易:他のシステムとの統合が容易な豊富なAPIセットを提供します。\n\n要約すると、Alibaba Cloud Intelligent Media Servicesは、強力な技術力とサービス提供により、複数のセクターで幅広いアプリケーションを実現し、企業のデジタルトランスフォーメーションの加速をサポートしています。", // Alibaba Cloud Intelligent Media Services is a comprehensive multimedia processing solution that integrates cloud computing, big data, and AI technologies. It provides users with efficient and convenient features such as video on demand, live streaming, content review, and smart editing. It aims to help enterprises and developers build and manage multimedia applications, enhance user experience, and reduce operational costs.\n\nKey features:\n\nVideo on demand: Offers a one-stop service from video upload, transcoding, storage, to distribution. It supports multiple format conversions and automatically selects the best node based on the viewer’s location to ensure smooth playback.\n\nReal-time communication: Utilizes WebRTC technology to provide low-latency, high-definition audio and video calling or conferencing services, suitable for online education, telemedicine, and other various scenarios.\n\nLive streaming: Covers the entire process from streaming, transcoding, recording, to playback, with support for ultra-large-scale concurrent viewing, meeting the demands of large events like sports competitions and concerts.\n\nContent review: Employs AI algorithms to automatically detect violations such as pornography and violence in images, text, and videos, helping enterprises respond to regulatory requirements.\n\nSmart editing and special effects: Automatically analyzes video content through AI technology to generate highlight reels or add elements like subtitles and background music to enhance the viewing experience.\n\nData analysis: Provides detailed access statistics reports, helping users understand viewer behavior and preferences to optimize content strategies.\n\nApplicable scenarios:\n\nOnline education platforms\n\nSocial entertainment platforms\n\nCorporate training systems\n\nE-commerce product showcases\n\nNews media content publishing\n\nAdvantages:\n\nHighly scalable: Resources can be flexibly adjusted according to business needs.\n\nSafe and reliable: Implements multiple encryption measures to protect data security.\n\nCost-effective: Uses a pay-as-you-go model to control expenses.\n\nEasy integration: Offers a rich set of APIs for easy integration with other systems.\n\nIn summary, Alibaba Cloud Intelligent Media Services, with its powerful technological capabilities and service offerings, has seen widespread application across multiple sectors, supporting businesses in accelerating their digital transformation.
				"Comment": "垂直スクロール", // Vertical scrolling
				"FontSize": 50,
				"FontColorOpacity": 1,
				"Spacing": 0,
				"LineSpacing": 10,
				"AdaptMode": "AutoWrap",
				"FontColor": "#ffffff",
				"Font": "Alibaba PuHuiTi",
				"X": 0.1,
				"TextWidth": 0.8,
				"ScrollStartY": 1120,
				"ScrollEndY": 200,
				"ScrollSpeed": 75,
				"ScrollLoopTime": 1,
				"ScrollStartShift": 800,
				"ScrollEndShift": 400,
				"ScrollStartFreeze": 2,
				"ScrollEndFreeze": 2
			}]
		},
		{
			"SubtitleTrackClips": [{
				"ReferenceClipId": "ScrollSubtitle",
				"Type": "Text",
				"Content": "Alibaba Cloud Intelligent Media Services",
				"Comment": "水平スクロール", // Horizontal scrolling
				"Font": "Alibaba PuHuiTi",
				"AdaptMode": "AutoWrap",
				"FontSize": 50,
				"TextWidth": 0.8,
				"ScrollDirection": "Left",
				"ScrollStartX": 620,
				"ScrollEndX": 50,
				"ScrollSpeed": 100,
				"ScrollLoop": true,
				"Y": 1200
			}]
		}
	],
	"AudioTracks": [{
		"AudioTrackClips": [{
			"ReferenceClipId": "ScrollSubtitle",
      "Comment": "背景音楽", // Background music
			"MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/music/m2.wav",
			"LoopMode": true,
			"In": 4,
			"Out": 24
		}]
	}]
}

FECanvas を使用して、異なる解像度のビデオで字幕のフォントサイズを統一する

説明

FontSize は、ビデオ内の字幕テキストの高さが占めるピクセル数を指定します。デフォルトでは、同じ FontSize を異なる解像度のビデオに適用すると、結果として得られる比率が一致しないことがよくあります。たとえば、FontSize 100 は 480P ビデオでは大きく見えますが、720P ビデオでは比較的小さく見えます。異なる解像度のビデオで字幕のフォントサイズを統一するには、タイムラインで FECanvas を設定します。

効果

タイムラインの例

{
    "FECanvas": {
        "Height": 1280,
        "Width": 720
      },
    "VideoTracks": [
      {
        "VideoTrackClips": [
          {
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
            "Effects": [
              {
                "Type": "Background",
                "SubType": "Blur",
                "Radius": 0.1
              }
            ]
          }
        ]
      }
    ],
    "SubtitleTracks": [
      {
        "SubtitleTrackClips": [
          {
            "Type": "Text",
            "X": 0,
            "Y": 200,
            "Content": "フォントサイズ 80 の見出し", // Heading in font size of 80
            "Alignment": "TopCenter",
            "FontSize": 80,
            "FontColorOpacity": 1,
            "EffectColorStyle": "CS0003-000023",
            "FontFace": {
              "Bold": true
            }
          },
          {
            "Type": "Text",
            "X": 0,
            "Y": 320,
            "Font": "KaiTi",
            "Content": "斜体小見出し", // Subheading in italics
            "Alignment": "TopCenter",
            "FontSize": 45,
            "FontColor": "#ffffff",
            "FontFace": {
              "Italic": true,
              "Underline": true
            }
          },
          {
            "Type": "Text",
            "X": 50,
            "Y": 740,
            "Font": "AlibabaPuHuiTi",
            "Content": "回転", // Rotation
            "FontColor": "#FFD700",
            "Outline": 4,
            "Angle": 350,
            "OutlineColour": "#000000",
            "FontSize": 60,
            "FontFace": {
              "Bold": true
            }
          },
          {
            "Type": "Text",
            "X": 0,
            "Y": 900,
            "Content": "カスタムフォントのバナー字幕\n幅 1 の黒いストロークを追加", // Banner subtitle in a custom font \nAdd a black stroke with a width of 1
            "FontUrl": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/font/fangzhengfangsong.ttf",
            "Outline": 1,
            "OutlineColour": "000000",
            "Alignment": "TopCenter",
            "FontSize": 40,
            "FontColor": "#ffffff",
            "FontFace": {
              "Bold": true,
              "Italic": false,
              "Underline": false
            }
          },
          {
            "Type": "Text",
            "X": 20,
            "Y": 20,
            "Font": "KaiTi",
            "Content": "影\n効果を\n追加", // Add \n shadow \n effects
            "Alignment": "BottomRight",
            "FontSize": 40,
            "FontColor": "#ffffff",
            "Shadow": 3,
            "BackColour": "#000000",
            "FontFace": {
              "Bold": false,
              "Italic": true,
              "Underline": false
            }
          }
        ]
      }
    ]
  }