Authored by 马力

编译

... ... @@ -142,14 +142,12 @@ public class QNLiveUtilService {
OperationManager operater = new OperationManager(auth, cfg);
try {
OperationStatus operationStatus = operater.prefop(persistId);
logger.info("result queryPrefopStatus is {}, persistId is {}", operationStatus.code, persistId);
if (0 == operationStatus.code || 4 == operationStatus.code) { // 状态码 0:成功,1:等待处理,2:正在处理,3:处理失败,4:成功但通知失败
return "success";
} else if (1 == operationStatus.code || 2 == operationStatus.code) {
return "operating";
}
logger.info("result queryPrefopStatus is {}, persistId is {}", operationStatus.code, persistId);
} catch (QiniuException e) {
logger.error("method queryPrefopStatus find wrong persistId is {}, error is {}", persistId, e.response);
} catch (Exception e) {
... ...
... ... @@ -84,11 +84,11 @@ public class QNUploadServiceImpl implements IQNUploadService {
//文件保存的空间名和文件名
String bucket = "yhbflv";
String key = "ufo/live/m3u8/yohotest15.m3u8";
String key = "ufo/live/m3u8/yohotest115.m3u8";
//要fetch的url
String url = "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8?starttime=1545291515&endtime=1545292115";
url = "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8?starttime=1545484537&endtime=1545484565";
try {
//调用fetch方法抓取文件
FetchRet fetch = bucketManager.fetch(url, bucket, key);
... ... @@ -114,7 +114,7 @@ public class QNUploadServiceImpl implements IQNUploadService {
OperationManager operater = new OperationManager(auth, cfg);
//设置要转码的空间和key,并且这个key在你空间中存在
String bucket = "yhbflv";
String key = "ufo/live/m3u8/yohotest15.m3u8"; // 14 4 分钟 15 3分钟
String key = "ufo/live/m3u8/yohotest115.m3u8"; // 14 4 分钟 15 3分钟
//设置转码操作参数 1920x1080 1280x720 848x480
String fops = "avthumb/mp4/s/1280x720/vb/1m/an/1/hr/0/r/30";
... ... @@ -122,7 +122,7 @@ public class QNUploadServiceImpl implements IQNUploadService {
//设置转码的队列
String pipeline = "yoho-m3u8-to-mp4";
//可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当前空间。
String urlbase64 = UrlSafeBase64.encodeToString("yhbflv:ufo/live/mp4/yohotest15.mp4");
String urlbase64 = UrlSafeBase64.encodeToString("yhbflv:ufo/live/mp4/yohotest115.mp4");
String pfops = fops + "|saveas/" + urlbase64;
//设置pipeline参数 http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/ufoLive/ufo_avthumb_notify
StringMap params = new StringMap().putWhen("force", 1, true).putNotEmpty("pipeline", pipeline).put("notifyURL", "http://testapi.yohops.com/ufoLive/ufo_avthumb_notify");
... ...