视频剪辑中生成花字特效的代码案例详述

news2024/11/24 7:20:11
本文为阿里云智能媒体服务IMS「云端智能剪辑」实践指南第四期,通过运用官方提供的花字模版或自定义设计花字,完成丰富、精美的花字特效视频剪辑。

昱尘|作者

在视频后期剪辑中,“花字”是一种特别的存在。

通过使用适合视频的花字,不仅可以丰富视频内容,还可以让视频传达的信息更加容易让用户接受,加深观众对于视频内容的印象。

对于做短视频营销场景的客户来说,花字更是起着至关重要的作用,不仅可以增强视频传达信息的能力,还可以增加视频的效果精美度。

视频中常用的花字,一般会包含几个要素:文字颜色、纹理、字体、多层描边、多层阴影以及背景及发光效果等。

本文主要介绍如何通过使用智能媒体服务IMS「云端智能剪辑」增加花字,将从「如何使用官方花字」以及「如何自定义设计花字」两方面来介绍强大的花字能力。本文效果实现较为简单,将视频地址换成您自己的oss地址,即可以实现示例效果。

01 原始字幕

我们参考市面上比较主流的营销类短视频剪辑模式,以下面这个流程作为demo展示的模版。

- 使用一张图片作为视频封面,增加主标题、副标题以及描述文字;

- 使用三个横屏拍摄的视频作为主体内容,输出为竖屏视频(方便手机观看),上下增加背景模糊效果;

- 每一个视频或者图片,对应一段TTS口播,让视频或者图片与口播对齐,保证视频的流畅性;

- TTS口播同时搭配ASR字幕。

按照上面这个模版,我们先看一个不使用任何复杂字幕效果剪辑成的视频效果:

https://v.qq.com/x/page/p3502q8vcef.html

通过观看视频发现,该视频中的字幕存在一些问题:

视频背景比较复杂,在字幕颜色和视频底色比较接近时,会导致字幕不够清晰;

字幕比较单调乏味,视频内容不够精致,容易让用户产生视觉疲劳,降低传播力;

字幕效果不够突出亮眼,无法一眼就让用户把握视频关键信息。

原始字幕Timeline:

