视频审核SDK帮助您检测视频中是否含有风险内容,支持同时检测视频中的图像和语音内容。

概述

  • 支持同步检测和异步检测两种方式。同步检测只支持传递视频的截帧图片序列;异步检测支持对原始视频或视频的截帧图片序列进行检测。强烈建议您使用异步视频检测。
  • 视频支持传入互联网视频URL、本地视频文件路径以及二进制视频文件流。

准备工作

在进行具体的服务调用之前,请参见以下步骤,完成准备工作:
  1. 创建阿里云AccessKeyId和AccessKeySecret。具体请参见创建AccessKey
  2. 安装Java依赖。具体请参见安装Java依赖
  3. 下载并在项目工程中引入Extension.Uploader工具类

(推荐)提交视频异步检测任务

接口描述
接口 功能 支持的Region 描述
VideoAsyncScanRequest 视频异步风险检测。
  • cn-shanghai
  • cn-beijing
  • cn-shenzhen
  • ap-southeast-1
  • us-west-1
对视频进行多个风险场景的识别,包括色情、暴恐涉政、广告 、不良场景、Logo(商标台标)识别。
示例代码
  • 传视频url进行检测
    import com.alibaba.fastjson.JSON;
    import com.alibaba.fastjson.JSONObject;
    import com.aliyuncs.DefaultAcsClient;
    import com.aliyuncs.IAcsClient;
    import com.aliyuncs.exceptions.ClientException;
    import com.aliyuncs.exceptions.ServerException;
    import com.aliyuncs.green.model.v20180509.VideoAsyncScanRequest;
    import com.aliyuncs.http.FormatType;
    import com.aliyuncs.http.HttpResponse;
    import com.aliyuncs.profile.DefaultProfile;
    import com.aliyuncs.profile.IClientProfile;
    
    import java.util.*;
    
    /**
     * TODO Add class description here
     *
     * @author jialun.wjl
     * @create 2018/12/24 19:20
     */
    public class Main {
    
        public static void main(String[] args) throws Exception {
            IClientProfile profile = DefaultProfile.getProfile("cn-shanghai", "请填写您的accessKeyId", "请填写您的accessKeySecret");
            DefaultProfile.addEndpoint("cn-shanghai", "cn-shanghai", "Green", "green.cn-shanghai.aliyuncs.com");
            IAcsClient client = new DefaultAcsClient(profile);
    
            VideoAsyncScanRequest videoAsyncScanRequest = new VideoAsyncScanRequest();
            videoAsyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式
            videoAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法
    
            List<Map<String, Object>> tasks = new ArrayList<Map<String, Object>>();
            Map<String, Object> task = new LinkedHashMap<String, Object>();
            task.put("dataId", UUID.randomUUID().toString());
            task.put("url", "请填写公网可访问的视频http/https url地址");
    
            tasks.add(task);
            /**
             * 设置要检测的场景, 计费是按照该处传递的场景进行
             * 视频默认1秒截取一帧,您可以自行控制截帧频率,收费按照视频的截帧数量以及每一帧的检测场景进行计费
             * 举例:1分钟的视频截帧60张,检测色情和暴恐涉政2个场景,收费按照60张暴恐+60张暴恐涉政进行计费
             * porn: porn表示色情场景检测,terrorism表示暴恐涉政场景检测
             */
            JSONObject data = new JSONObject();
            data.put("scenes", Arrays.asList("porn", "terrorism"));
            data.put("tasks", tasks);
    
            videoAsyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON);
    
            /**
             * 请务必设置超时时间
             */
            videoAsyncScanRequest.setConnectTimeout(3000);
            videoAsyncScanRequest.setReadTimeout(6000);
            try {
                HttpResponse httpResponse = client.doAction(videoAsyncScanRequest);
    
                if(httpResponse.isSuccess()){
                    JSONObject jsonObject = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
                    System.out.println(JSON.toJSONString(jsonObject, true));
                }else{
                    System.out.println("response not success. status:" + httpResponse.getStatus());
                }
            } catch (ServerException e) {
                e.printStackTrace();
            } catch (ClientException e) {
                e.printStackTrace();
            }
        }
    }
  • 传本地视频文件进行检测
    import com.alibaba.fastjson.JSON;
    import com.alibaba.fastjson.JSONObject;
    import com.aliyuncs.DefaultAcsClient;
    import com.aliyuncs.IAcsClient;
    import com.aliyuncs.exceptions.ClientException;
    import com.aliyuncs.exceptions.ServerException;
    import com.aliyuncs.green.extension.uploader.ClientUploader;
    import com.aliyuncs.green.model.v20180509.VideoAsyncScanRequest;
    import com.aliyuncs.http.FormatType;
    import com.aliyuncs.http.HttpResponse;
    import com.aliyuncs.profile.DefaultProfile;
    import com.aliyuncs.profile.IClientProfile;
    
    import java.util.*;
    
    public class Main {
    
        public static void main(String[] args) throws Exception {
            IClientProfile profile = DefaultProfile.getProfile("cn-shanghai", "请填写您的accessKeyId", "请填写您的accessKeySecret");
            DefaultProfile.addEndpoint("cn-shanghai", "cn-shanghai", "Green", "green.cn-shanghai.aliyuncs.com");
            IAcsClient client = new DefaultAcsClient(profile);
    
            VideoAsyncScanRequest videoAsyncScanRequest = new VideoAsyncScanRequest();
            videoAsyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式
            videoAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法
    
            /**
             * 如果您要检测的文件存于本地服务器上,可以通过下述代码片生成url,
             * 再将返回的url作为图片地址传递到服务端进行检测
             */
            String url = null;
            ClientUploader uploader = ClientUploader.getVideoClientUploader(profile, false);
            try{
                url = uploader.uploadFile("d:/test.mp4");
            }catch (Exception e){
                e.printStackTrace();
            }
    
            List<Map<String, Object>> tasks = new ArrayList<Map<String, Object>>();
            Map<String, Object> task = new LinkedHashMap<String, Object>();
            task.put("dataId", UUID.randomUUID().toString());
            task.put("url", url);
    
            tasks.add(task);
            /**
             * 设置要检测的场景, 计费是按照该处传递的场景进行
             * 视频默认1秒截取一帧,您可以自行控制截帧频率,收费按照视频的截帧数量以及每一帧的检测场景进行计费
             * 举例:1分钟的视频截帧60张,检测色情和暴恐涉政2个场景,收费按照60张暴恐+60张暴恐涉政进行计费
             * porn: porn表示色情场景检测,terrorism表示暴恐涉政场景检测
             */
            JSONObject data = new JSONObject();
            data.put("scenes", Arrays.asList("porn", "terrorism"));
            data.put("tasks", tasks);
    
            videoAsyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON);
    
            /**
             * 请务必设置超时时间
             */
            videoAsyncScanRequest.setConnectTimeout(3000);
            videoAsyncScanRequest.setReadTimeout(10000);
            try {
                HttpResponse httpResponse = client.doAction(videoAsyncScanRequest);
    
                if(httpResponse.isSuccess()){
                    JSONObject jsonObject = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
                    System.out.println(JSON.toJSONString(jsonObject, true));
                }else{
                    System.out.println("response not success. status:" + httpResponse.getStatus());
                }
            } catch (ServerException e) {
                e.printStackTrace();
            } catch (ClientException e) {
                e.printStackTrace();
            }
        }
    }
  • 传视频文件二进制数据进行检测
    import com.alibaba.fastjson.JSON;
    import com.alibaba.fastjson.JSONObject;
    import com.aliyuncs.DefaultAcsClient;
    import com.aliyuncs.IAcsClient;
    import com.aliyuncs.exceptions.ClientException;
    import com.aliyuncs.exceptions.ServerException;
    import com.aliyuncs.green.extension.uploader.ClientUploader;
    import com.aliyuncs.green.model.v20180509.VideoAsyncScanRequest;
    import com.aliyuncs.http.FormatType;
    import com.aliyuncs.http.HttpResponse;
    import com.aliyuncs.profile.DefaultProfile;
    import com.aliyuncs.profile.IClientProfile;
    
    import java.util.*;
    
    public class Main {
    
        public static void main(String[] args) throws Exception {
            IClientProfile profile = DefaultProfile.getProfile("cn-shanghai", "请填写您的accessKeyId", "请填写您的accessKeySecret");
            DefaultProfile.addEndpoint("cn-shanghai", "cn-shanghai", "Green", "green.cn-shanghai.aliyuncs.com");
            IAcsClient client = new DefaultAcsClient(profile);
    
            VideoAsyncScanRequest videoAsyncScanRequest = new VideoAsyncScanRequest();
            videoAsyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式
            videoAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法
    
            /**
             * 如果您要检测的文件存于本地服务器上,可以通过下述代码片生成url,
             * 再将返回的url作为图片地址传递到服务端进行检测
             */
            ClientUploader uploader = ClientUploader.getVideoClientUploader(profile, false);
            byte[] videoBytes = null;
            String url = null;
            try{
                //这里读取本地文件作为二进制数据,当做输入做为示例, 实际使用中请直接替换成您的图片二进制数据
                videoBytes = FileUtils.readFileToByteArray(new File("/Users/01fb4ab6420b5f34623e13b82b51ef87.jpg"));
                //上传到服务端
                url = uploader.uploadBytes(videoBytes);
            }catch (Exception e){
                System.out.println("upload file to server fail.", e);
            }
    
            List<Map<String, Object>> tasks = new ArrayList<Map<String, Object>>();
            Map<String, Object> task = new LinkedHashMap<String, Object>();
            task.put("dataId", UUID.randomUUID().toString());
            task.put("url", url);
    
            tasks.add(task);
            /**
             * 设置要检测的场景, 计费是按照该处传递的场景进行
             * 视频默认1秒截取一帧,您可以自行控制截帧频率,收费按照视频的截帧数量以及每一帧的检测场景进行计费
             * 举例:1分钟的视频截帧60张,检测色情和暴恐涉政2个场景,收费按照60张暴恐+60张暴恐涉政进行计费
             * porn: porn表示色情场景检测,terrorism表示暴恐涉政场景检测
             */
            JSONObject data = new JSONObject();
            data.put("scenes", Arrays.asList("porn", "terrorism"));
            data.put("tasks", tasks);
    
            videoAsyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON);
    
            /**
             * 请务必设置超时时间
             */
            videoAsyncScanRequest.setConnectTimeout(3000);
            videoAsyncScanRequest.setReadTimeout(10000);
            try {
                HttpResponse httpResponse = client.doAction(videoAsyncScanRequest);
    
                if(httpResponse.isSuccess()){
                    JSONObject jsonObject = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
                    System.out.println(JSON.toJSONString(jsonObject, true));
                }else{
                    System.out.println("response not success. status:" + httpResponse.getStatus());
                }
            } catch (ServerException e) {
                e.printStackTrace();
            } catch (ClientException e) {
                e.printStackTrace();
            }
        }
    }
  • 传视频直播流进行检测
    import com.alibaba.fastjson.JSON;
    import com.alibaba.fastjson.JSONObject;
    import com.aliyuncs.DefaultAcsClient;
    import com.aliyuncs.IAcsClient;
    import com.aliyuncs.exceptions.ClientException;
    import com.aliyuncs.exceptions.ServerException;
    import com.aliyuncs.green.extension.uploader.ClientUploader;
    import com.aliyuncs.green.model.v20180509.VideoAsyncScanRequest;
    import com.aliyuncs.http.FormatType;
    import com.aliyuncs.http.HttpResponse;
    import com.aliyuncs.profile.DefaultProfile;
    import com.aliyuncs.profile.IClientProfile;
    
    import java.util.*;
    
    public class Main {
    
        public static void main(String[] args) throws Exception {
            IClientProfile profile = DefaultProfile.getProfile("cn-shanghai", "请填写您的accessKeyId", "请填写您的accessKeySecret");
            DefaultProfile.addEndpoint("cn-shanghai", "cn-shanghai", "Green", "green.cn-shanghai.aliyuncs.com");
            IAcsClient client = new DefaultAcsClient(profile);
    
            VideoAsyncScanRequest videoAsyncScanRequest = new VideoAsyncScanRequest();
            videoAsyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式
            videoAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法
    
            List<Map<String, Object>> tasks = new ArrayList<Map<String, Object>>();
            Map<String, Object> task = new LinkedHashMap<String, Object>();
            task.put("dataId", UUID.randomUUID().toString());
            //url填写直播流地址
            task.put("url", "http://xxxx/test.mp4");
    
            tasks.add(task);
            /**
             * 设置要检测的场景, 计费是按照该处传递的场景进行
             * 视频默认1秒截取一帧,您可以自行控制截帧频率,收费按照视频的截帧数量以及每一帧的检测场景进行计费
             * 举例:1分钟的视频截帧60张,检测色情和暴恐涉政2个场景,收费按照60张暴恐+60张暴恐涉政进行计费
             * porn: porn表示色情场景检测
             */
            JSONObject data = new JSONObject();
            data.put("scenes", Arrays.asList("porn", "terrorism"));
            data.put("live", true);
            data.put("tasks", tasks);
    
            videoAsyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON);
    
            /**
             * 请务必设置超时时间
             */
            videoAsyncScanRequest.setConnectTimeout(3000);
            videoAsyncScanRequest.setReadTimeout(10000);
            try {
                HttpResponse httpResponse = client.doAction(videoAsyncScanRequest);
    
                if(httpResponse.isSuccess()){
                    JSONObject jsonObject = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
                    System.out.println(JSON.toJSONString(jsonObject, true));
                }else{
                    System.out.println("response not success. status:" + httpResponse.getStatus());
                }
            } catch (ServerException e) {
                e.printStackTrace();
            } catch (ClientException e) {
                e.printStackTrace();
            }
        }
    }
  • 传视频语音进行综合检测
    import com.alibaba.fastjson.JSON;
    import com.alibaba.fastjson.JSONObject;
    import com.aliyuncs.DefaultAcsClient;
    import com.aliyuncs.IAcsClient;
    import com.aliyuncs.exceptions.ClientException;
    import com.aliyuncs.exceptions.ServerException;
    import com.aliyuncs.green.extension.uploader.ClientUploader;
    import com.aliyuncs.green.model.v20180509.VideoAsyncScanRequest;
    import com.aliyuncs.http.FormatType;
    import com.aliyuncs.http.HttpResponse;
    import com.aliyuncs.profile.DefaultProfile;
    import com.aliyuncs.profile.IClientProfile;
    
    import java.util.*;
    
    public class Main {
    
        public static void main(String[] args) throws Exception {
            IClientProfile profile = DefaultProfile.getProfile("cn-shanghai", "请填写您的accessKeyId", "请填写您的accessKeySecret");
            DefaultProfile.addEndpoint("cn-shanghai", "cn-shanghai", "Green", "green.cn-shanghai.aliyuncs.com");
            IAcsClient client = new DefaultAcsClient(profile);
    
            VideoAsyncScanRequest videoAsyncScanRequest = new VideoAsyncScanRequest();
            videoAsyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式
            videoAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法
    
            List<Map<String, Object>> tasks = new ArrayList<Map<String, Object>>();
            Map<String, Object> task = new LinkedHashMap<String, Object>();
            task.put("dataId", UUID.randomUUID().toString());
            //url填写直播流地址
            task.put("url", "http://xxxx/test.mp4");
    
            tasks.add(task);
            /**
             * 设置要检测的场景, 计费是按照该处传递的场景进行
             * 视频默认1秒截取一帧,您可以自行控制截帧频率,收费按照视频的截帧数量以及每一帧的检测场景进行计费
             * 举例:1分钟的视频截帧60张,检测色情和暴恐涉政2个场景,收费按照60张暴恐+60张暴恐涉政进行计费
             * porn: porn表示色情场景检测
             */
            JSONObject data = new JSONObject();
            data.put("scenes", Arrays.asList("porn", "terrorism"));
            data.put("live", true);
            data.put("tasks", tasks);
            /**
             * 若检测视频画面的同时需要检测语音是否有风险内容,传递下面的参数
             * 注意语音的计费是按照时长进行,即该视频的时长*语音反垃圾的单价
             */
            data.put("audioScenes", Arrays.asList("antispam"));
    
            videoAsyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON);
    
            /**
             * 请务必设置超时时间
             */
            videoAsyncScanRequest.setConnectTimeout(3000);
            videoAsyncScanRequest.setReadTimeout(10000);
            try {
                HttpResponse httpResponse = client.doAction(videoAsyncScanRequest);
    
                if(httpResponse.isSuccess()){
                    JSONObject jsonObject = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
                    System.out.println(JSON.toJSONString(jsonObject, true));
                }else{
                    System.out.println("response not success. status:" + httpResponse.getStatus());
                }
            } catch (ServerException e) {
                e.printStackTrace();
            } catch (ClientException e) {
                e.printStackTrace();
            }
        }
    }

