private static final Logger log = LoggerFactory.getLogger(VodClipTest.class);
/**
* 裁剪视频
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testUploadWatermark() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v2/video/"+userId+"/clip";
String vid = "1b448be323631e6e80e12e0790609f68_1";
String title="美食";
String timeFrame = "[{\"start\":1,\"end\":6},{\"start\":10,\"end\":16}]";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userId", userId);
requestMap.put("ptime", ptime);
requestMap.put("vid", vid);
requestMap.put("title", title);
requestMap.put("timeFrame", timeFrame);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url,requestMap);
log.debug("测试裁剪视频,{}", response);
//do somethings
}