{
  "VideoTracks": [{
    "VideoTrackClips": [{
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/cover.jpg",
        "Width": 1,
        "Height": 1,
        "Type": "Image",
        "AdaptMode": "Cover",
        "ReferenceClipId": "speech_1",
        "Effects": [{
            "Type": "Text",
            "Font": "HappyZcool-2016",
            "Content": "朋友聚餐",
            "Y": 0.5,
            "FontSize": 80,
            "Angle": "30",
            "Alignment": "TopCenter",
            "FontColor": "#ffffff"
          },
          {
            "Type": "Text",
            "Font": "HappyZcool-2016",
            "Content": "同学聚会",
            "Y": 0.6,
            "FontSize": 80,
            "Angle": "30",
            "Alignment": "TopCenter",
            "FontColor": "#ffffff"
          },
          {
            "Type": "Text",
            "Font": "HappyZcool-2016",
            "Content": "家人团聚",
            "Y": 0.7,
            "FontSize": 80,
            "Angle": "30",
            "Alignment": "TopCenter",
            "FontColor": "#ffffff"
          },
          {
            "Type": "Text",
            "Font": "HappyZcool-2016",
            "Content": "同事团建",
            "Y": 0.8,
            "FontSize": 80,
            "Angle": "30",
            "Alignment": "TopCenter",
            "FontColor": "#ffffff"
          }
        ]
      },
      {
        "Comment": "火锅",
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/%E7%81%AB%E9%94%85.mp4",
        "Y": 0.3,
        "Width": 1080,
        "Height": 608,
        "AdaptMode": "Cover",
        "Effects": [{
          "Type": "Background",
          "SubType": "Blur",
          "Radius": 0.1
        }],
        "ReferenceClipId": "speech_2"
      },
      {
        "Comment": "烤羊肉串",
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/%E7%83%A4%E7%BE%8A%E8%82%89%E4%B8%B2.mp4",
        "Y": 0.3,
        "Width": 1080,
        "Height": 608,
        "AdaptMode": "Cover",
        "Effects": [{
          "Type": "Background",
          "SubType": "Blur",
          "Radius": 0.1
        }],
        "ReferenceClipId": "speech_3"
      },
      {
        "Comment": "大鱿鱼",
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/%E7%83%A4%E9%B1%BF%E9%B1%BC.mp4",
        "Y": 0.3,
        "Width": 1080,
        "Height": 608,
        "AdaptMode": "Cover",
        "Effects": [{
          "Type": "Background",
          "SubType": "Blur",
          "Radius": 0.1
        }],
        "ReferenceClipId": "speech_4"
      },
      {
        "Comment": "新鲜蔬菜",
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/%E8%94%AC%E8%8F%9C.mp4",
        "Y": 0.3,
        "Width": 1080,
        "Height": 608,
        "AdaptMode": "Cover",
        "Effects": [{
          "Type": "Background",
          "SubType": "Blur",
          "Radius": 0.1
        }],
        "ReferenceClipId": "speech_5"
      }
    ]
  }],
  "AudioTracks": [{
    "AudioTrackClips": [{
        "Type": "AI_TTS",
        "Content": "周末就来阿云美食城吧",
        "Voice": "zhimi_emo",
        "ClipId": "speech_1"
      },
      {
        "Type": "AI_TTS",
        "Content": "这里有入口醇香的老北京火锅!",
        "Voice": "zhimi_emo",
        "Effects": [{
          "Type": "AI_ASR",
          "Font": "HappyZcool-2016",
          "Alignment": "TopCenter",
          "Y": 0.65,
          "FontSize": 80,
          "FontColor": "#ffffff"
        }],
        "ClipId": "speech_2"
      },
      {
        "Type": "AI_TTS",
        "Content": "这里有香喷喷的烤羊肉串!",
        "Voice": "zhimi_emo",
        "Effects": [{
          "Type": "AI_ASR",
          "Font": "HappyZcool-2016",
          "Alignment": "TopCenter",
          "Y": 0.65,
          "FontSize": 80,
          "FontColor": "#ffffff"
        }],
        "ClipId": "speech_3"
      },
      {
        "Type": "AI_TTS",
        "Content": "这里有无比鲜嫩的大鱿鱼!",
        "Voice": "zhimi_emo",
        "Effects": [{
          "Type": "AI_ASR",
          "Font": "HappyZcool-2016",
          "Alignment": "TopCenter",
          "Y": 0.65,
          "FontSize": 80,
          "FontColor": "#ffffff"
        }],
        "ClipId": "speech_4"
      },
      {
        "Type": "AI_TTS",
        "Content": "还有各种新鲜蔬菜等你来品尝~",
        "Voice": "zhimi_emo",
        "Effects": [{
          "Type": "AI_ASR",
          "Font": "HappyZcool-2016",
          "Alignment": "TopCenter",
          "Y": 0.65,
          "FontSize": 80,
          "FontColor": "#ffffff"
        }],
        "ClipId": "speech_5"
      }
    ]
  }],
  "SubtitleTracks": [{
    "SubtitleTrackClips": [{
        "Comment": "主标题",
        "Type": "Text",
        "Font": "HappyZcool-2016",
        "Y": 0.05,
        "FontSize": 200,
        "Content": "阿云美食城",
        "FontColor": "#CFFAFF",
        "SizeRequestType": "Nominal",
        "AdaptMode": "AutoScale",
        "Spacing": 3,
        "Alignment": "TopCenter"
      },
      {
        "Comment": "副标题",
        "Type": "Text",
        "Font": "HappyZcool-2016",
        "Y": 0.2,
        "FontSize": 100,
        "Content": "味蕾盛宴",
        "FontColor": "#CFFAFF",
        "SizeRequestType": "Nominal",
        "AdaptMode": "AutoScale",
        "Spacing": 3,
        "Alignment": "TopCenter"
      }
    ]
  }]
}

02 32套官方花字

为了解决上述原始字幕文字不明显以及效果比较差等一些问题,我们可以用IMS中已集成的官方花字来丰富视频内容。阿里云智能媒体服务新增32套高级花字。

花字效果示例:

https://help.aliyun.com/document_detail/449561.html

可以简单设置花字Id来一键式实现多种花字效果。使用官方花字对视频内容进行丰富的效果如下:

https://v.qq.com/x/page/r3502mwbj8h.html

对比没有配置花字的原始字幕版本的效果,可以发现:使用官方花字制作的营销短视频,不再会由于视频底色变化而让人看不清字幕,从而更加能抓住观众的注意力,加深印象。