查询视频异步检测结果

接口描述
接口 功能 支持的region 描述
VideoAsyncScanResultsRequest 查询视频风险异步检测任务结果。
  • cn-shanghai
  • cn-beijing
  • cn-shenzhen
  • ap-southeast-1
  • us-west-1
查询视频检测的结果,该方法需要轮询结果,建议使用callback的方式获取结果。
示例代码
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.green.model.v20180509.VideoAsyncScanResultsRequest;
import com.aliyuncs.http.FormatType;
import com.aliyuncs.http.HttpResponse;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;

import java.util.*;

/**
 * TODO Add class description here
 *
 * @author jialun.wjl
 * @create 2018/12/24 19:22
 */
public class Main {

    public static void main(String[] args) throws Exception {
        IClientProfile profile = DefaultProfile.getProfile("cn-shanghai", "请填写您的accessKeyId", "请填写您的accessKeySecret");
        DefaultProfile.addEndpoint("cn-shanghai", "cn-shanghai", "Green", "green.cn-shanghai.aliyuncs.com");
        IAcsClient client = new DefaultAcsClient(profile);

        VideoAsyncScanResultsRequest videoAsyncScanResultsRequest = new VideoAsyncScanResultsRequest();
        videoAsyncScanResultsRequest.setAcceptFormat(FormatType.JSON);

        List<String> taskList = new ArrayList<String>();
        // 这里添加要查询的taskId,提交任务的时候需要自行保存taskId
        taskList.add("vi3pnWxOlikyx6KJNtY7Naza-1pZ$MN");

        videoAsyncScanResultsRequest.setHttpContent(JSON.toJSONString(taskList).getBytes("UTF-8"), "UTF-8", FormatType.JSON);

        /**
         * 请务必设置超时时间
         */
        videoAsyncScanResultsRequest.setConnectTimeout(3000);
        videoAsyncScanResultsRequest.setReadTimeout(6000);
        try {
            HttpResponse httpResponse = client.doAction(videoAsyncScanResultsRequest);
            if(httpResponse.isSuccess()){
                JSONObject jsonObject = JSON
                    .parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
                System.out.println(JSON.toJSONString(jsonObject, true));
            }else{
                System.out.println("response not success. status:" + httpResponse.getStatus());
            }
        } catch (ServerException e) {
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        }
    }
}

