全部产品

基于图片的幻灯片视频TimeLine配置示例

智能媒体生产除了提供视频的混剪能力外,还为拥有大量图片资源的用户提供基于图片的幻灯片式视频制作能力。本文向您介绍基于图片的幻灯片视频合成TimeLine配置示例。

基于图片的幻灯片视频制作

制作基于图片的幻灯片视频,用户需要分别配置:时间线 Timeline 和 合成配置 OutputMediaConfig

  1. 需要根据图片展示顺序和图片持续时长创建 Timeline,示例如下:

{
  "VideoTracks": [
      {
          "VideoTrackClips": [
              {
                "Type": "image",
                "MediaId": "****756620ed48c9af022c66ee2e****",
                "Duration": 3
              },
              {
                "Type": "image",
                "MediaId": "****3a6df8cb4b6fa2faeb9ad094****",
                "Duration": 3
              },
              {
                "Type": "image",
                "MediaId": "****c44c6b574f14859f51beca10****",
                "Duration": 3
              }
          ]
      }
  ]
}

  1. 需要在 OutputMediaConfig 配置中,指定视频的宽 Width 和高 Height,示例如下:

{
  "MediaURL":"http://my_bucket_xxx.oss-cn-shanghai.aliyuncs.com/ice/output_1280x720.mp4",
  "Height": 720,
  "Width": 1280
}

制作带字幕的图片幻灯片视频

  1. 配置带字幕的图片幻灯片视频 Timeline,示例如下:

{
    "VideoTracks": [{
      "VideoTrackClips": [{
        "Type": "image",
        "MediaId": "****756620ed48c9af022c66ee2e****",
        "Effects": [
          {
            "Type": "Text",
            "X": 33,
            "Y": 34,
            "Font": "WenQuanYi Zen Hei Mono",
            "Content": "测试文字测试文字",
            "FontSize": 26,
            "FontColorOpacity": 1,
            "FontColor": "#000000",
            "FontFace": {
              "Bold": true,
              "Italic": false,
              "Underline": false
            }
          }
        ],
          "Duration": 5
      }, {
        "Type": "image",
        "MediaId": "****3a6df8cb4b6fa2faeb9ad094****",
        "Duration": 5
      }, {
        "Type": "image",
        "MediaId": "****c44c6b574f14859f51beca10****",
        "Effects": [
          {
            "Type": "Text",
            "X": 0.7123,
            "Y": 0.7896,
            "TimelineIn": 11,
            "TimelineOut": 13,
            "Font": "WenQuanYi Zen Hei Mono",
            "Content": "测试文字测试文字",
            "FontSize": 26,
            "FontColor": "#000000"
          }
        ],
        "Duration": 5
      }]
    }]
  }
  1. 配置 OutputMediaConfig ,指定视频的宽 Width 和高 Height,示例如下:

{
 "MediaURL":"http://my_bucket_xxx.oss-cn-shanghai.aliyuncs.com/ice/output_1280x720.mp4",
  "Height": 720,
  "Width": 1280
}