设置花字的方式也十分简便,直接设置一个花字Id即可,比如"EffectColorStyle": "CS0002-000011",如果需要修改文字字体,可以使用自定义字体功能或者使用我们的官方内置字体库

官方花字Timeline:

{
  "VideoTracks": [{
    "VideoTrackClips": [{
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/cover.jpg",
        "Width": 1,
        "Height": 1,
        "Type": "Image",
        "AdaptMode": "Cover",
        "ReferenceClipId": "speech_1",
        "Effects": [{
            "Type": "Text",
            "Content": "朋友聚餐",
            "Y": 0.5,
            "FontSize": 80,
            "Angle": "30",
            "Alignment": "TopCenter",
            "EffectColorStyle": "CS0001-000015"
          },
          {
            "Type": "Text",
            "Content": "同学聚会",
            "Y": 0.6,
            "FontSize": 80,
            "Angle": "30",
            "Alignment": "TopCenter",
            "EffectColorStyle": "CS0001-000015"
          },
          {
            "Type": "Text",
            "Content": "家人团聚",
            "Y": 0.7,
            "FontSize": 80,
            "Angle": "30",
            "Alignment": "TopCenter",
            "EffectColorStyle": "CS0001-000015"
          },
          {
            "Type": "Text",
            "Content": "同事团建",
            "Y": 0.8,
            "FontSize": 80,
            "Angle": "30",
            "Alignment": "TopCenter",
            "EffectColorStyle": "CS0001-000015"
          }
        ]
      },
      {
        "Comment": "火锅",
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/%E7%81%AB%E9%94%85.mp4",
        "Y": 0.3,
        "Width": 1080,
        "Height": 608,
        "AdaptMode": "Cover",
        "Effects": [{
          "Type": "Background",
          "SubType": "Blur",
          "Radius": 0.1
        }],
        "ReferenceClipId": "speech_2"
      },
      {
        "Comment": "烤羊肉串",
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/%E7%83%A4%E7%BE%8A%E8%82%89%E4%B8%B2.mp4",
        "Y": 0.3,
        "Width": 1080,
        "Height": 608,
        "AdaptMode": "Cover",
        "Effects": [{
          "Type": "Background",
          "SubType": "Blur",
          "Radius": 0.1
        }],
        "ReferenceClipId": "speech_3"
      },
      {
        "Comment": "大鱿鱼",
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/%E7%83%A4%E9%B1%BF%E9%B1%BC.mp4",
        "Y": 0.3,
        "Width": 1080,
        "Height": 608,
        "AdaptMode": "Cover",
        "Effects": [{
          "Type": "Background",
          "SubType": "Blur",
          "Radius": 0.1
        }],
        "ReferenceClipId": "speech_4"
      },
      {
        "Comment": "新鲜蔬菜",
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/%E8%94%AC%E8%8F%9C.mp4",
        "Y": 0.3,
        "Width": 1080,
        "Height": 608,
        "AdaptMode": "Cover",
        "Effects": [{
          "Type": "Background",
          "SubType": "Blur",
          "Radius": 0.1
        }],
        "ReferenceClipId": "speech_5"
      }
    ]
  }],
  "AudioTracks": [{
    "AudioTrackClips": [{
        "Type": "AI_TTS",
        "Content": "周末就来阿云美食城吧",
        "Voice": "zhimi_emo",
        "ClipId": "speech_1"
      },
      {
        "Type": "AI_TTS",
        "Content": "这里有入口醇香的老北京火锅!",
        "Voice": "zhimi_emo",
        "Effects": [{
          "Type": "AI_ASR",
          "Font": "KaiTi",
          "Spacing": 2,
          "Alignment": "TopCenter",
          "Y": 0.65,
          "FontSize": 70,
          "AdaptMode": "AutoWrap",
          "EffectColorStyle": "CS0001-000014"
        }],
        "ClipId": "speech_2"
      },
      {
        "Type": "AI_TTS",
        "Content": "这里有香喷喷的烤羊肉串!",
        "Voice": "zhimi_emo",
        "Effects": [{
          "Type": "AI_ASR",
          "Font": "KaiTi",
          "Spacing": 2,
          "Alignment": "TopCenter",
          "Y": 0.65,
          "FontSize": 70,
          "AdaptMode": "AutoWrap",
          "EffectColorStyle": "CS0001-000014"
        }],
        "ClipId": "speech_3"
      },
      {
        "Type": "AI_TTS",
        "Content": "这里有无比鲜嫩的大鱿鱼!",
        "Voice": "zhimi_emo",
        "Effects": [{
          "Type": "AI_ASR",
          "Font": "KaiTi",
          "Spacing": 2,
          "Alignment": "TopCenter",
          "Y": 0.65,
          "FontSize": 70,
          "AdaptMode": "AutoWrap",
          "EffectColorStyle": "CS0001-000014"
        }],
        "ClipId": "speech_4"
      },
      {
        "Type": "AI_TTS",
        "Content": "还有各种新鲜蔬菜等你来品尝~",
        "Voice": "zhimi_emo",
        "Effects": [{
          "Type": "AI_ASR",
          "Font": "KaiTi",
          "Spacing": 2,
          "Alignment": "TopCenter",
          "Y": 0.65,
          "FontSize": 70,
          "AdaptMode": "AutoWrap",
          "EffectColorStyle": "CS0001-000014"
        }],
        "ClipId": "speech_5"
      }
    ]
  }],
  "SubtitleTracks": [{
    "SubtitleTrackClips": [{
        "Comment": "主标题",
        "Type": "Text",
        "Y": 0.05,
        "FontSize": 200,
        "Content": "阿云美食城",
        "FontColor": "#CFFAFF",
        "SizeRequestType": "Nominal",
        "AdaptMode": "AutoScale",
        "Spacing": 2,
        "Alignment": "TopCenter",
        "EffectColorStyle": "CS0002-000003"
      },
      {
        "Comment": "副标题",
        "Type": "Text",
        "Y": 0.2,
        "FontSize": 100,
        "Content": "味蕾盛宴",
        "FontColor": "#CFFAFF",
        "SizeRequestType": "Nominal",
        "AdaptMode": "AutoScale",
        "Spacing": 2,
        "Alignment": "TopCenter",
        "EffectColorStyle": "CS0002-000011"
      }
    ]
  }]
}

