模板(preset)使用示例

最近更新时间:2020-07-08 19:00:08

需求场景:我想对mp4文件做hls切片。


{

    "Preset": "mypreset_hls",

    "Description": "demo_hls",

    "PresetType": "avtrans",

    "Param":{

        "f":"hls",

        "segment_time":6,

        "segfile_acl":"public-read",

        "AUDIO": {

            "acodec": "copy"

        },

        "VIDEO": {            

            "vcodec": "copy"

        }

    }

}

需求场景:我只想在源视频上加水印,但不打算改变源视频的分辨率、码率等参数。

{

    "Preset": "mypreset_0",

    "Description": "demo_logo",

    "PresetType": "avtrans",

    "Param":{

        "f":"mp4",

        "LOGOS":[

            [

                {

                    "url":"http://ks3-cn-beijing-internal.ksyun.com/{bucket_name}/{object_name}",  //logo路径需是ks3内网地址,属性为public

                    "logotype":"image",

                    "usage_scenario":"ALL",

                    "shortSide": 480,// 或者"optimal_w": 640, 或者"optimal_h": 480,

                    "disable_scale" : 0,

                    "offsetX": -10,

                    "offsetY": 10

                }

            ]

        ]

    }

}

需求场景:我为了水印效果更好,不想水印被过度缩放,所以准备了不同尺寸的2个水印logo文件,想根据转出视频不同尺寸加相应的水印logo(只加一个)。


{

    "Preset": "mypreset_logoselect",

    "Description": "demo_logoselect",

    "PresetType": "avtrans",

    "Param":{

        "f":"mp4",

        "AUDIO": {

            "acodec": "copy"

        },

        "VIDEO": {            

            "vcodec": "h264",

            "preset":"veryfast"

        },

        "LOGOS":[

            [

                {

                    "url":"http://ks3-cn-beijing-internal.ksyun.com/{bucket_name}/{object_name0}",

                    "logotype":"image",

                    "usage_scenario":"ALL",

                    "shortSide": 480,// 或者"optimal_w": 640, 或者"optimal_h": 480,

                    "disable_scale" : 0,

                    "offsetX": -10,

                    "offsetY": 10

                },

                {

                    "url":"http://ks3-cn-beijing-internal.ksyun.com/{bucket_name}/{object_name1}",

                    "logotype":"image",

                    "usage_scenario":"ALL",

                    "shortSide": 720,// 或者"optimal_w": 1280, 或者"optimal_h": 720,

                    "disable_scale" : 0,

                    "offsetX": -15,

                    "offsetY": 15

                }

            ]

        ]

    }

}

需求场景:我想加多个水印logo,以及水印logo要在视频开始后某个时间点开始显示。

{

    "Preset": "mypreset_multilogo",

    "Description": "demo_multilogo",

    "PresetType": "avtrans",

    "Param":{

        "f":"mp4",

        "AUDIO": {

            "acodec": "copy"

        },

        "VIDEO": {            

            "vr": "25",

            "vb": "500k",

            "vcodec": "h265",

            "height": 480,

            "as": 1,

            "preset":"veryfast"

        },

        "LOGOS":[

            [

                {

                    "url":"http://ks3-cn-beijing-internal.ksyun.com/{bucket_name}/{object_name_0}", //第一个logo路径

                    "logotype":"image",

                    "usage_scenario":"ALL",

                    "shortSide": 480,// 或者"optimal_w": 640, 或者"optimal_h": 480,

                    "disable_scale" : 0,

                    "offsetX": -10,

                    "offsetY": 10

                }

            ],

            [

                {

                    "url":"http://ks3-cn-beijing-internal.ksyun.com/{bucket_name}/{object_name_1}", //第二个logo路径

                    "logotype":"image",

                    "usage_scenario":"ALL",

                    "shortSide": 480,// 或者"optimal_w": 640, 或者"optimal_h": 480,

                    "disable_scale" : 0,

                    "offsetX": -10,

                    "offsetY": -10,

                    "ss": 5  //视频开始5秒后开始显示此logo

                }

            ]

        ]

    }

}

需求场景:我想对源视频拼接片头片尾的同时加多个水印,且第一个水印只显示在源视频上,第二个水印的显示贯穿全程。


{

    "Preset": "mypreset_multilogo",

    "Description": "demo_multilogo",

    "PresetType": "avtrans",

    "Param":{

        "f":"mp4",

        "AUDIO": {

            "acodec": "copy"

        },

        "VIDEO": {            

            "vr": "25",

            "vb": "500k",

            "vcodec": "h265",

            "height": 480,

            "as": 1,

            "preset":"veryfast"

        },

        "LOGOS":[

            [

                {

                    "url":"http://ks3-cn-beijing-internal.ksyun.com/{bucket_name}/{object_name_0}", //第一个logo路径

                    "logotype":"image",

                    "usage_scenario":"ALL",

                    "effect_objects":"1",  //表示logo加在拼接前的第二个视频上。

                    "shortSide": 480,// 或者"optimal_w": 640, 或者"optimal_h": 480,

                    "disable_scale" : 0,

                    "offsetX": -10,

                    "offsetY": 10

                }

            ],

            [

                {

                    "url":"http://ks3-cn-beijing-internal.ksyun.com/{bucket_name}/{object_name_1}", //第二个logo路径

                    "logotype":"image",

                    "usage_scenario":"ALL",

                    "effect_objects":"",  //设为空,表示logo加在拼接片头片尾后的视频上。

                    "shortSide": 480,// 或者"optimal_w": 640, 或者"optimal_h": 480,

                    "disable_scale" : 0,

                    "offsetX": -10,

                    "offsetY": -10,

                    "ss": 5  //视频开始5秒后开始显示此logo

                }

            ]

        ]

    }

}

需求场景:我想对源视频拼接片头片尾


拼接任务,模板设为普通的avtrans类型,在创建任务的时候SrcInfo设置为数组即可。

需求场景:集智高清

"VIDEO":{"codecParams":"rctype=3:qpmax=34:iper=184","crf":23,"preset":"medium","vcodec":"h265"},
"f":"mp4",
"zdParams":"preprocess=video_type=custom:thread_count=16:filter_para=DnnEnhance 3|CommonSharpen 1",
kshd=1

金山云,开启您的云计算之旅

免费注册