提交视频同步检测任务

接口描述
接口 功能 支持的Region 描述
VideoSyncScanRequest 同步检测视频中的风险内容。
  • cn-shanghai
  • cn-beijing
  • cn-shenzhen
  • ap-southeast-1
  • us-west-1
同步检测只支持传递视频帧序列,不支持检测视频文件,推荐使用异步检测接口。
示例代码
说明 以下代码中使用帧序列的方式提交待检测的视频。
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.green.model.v20180509.VideoSyncScanRequest;
import com.aliyuncs.http.FormatType;
import com.aliyuncs.http.HttpResponse;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;

import java.util.*;

public class Main3 {

    public static void main(String[] args) throws Exception {
        IClientProfile profile = DefaultProfile.getProfile("cn-shanghai", "请填写您的accessKeyId", "请填写您的accessKeySecret");
        DefaultProfile.addEndpoint("cn-shanghai", "cn-shanghai", "Green", "green.cn-shanghai.aliyuncs.com");
        IAcsClient client = new DefaultAcsClient(profile);

        VideoSyncScanRequest videoSyncScanRequest = new VideoSyncScanRequest();
        videoSyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式
        videoSyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法

        List<Map<String, Object>> tasks = new ArrayList<Map<String, Object>>();
        Map<String, Object> task = new LinkedHashMap<String, Object>();
        task.put("dataId", UUID.randomUUID().toString());

        List<Map<String, Object>> frames = new ArrayList<Map<String, Object>>();
        Map<String, Object> frame1 = new LinkedHashMap<String, Object>();
        frame1.put("offset", 0);
        frame1.put("url", "https://img.alicdn.com/tfs/TB1k_g9l26H8KJjSspmXXb2WXXa-600-600.jpg");

        Map<String, Object> frame2 = new LinkedHashMap<String, Object>();
        frame2.put("offset", 5);
        frame2.put("url", "http://pic12.nipic.com/20110221/6727421_210944911000_2.jpg");

        Map<String, Object> frame3 = new LinkedHashMap<String, Object>();
        frame3.put("offset", 10);
        frame3.put("url", "http://rifleman-share.oss-cn-hangzhou.aliyuncs.com/test/%E6%AD%A3%E5%B8%B8/68d5883924c9e8cc88806a73bd7a8995.jpg");
        frames.addAll(Arrays.asList(frame1, frame2, frame3));

        task.put("frames", frames);
        tasks.add(task);
        /**
         * 设置要检测的场景, 计费是按照该处传递的场景进行
         * 视频默认1秒截取一帧,您可以自行控制截帧频率,收费按照视频的截帧数量以及每一帧的检测场景进行计费
         * 举例:1分钟的视频截帧60张,检测色情和暴恐涉政2个场景,收费按照60张暴恐+60张暴恐涉政进行计费
         * porn: porn表示色情场景检测
         */
        JSONObject data = new JSONObject();
        data.put("scenes", Arrays.asList("porn", "terrorism"));
        data.put("tasks", tasks);

        videoSyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON);

        /**
         * 请务必设置超时时间
         */
        videoSyncScanRequest.setConnectTimeout(3000);
        videoSyncScanRequest.setReadTimeout(10000);
        try {
            HttpResponse httpResponse = client.doAction(videoSyncScanRequest);

            if(httpResponse.isSuccess()){
                JSONObject jsonObject = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
                System.out.println(JSON.toJSONString(jsonObject, true));
            }else{
                System.out.println("response not success. status:" + httpResponse.getStatus());
            }
        } catch (ServerException e) {
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        }
    }
}