03 自定义设计花字

当官方花字仍无法满足视频制作效果的需求,我们也支持自定义花字功能。您可以灵活组织多层描边效果,多层阴影效果,我们也支持设置高斯模糊,实现字幕发光效果。

在具体Timeline设置前,我们先来看一下自定义设计花字的成片效果。

https://v.qq.com/x/page/h3502f25vuk.html

自定义花字的API协议:

https://help.aliyun.com/document_detail/198823.html

首先,我们来看一个多层描边的花字示例。我们以官方花字CS0001-000016这个效果为例。

CS0001-000016花字

仔细观察,可以知道这个花字是通过从外到内叠加颜色逐渐变深的多层描边来实现的,通过在SubtitleEffects中设置多层颜色逐渐变深的描边效果即可实现这个花字。

Color字段为RGB颜色值,Type设置为Outline表示描边,Bord、Shift设置成0-1的小数时,表示相对字体大小的值,实际渲染时会乘以FontSize值,这样即可实现不同字体大小下,花字效果基本保持一致。

SubtitleEffects是一个JSON数组,越靠前的在渲染时会越在底层,所以底层描边Bord需要比上层描边Bord设置的稍大一些,否则底层的描边会被上层的描边遮住,从而失去效果。

该花字的文字颜色为白色,设置字体为站酷快乐体,据此可以设置字幕轨道参数为如下。

CS0001-000016花字SubtitleTrackClips参数解析:

{
  "Type": "Text",
  "FontSize": 130,
  "Content": "阿里云剪辑",
  "Spacing": 2,
  "Alignment": "TopCenter",
  "Font": "HappyZcool-2016",
  "FontColor": "#ffffff",
  "SubtitleEffects": [{
    "Color": "#c6f295",
    "Type": "Outline",
    "Blur": 0.0,
    "XBord": 0.16,
    "YBord": 0.16,
    "XShift": 0.0,
    "YShift": 0.0,
    "Opacity": 1.0
  }, {
    "Color": "#99dda3",
    "Type": "Outline",
    "Blur": 0.0,
    "XBord": 0.12,
    "YBord": 0.12,
    "XShift": 0.0,
    "YShift": 0.0,
    "Opacity": 1.0
  }, {
    "Color": "#66c19c",
    "Type": "Outline",
    "Blur": 0.0,
    "XBord": 0.08,
    "YBord": 0.08,
    "XShift": 0.0,
    "YShift": 0.0,
    "Opacity": 1.0
  }, {
    "Color": "#138b8a",
    "Type": "Outline",
    "Blur": 0.0,
    "XBord": 0.04,
    "YBord": 0.04,
    "XShift": 0.0,
    "YShift": 0.0,
    "Opacity": 1.0
  }]
}

