Authored by 马力

转码

... ... @@ -79,14 +79,13 @@ public class QNLiveUtilService {
//要fetch的url "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8?starttime=1544425260&endtime=1544425440";
String fetchUrl = liveM3u8Url + "?starttime=" + startTime + "&endtime=" + endTime;
logger.info("bucketManager.fetch before fetchUrl is :{}.", fetchUrl);
if (null == liveM3u8Url) {
throw new PlatformException(400);
}
try {
logger.info("bucketManager.fetch before fetchUrl is :{};BUCKET is :{};key is :{}.", fetchUrl, BUCKET, key);
FetchRet fetch = bucketManager.fetch(fetchUrl, BUCKET, key); //调用fetch方法抓取文件
logger.info("Resp is {} from bucketManager.fetch key is :{}, hash is :{},fsize is :{},mimeType is :{}.", fetch.key, key, fetch.hash, fetch.fsize, fetch.mimeType);
... ... @@ -116,6 +115,8 @@ public class QNLiveUtilService {
StringMap params = new StringMap().putWhen("force", 1, true).putNotEmpty("pipeline", PIPELINE).put("notifyURL", notifyUrl); //设置pipeline参数
try {
logger.info("method operater.pfop begin BUCKET is :{}, key is :{}, pfops is :{}, params is :{}.", BUCKET, key, pfops, params);
String persistId = operater.pfop(BUCKET, key, pfops, params);
logger.info("method transfer end fileKey is {}, mp4FileName is {} , persistid is {}", fileKey, mp4FileName, persistId);
... ...
... ... @@ -66,7 +66,7 @@ public class QNUploadServiceImpl implements IQNUploadService {
public static void main(String[] args) throws Exception{
//fetch("9790249123840_1545543654", "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8", "1545543654", "1545543664");
fetch("9790249123840_1545555597", "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8", "1545555597", "1545555619");
transfer();
}
... ... @@ -144,7 +144,7 @@ url = "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8?starttime=1545530300&e
//设置要转码的空间和key,并且这个key在你空间中存在
String bucket = "yhbflv";
String key = "ufo/live/m3u8/9790249123840_1545530300.m3u8"; // 14 4 分钟 15 3分钟
key = "ufo/live/m3u8/9790249123840_1545543654.m3u8";
key = "ufo/live/m3u8/9790249123840_1545555597.m3u8";
//设置转码操作参数 1920x1080 1280x720 848x480
String fops = "avthumb/mp4/s/1280x720/vb/1m/an/1/hr/0/r/30";
... ... @@ -152,7 +152,7 @@ url = "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8?starttime=1545530300&e
//设置转码的队列
String pipeline = "yoho-m3u8-to-mp4";
//可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当前空间。
String urlbase64 = UrlSafeBase64.encodeToString("yhbflv:ufo/live/mp4/9790249123840_1545543654.mp4");
String urlbase64 = UrlSafeBase64.encodeToString("yhbflv:ufo/live/mp4/9790249123840_1545555597.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");
... ...