迅睿開源框架是一款PHP8高性能·簡單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設(shè)計理念, 支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務(wù)經(jīng)理
微信掃描以上二維碼
028-61286886
技術(shù)咨詢
上傳視頻,有截取畫面的功能?
截取一個當(dāng)做播放器畫面
這個要服務(wù)器支持才行
參考文檔:《視頻提取縮略圖》
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復(fù)迅睿框架創(chuàng)始人
掛著到第三方的呢?
第三方要問第三方了
視頻上傳至oss后截幀獲取視頻封面圖工具類:
/*** 視頻處理:視頻截幀生成封面圖** @author LH_Yu* @Param uploadFile 上傳文件* @Param videoPath 原視頻key* @Param coverPicturePath 封面圖上傳路徑及取出url的key* "%s|sys/saveas,o_%s,b_%s" 具體處理格式化*/public static String coverPicture(MultipartFile uploadFile, String videoPath, String coverPicturePath) throws Exception {// 創(chuàng)建OSSClient實例。OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);// 圖片處理持久化 : 截幀生成封面圖StringBuilder sbStyle = new StringBuilder();Formatter styleFormatter = new Formatter(sbStyle);//設(shè)置圖片處理String styleType = "video/snapshot,t_3000,f_jpg,w_800,h_0,m_fast";//視頻處理String targetImage = coverPicturePath + uploadFile.getOriginalFilename();styleFormatter.format("%s|sys/saveas,o_%s,b_%s", styleType,BinaryUtil.toBase64String(targetImage.getBytes()),BinaryUtil.toBase64String(bucketName.getBytes()));ProcessObjectRequest request = new ProcessObjectRequest(bucketNamePrivate, videoPath + uploadFile.getOriginalFilename(), sbStyle.toString());GenericResult processResult = ossClient.processObject(request);processResult.getResponse().getContent().close();//設(shè)置過期時間 -- 十年Date expiration = new Date(new Date().getTime() + 3600l * 1000 * 24 * 365 * 10);String url = ossClient.generatePresignedUrl(bucketName, coverPicturePath + uploadFile.getOriginalFilename(), expiration).toString();return url;}
問阿里的技術(shù)人員
這個要服務(wù)器支持才行
參考文檔:《視頻提取縮略圖》
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復(fù)迅睿框架創(chuàng)始人
掛著到第三方的呢?
第三方要問第三方了
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
視頻上傳至oss后截幀獲取視頻封面圖工具類:
/*** 視頻處理:視頻截幀生成封面圖** @author LH_Yu* @Param uploadFile 上傳文件* @Param videoPath 原視頻key* @Param coverPicturePath 封面圖上傳路徑及取出url的key* "%s|sys/saveas,o_%s,b_%s" 具體處理格式化*/public static String coverPicture(MultipartFile uploadFile, String videoPath, String coverPicturePath) throws Exception {// 創(chuàng)建OSSClient實例。OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);// 圖片處理持久化 : 截幀生成封面圖StringBuilder sbStyle = new StringBuilder();Formatter styleFormatter = new Formatter(sbStyle);//設(shè)置圖片處理String styleType = "video/snapshot,t_3000,f_jpg,w_800,h_0,m_fast";//視頻處理String targetImage = coverPicturePath + uploadFile.getOriginalFilename();styleFormatter.format("%s|sys/saveas,o_%s,b_%s", styleType,BinaryUtil.toBase64String(targetImage.getBytes()),BinaryUtil.toBase64String(bucketName.getBytes()));ProcessObjectRequest request = new ProcessObjectRequest(bucketNamePrivate, videoPath + uploadFile.getOriginalFilename(), sbStyle.toString());GenericResult processResult = ossClient.processObject(request);processResult.getResponse().getContent().close();//設(shè)置過期時間 -- 十年Date expiration = new Date(new Date().getTime() + 3600l * 1000 * 24 * 365 * 10);String url = ossClient.generatePresignedUrl(bucketName, coverPicturePath + uploadFile.getOriginalFilename(), expiration).toString();return url;}問阿里的技術(shù)人員
問阿里的技術(shù)人員