我们再来看如何自定义实现字幕发光效果

CS0002-000015花字

我们以CS0002-000015这个花字效果为例。仔细看,这个花字整体是由两部分组成的,一部分为底部的文字投影,一部分为上层的文字主体。

再细细观察,可以发现,文字投影部分最外是由一层淡蓝色发光效果构成,中间是一层描边,描边中间包含深蓝色的文字实体。发光的效果我们是通过给阴影增加模糊效果来实现。

上层文字主体部分,是由一个层描边包含文字主体的轮廓构成,文字主体部分有半透明效果,所以该花字效果解析的字幕轨道参数如下:

CS0002-000015花字SubtitleTrackClips参数解析:

{
  "Type": "Text",
  "FontSize": 130,
  "Content": "阿里云剪辑",
  "Y": 0.3,
  "Spacing": 2,
  "SizeRequestType": "Nominal",
  "Alignment": "TopCenter",
  "Font": "HappyZcool-2016",
  "FontColor": "#00e6ff",
  "FontColorOpacity": 0.5607843137254902,
  "SubtitleEffects": [{
      "Color": "#1be6ff",
      "Type": "Shadow",
      "Blur": 0.14,
      "XBord": 0.02,
      "YBord": 0.02,
      "XShift": 0.04,
      "YShift": 0.04,
      "Opacity": 1.0
    },
    {
      "Color": "#008c9e",
      "Type": "Shadow",
      "Blur": 0.0,
      "XBord": 0.04,
      "YBord": 0.04,
      "XShift": 0.04,
      "YShift": 0.04,
      "Opacity": 1.0
    },
    {
      "Color": "#29e6ff",
      "Type": "Outline",
      "Blur": 0.0,
      "XBord": 0.02,
      "YBord": 0.02,
      "XShift": 0.04,
      "YShift": 0.04,
      "Opacity": 1.0
    },
    {
      "Color": "#ffffff",
      "Type": "Outline",
      "Blur": 0.0,
      "XBord": 0.02,
      "YBord": 0.02,
      "XShift": 0.0,
      "YShift": 0.0,
      "Opacity": 1.0
    }
  ]
}

按照上面这个自定义花字的方法,我们可以实现任意想实现的花字效果。上面这个探店营销短视频的timeline就这样实现出来了。

自定义花字营销视频Timeline:

