Skip to content

resourceDetail

東引甌越 edited this page Oct 24, 2017 · 8 revisions

文件内容

1.0版本中,每个MV资源文件包含以下内容:

  • MV配置文件 config.json
  • MV需要的 *.mp3资源
  • MV需要的 *.mp4资源
  • MV缩略图icon.png(仅用于MV选择时的UI显示)

配置好以上资源后,打包成zip以备使用

注意:Demo中 文件夹打包的名称必须和zip 包名称一致,否则解压不出来
注意:可以不把icon.png打包到zip中,直接在demo里面使用

配置config.json文件

每个zip中必须包含一个config.json 文件,该文件负责配置所有资源的使用

{
    "ver": "1.6",
    "loop": true,
    "music": "music.mp3",
    "movie": "movie.mp4",
    "duration": 15000,
    "plat": "Android",
    "animations": {
        "frames": [
            {
                "eid": 1,
                "t": 2000,
                "vtrack": "a",
                "fid": 1,
                "fdur": 800,
                "fs": true
            },
            {
                "eid": 1,
                "t": 4000,
                "vtrack": "a",
                "fid": 1,
                "fs": false
            },
            {
                "eid": 2,
                "t": 5000,
                "vtrack": "a",
                "fid": 1,
                "fdur": 800,
                "fs": true
            },
            {
                "eid": 2,
                "t": 6000,
                "vtrack": "a",
                "fid": 1,
                "fs": false
            },
            {
                "eid": 3,
                "t": 8000,
                "vtrack": "a",
                "fid": 2,
                "fdur": 600,
                "fs": true
            },
            {
                "eid": 3,
                "t": 9000,
                "vtrack": "a",
                "fid": 2,
                "fs": false
            }
        ]
    },
    "filters": [
       {
            "vertex": "",
            "fragment": "\nprecision highp float;\nuniform sampler2D inputImageTexture;\nvarying vec2 textureCoordinate;\nuniform float timeInfo;\nvoid main()\n{\nvec2 newcoor = textureCoordinate;\nfloat timediff = 1.0 - timeInfo;\nif (textureCoordinate.y > timediff){\nnewcoor.y = textureCoordinate.y - timediff;\n}else{\nnewcoor.y = 1.0 - (timediff - textureCoordinate.y);\n}\nvec4 video = texture2D(inputImageTexture, newcoor);\ngl_FragColor = video;\n} ",
            "name": "Up",
            "fid": 1
        },
        {
            "vertex": "",
            "fragment": "\nprecision highp float;\nuniform sampler2D inputImageTexture;\nvarying vec2 textureCoordinate;\nuniform float timeInfo;\nvoid main()\n{\nvec2 newcoor = textureCoordinate;\nif (textureCoordinate.y > timeInfo){\nnewcoor.y = textureCoordinate.y - timeInfo;\n}\nif (textureCoordinate.y > 0.5){\nnewcoor.y = textureCoordinate.y - 0.5;\n}\nvec4 video = texture2D(inputImageTexture, newcoor);\ngl_FragColor = video;\n} ",
            "name": "HalfDown",
            "fid": 2
        },
        {
            "vertex": "",
            "fragment": "",
            "name": "nature",
            "params": {
                "grind":0.5
            },
            "fid": 100
        },
        {
            "vertex": "",
            "fragment": "",
            "name": "pro",
            "params": {
                "grind":0.5,
                "white":0.5,
                "ruddy":0
            },
            "fid": 101
        }
    ]
}

filters

上面的filters字段就是 配置金山云的美颜滤镜相关参数

注意:params这个key解析的json 数据结构是动态的,建议解析这个字段的时候做一次检查,eg:字典的某些 key是否存在

更多字段相关介绍请参考MV字段介绍

1. 短视频SDK

2. MV制作教程

3. MV资源下载

4. 反馈与建议

金山云计算

Clone this wiki locally