bug
This commit is contained in:
@@ -21,8 +21,8 @@ public class AsyncService {
|
||||
int i = p.getBody().getVideoMeta().getDuration().intValue();
|
||||
courseCatalogueChapterVideoEntity.setDuration(i);
|
||||
}else{
|
||||
Integer mp4Duration = SpdbUtil.getMp4Duration("https://ehh-private-01.oss-cn-beijing.aliyuncs.com/video/taiHuClass/" + courseCatalogueChapterVideoEntity.getVideo());
|
||||
courseCatalogueChapterVideoEntity.setDuration(mp4Duration);
|
||||
// Integer mp4Duration = SpdbUtil.getMp4Duration("https://ehh-private-01.oss-cn-beijing.aliyuncs.com/video/taiHuClass/" + courseCatalogueChapterVideoEntity.getVideo());
|
||||
// courseCatalogueChapterVideoEntity.setDuration(mp4Duration);
|
||||
}
|
||||
courseCatalogueChapterVideoDao.updateById(courseCatalogueChapterVideoEntity);
|
||||
}
|
||||
|
||||
@@ -5,24 +5,24 @@ import com.aliyun.teautil.models.RuntimeOptions;
|
||||
import com.aliyun.vod20170321.Client;
|
||||
import com.aliyun.vod20170321.models.GetVideoPlayAuthRequest;
|
||||
import com.aliyun.vod20170321.models.GetVideoPlayAuthResponse;
|
||||
import org.bytedeco.javacv.FFmpegFrameGrabber;
|
||||
import org.bytedeco.javacv.FrameGrabber;
|
||||
//import org.bytedeco.javacv.FFmpegFrameGrabber;
|
||||
//import org.bytedeco.javacv.FrameGrabber;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class SpdbUtil {
|
||||
|
||||
public static Integer getMp4Duration(String url){
|
||||
double duration = 0;
|
||||
try (FFmpegFrameGrabber frameGrabber = new FFmpegFrameGrabber(url)) {
|
||||
frameGrabber.start();
|
||||
duration = frameGrabber.getLengthInTime()/1000000;
|
||||
frameGrabber.stop();
|
||||
} catch (FrameGrabber.Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return (int)duration;
|
||||
};
|
||||
// public static Integer getMp4Duration(String url){
|
||||
// double duration = 0;
|
||||
// try (FFmpegFrameGrabber frameGrabber = new FFmpegFrameGrabber(url)) {
|
||||
// frameGrabber.start();
|
||||
// duration = frameGrabber.getLengthInTime()/1000000;
|
||||
// frameGrabber.stop();
|
||||
// } catch (FrameGrabber.Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return (int)duration;
|
||||
// };
|
||||
|
||||
public static GetVideoPlayAuthResponse getPlayAuth(String vid) throws Exception {
|
||||
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||
|
||||
Reference in New Issue
Block a user