{
  "VideoTracks": [{
    "VideoTrackClips": [{
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/cover.jpg",
        "Width": 1,
        "Height": 1,
        "Type": "Image",
        "AdaptMode": "Cover",
        "ReferenceClipId": "speech_1",
        "Effects": [{
            "Type": "Text",
            "Content": "朋友聚餐",
            "Y": 0.5,
            "FontSize": 100,
            "Angle": "30",
            "Alignment": "TopCenter",
            "FontColor": "#FDC219",
            "FontURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/AliHYAiHei.ttf",
            "SubtitleEffects": [{
                "Type": "Outline",
                "Bord": 0.06,
                "Color": "#FDFDFD"
              },
              {
                "Type": "Outline",
                "Bord": 0.02,
                "Color": "#040404"
              }
            ]
          },
          {
            "Type": "Text",
            "Content": "同学聚会",
            "Y": 0.6,
            "FontSize": 100,
            "Angle": "30",
            "Alignment": "TopCenter",
            "FontColor": "#FDC219",
            "FontURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/AliHYAiHei.ttf",
            "SubtitleEffects": [{
                "Type": "Outline",
                "Bord": 0.06,
                "Color": "#FDFDFD"
              },
              {
                "Type": "Outline",
                "Bord": 0.02,
                "Color": "#040404"
              }
            ]
          },
          {
            "Type": "Text",
            "Content": "家人团聚",
            "Y": 0.7,
            "FontSize": 100,
            "Angle": "30",
            "Alignment": "TopCenter",
            "FontColor": "#FDC219",
            "FontURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/AliHYAiHei.ttf",
            "SubtitleEffects": [{
                "Type": "Outline",
                "Bord": 0.06,
                "Color": "#FDFDFD"
              },
              {
                "Type": "Outline",
                "Bord": 0.02,
                "Color": "#040404"
              }
            ]
          },
          {
            "Type": "Text",
            "Content": "同事团建",
            "Y": 0.8,
            "FontSize": 100,
            "Angle": "30",
            "Alignment": "TopCenter",
            "FontColor": "#FDC219",
            "FontURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/AliHYAiHei.ttf",
            "SubtitleEffects": [{
                "Type": "Outline",
                "Bord": 0.06,
                "Color": "#FDFDFD"
              },
              {
                "Type": "Outline",
                "Bord": 0.02,
                "Color": "#040404"
              }
            ]
          }
        ]
      },
      {
        "Comment": "火锅",
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/%E7%81%AB%E9%94%85.mp4",
        "Y": 0.3,
        "Width": 1080,
        "Height": 608,
        "AdaptMode": "Cover",
        "Effects": [{
          "Type": "Background",
          "SubType": "Blur",
          "Radius": 0.1
        }],
        "ReferenceClipId": "speech_2"
      },
      {
        "Comment": "烤羊肉串",
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/%E7%83%A4%E7%BE%8A%E8%82%89%E4%B8%B2.mp4",
        "Y": 0.3,
        "Width": 1080,
        "Height": 608,
        "AdaptMode": "Cover",
        "Effects": [{
          "Type": "Background",
          "SubType": "Blur",
          "Radius": 0.1
        }],
        "ReferenceClipId": "speech_3"
      },
      {
        "Comment": "大鱿鱼",
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/%E7%83%A4%E9%B1%BF%E9%B1%BC.mp4",
        "Y": 0.3,
        "Width": 1080,
        "Height": 608,
        "AdaptMode": "Cover",
        "Effects": [{
          "Type": "Background",
          "SubType": "Blur",
          "Radius": 0.1
        }],
        "ReferenceClipId": "speech_4"
      },
      {
        "Comment": "新鲜蔬菜",
        "MediaUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/%E8%94%AC%E8%8F%9C.mp4",
        "Y": 0.3,
        "Width": 1080,
        "Height": 608,
        "AdaptMode": "Cover",
        "Effects": [{
          "Type": "Background",
          "SubType": "Blur",
          "Radius": 0.1
        }],
        "ReferenceClipId": "speech_5"
      }
    ]
  }],
  "AudioTracks": [{
    "AudioTrackClips": [{
        "Type": "AI_TTS",
        "Content": "周末就来阿云美食城吧",
        "Voice": "zhimi_emo",
        "ClipId": "speech_1"
      },
      {
        "Type": "AI_TTS",
        "Content": "这里有入口醇香的老北京火锅!",
        "Voice": "zhimi_emo",
        "Effects": [{
          "Type": "AI_ASR",
          "Font": "KaiTi",
          "Spacing": 2,
          "Alignment": "TopCenter",
          "Y": 0.65,
          "FontSize": 70,
          "AdaptMode": "AutoWrap",
          "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
            }
          ]
        }],
        "ClipId": "speech_2"
      },
      {
        "Type": "AI_TTS",
        "Content": "这里有香喷喷的烤羊肉串!",
        "Voice": "zhimi_emo",
        "Effects": [{
          "Type": "AI_ASR",
          "Font": "KaiTi",
          "Spacing": 2,
          "Alignment": "TopCenter",
          "Y": 0.65,
          "FontSize": 70,
          "AdaptMode": "AutoWrap",
          "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
            }
          ]
        }],
        "ClipId": "speech_3"
      },
      {
        "Type": "AI_TTS",
        "Content": "这里有无比鲜嫩的大鱿鱼!",
        "Voice": "zhimi_emo",
        "Effects": [{
          "Type": "AI_ASR",
          "Font": "KaiTi",
          "Spacing": 2,
          "Alignment": "TopCenter",
          "Y": 0.65,
          "FontSize": 70,
          "AdaptMode": "AutoWrap",
          "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
            }
          ]
        }],
        "ClipId": "speech_4"
      },
      {
        "Type": "AI_TTS",
        "Content": "还有各种新鲜蔬菜等你来品尝~",
        "Voice": "zhimi_emo",
        "Effects": [{
          "Type": "AI_ASR",
          "Font": "KaiTi",
          "Spacing": 2,
          "Alignment": "TopCenter",
          "Y": 0.65,
          "FontSize": 70,
          "AdaptMode": "AutoWrap",
          "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
            }
          ]
        }],
        "ClipId": "speech_5"
      }
    ]
  }],
  "SubtitleTracks": [{
    "SubtitleTrackClips": [{
        "Comment": "主标题",
        "Type": "Text",
        "Y": 0.05,
        "FontSize": 200,
        "Content": "阿云美食城",
        "Spacing": 2,
        "SizeRequestType": "Nominal",
        "Alignment": "TopCenter",
        "Font": "HappyZcool-2016",
        "FontColor": "#F688AA",
        "SubtitleEffects": [{
            "Color": "#F688AA",
            "Type": "Shadow",
            "Blur": 0.30,
            "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.0
          },
          {
            "Color": "#F5D2CC",
            "Type": "Shadow",
            "XBord": 0,
            "YBord": 0,
            "XShift": -0.04,
            "Opacity": 1.0
          }
        ]
      },
      {
        "Comment": "副标题",
        "Type": "Text",
        "Y": 0.2,
        "FontSize": 100,
        "Content": "味蕾盛宴",
        "SizeRequestType": "Nominal",
        "Spacing": 2,
        "Alignment": "TopCenter",
        "Font": "HappyZcool-2016",
        "FontColor": "#F9FAFA",
        "SubtitleEffects": [{
            "Color": "#F4DF50",
            "Type": "Shadow",
            "Blur": 15,
            "XBord": 7,
            "YBord": 7
          },
          {
            "Color": "#464120",
            "Type": "Outline",
            "XBord": 2,
            "YBord": 2
          }
        ]
      }
    ]
  }]
}

以上视频制作中,没有任何时间截取的参数设置,通过轨道对齐功能,实现口播和视频相对齐,完成全流程自动化剪辑。轨道对齐示例文档请参考:

https://help.aliyun.com/document_detail/2507542.html

智能媒体服务IMS「云端智能剪辑」是基于云计算和人工智能技术的视频剪辑生产服务,能为用户提供直播剪辑、视频剪辑、模版工厂、数字人制作等核心功能,并可使用 AI 辅助剪辑生产。该产品可广泛应用于互联网、文化传媒、广告营销、教育金融等行业,满足企业进行规模、高效、便捷、智能的视频内容生产需求。

了解更多产品信息,请点击阿里云云端智能剪辑:https://www.aliyun.com/product/apsaravideo/ice/editor?spm=5176.28055625

欢迎加入官方答疑钉钉群咨询交流:31783668

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1044860.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

北斗卫星导航系统:引领现代林业发展的先锋

北斗卫星导航系统:引领现代林业发展的先锋 随着人类社会的发展,林业作为生态环境保护和经济发展的重要组成部分,也在不断向前发展。为了更好地管理和保护森林资源,我们必须寻求一种新的方式来提高林业管理的效率。而北斗技术的应用…

vscode左键无法跳转到定义的文件

之前用vscode的时候,明明是可以ctrl键鼠标左键跳转到定义文件的,突然之间就不行了,鼠标移到引入上根本都没有下划线,无法跳转 解决方法: 项目的根目录新建 jsconfig.json 文件,代码如下 {"compiler…

Multisim14.0仿真(二十一)微分单稳态触发器

一、仿真原理图: 二、仿真效果图:

数据结构与算法基础-(3)

🌈write in front🌈 🧸大家好,我是Aileen🧸.希望你看完之后,能对你有所帮助,不足请指正!共同学习交流. 🆔本文由Aileen_0v0🧸 原创 CSDN首发🐒 如…

linux下离线安装telnet

安装过程概要: (一)互联网端下载rpm包; (二)上传到服务器root目录下; (三)安装telnet服务和测试: 详细内容: (一)互联…

大家想要的Windows 11 22H2 KB5030310来了

终于,微软于2023/9/26推出了 Windows 11 22H2 可选更新 KB5030310(OS 内部版本 22621.2361),这个版本给我们带来了Windows中的 Copilot、现代化的文件资源管理器、语音访问的新文本创作体验、讲述人中的新自然语音、包括大家心心念念的任务栏永不合并、默…

rsync+inotify实时同步数据

一、相关简介 1、rsync(remote synchronize) rsync是 Liunx/Unix 下的一个远程数据同步工具,它可通过 LAN/WAN 快速同步多台主机间的文件和目录。   Linux 之间同步文件一般有两种方式,分别是 rsync 与 scp ,scp 相…

小红书水下笔记是什么意思,内容收录原理是什么

纵观小红书平台,笔记的收录率与曝光率直接影响着品牌的传播结果。而最近,平台对于水下笔记的严查和打击,日益凸显。如何在利用水下笔记传播时,尽可能的提高收录率?今天来分享下小红书水下笔记是什么意思,内容收录原理…

亚马逊评论为什么重要?亚马逊Review操作技巧有哪些?

我们为什么要做review 1. 提高页面权重 一般页面有三个部分构成标题,关键词,描述review 可以很好地充当一个描述的角色,为页面提升权重我们会发现有些评论全部是视频,但是却可以推他的关键词到他的首页,因为视频带来的…

Linux 常见问题

1. 使用 sudo 命令时,提示 is not in the sudoers file. 是由于对应用户没有添加到 sudoers 文件中,可以在该文件中指定用户权限。运行以下命令即可打开该文件: visudo 添加上对应用户的权限 Ctrl x 退出保存即可。 2. Debian 新建的普通用…

阿里云SSL证书申请

目录 1、登录阿里云2、搜索ssl证书3、进入创建证书页面4、创建证书(如果没有名额需要购买)5、申请ssl证书绑定的域名6、等待审核7、下载ssl证书 1、登录阿里云 网址:https://account.aliyun.com/login/login.htm 2、搜索ssl证书 3、进入创…

【算法基础】栈和队列及常见变种与使用,双栈、动态栈、栈的迭代器,双端队列、优先队列、并发队列、延迟队列的使用

目录 一、栈(Stack) 二、 队列(Queue) 三、栈和队列的常见变种与使用 3.1 栈的常见的变种与使用 3.1.1 最小栈(Min Stack) 3.1.2 双栈(Two Stacks) 3.1.3 固定大小栈&#xf…

前端知识总结

在前端开发中,y x是一种常见的自增运算符的使用方式。它表示将变量x的值自增1,并将自增后的值赋给变量y。 具体来说,x是一种后缀自增运算符,表示将变量x的值自增1。而y x则是将自增前的值赋给变量y。这意味着在执行y x之后&am…

云原生之高级Go工程师养成记(一):绪论及Go环境安装

文章目录 一、绪论1.1 本专栏适合学习的群体1.2 为什么选择 Go1.3 Go 语言的优势1.4 杂谈 二、Go 开发环境搭建2.1 在 Windows 下安装 Go2.2 在 Linux 下安装 Go2.3 安装 GoLand2.4 搭建 GoLand 环境2.5 第一个 Go 程序 “Hello World”2.6 补充:VSCode 配置 Go 环境…

dynamic-datasource + parallelStream数据源切换失效

记录一次使用动态数据源java8的ParallelStream并行流导致的数据源切换失效问题,先看一下异常记录: 代码如下: Service DS(DataSourceConst.ORDER) public class OrderService {Resourceprivate VendorService vendorService;public void get…

生态兼容性进一步提升!白鲸开源 WhaleStudio 与火山引擎ByteHouse完成产品互认

数据作为新型生产要素,已快速融入生产、分配、流通、消费和社会服务管理等各环节,深刻改变着生产方式、生活方式和治理方式。越来越多企业也在尝试充分利用数据要素,开辟全新发展路径,进一步实现业务价值提升。 在数字化转型的大…

《C++ Core Guidelines解析》深入理解C++

前言 在计算机编程领域,C一直以其高效、灵活和强大而闻名。然而,C作为一种复杂的编程语言,如果没有正确的理解和使用,很容易导致软件质量的下降和性能问题的出现。幸运的是,一本名为《CCore Guidelines解析》的书籍为…

【RocketMQ】(九)主从同步实现原理

RocketMQ支持集群部署来保证高可用。它基于主从模式,将节点分为Master、Slave两个角色,集群中可以有多个Master节点,一个Master节点可以有多个Slave节点。Master节点负责接收生产者发送的写入请求,将消息写入CommitLog文件&#x…

【数据结构】顺序栈及其基本操作

顺序栈 栈的数组实现(创建) 栈的初始化栈的增加(压栈)栈的删除(弹栈)栈的查询栈的判空和判满 1. 顺序栈 栈是一种数据结构,其主要特点是后进先出,相当于我们在瓶子里面放东西&am…

golang工程——protobuf使用及原理

相关文档 源码:https://github.com/grpc/grpc-go 官方文档:https://www.grpc.io/docs/what-is-grpc/introduction/ protobuf编译器源码:https://github.com/protocolbuffers/protobuf proto3文档:https://protobuf.dev/programmin…