update to v1.2.0 进一步完善了在线解码功能

This commit is contained in:
kohgylw 2024-01-13 17:50:51 +08:00
parent 00ce501a6a
commit 1d912ec222
5 changed files with 10 additions and 15 deletions

View File

@ -50,7 +50,7 @@ public class PlayVideoServiceImpl implements PlayVideoService {
final String suffix = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
switch (suffix) {
case "mp4":
if (kfl.getExecutablePath() != null) {
if (kfl.isEnableFFmpeg()) {
// 因此对于mp4后缀的视频进一步检查其编码是否为h264如果是则允许直接播放
File target = fbu.getFileFromBlocks(f);
if (target == null || !target.isFile()) {
@ -79,7 +79,7 @@ public class PlayVideoServiceImpl implements PlayVideoService {
case "avi":
case "wmv":
case "flv":
if (kfl.getExecutablePath() != null) {
if (kfl.isEnableFFmpeg()) {
vi.setNeedEncode("Y");
} else {
vi.setNeedEncode("N");

View File

@ -100,7 +100,7 @@ public class ResourceServiceImpl implements ResourceService {
case ".wmv":
case ".mkv":
case ".flv":
if (kfl.getExecutablePath() != null) {
if (kfl.isEnableFFmpeg()) {
contentType = "video/mp4";
synchronized (VideoTranscodeUtil.videoTranscodeThreads) {
VideoTranscodeThread vtt = VideoTranscodeUtil.videoTranscodeThreads.get(fid);
@ -154,16 +154,11 @@ public class ResourceServiceImpl implements ResourceService {
* </p>
*
* @author 青阳龙野(kohgylw)
* @param resource
* java.io.File 要发送的文件资源
* @param fname
* java.lang.String 要传递给客户端的文件名会加入到响应头中
* @param contentType
* java.lang.String 返回资源的CONTENT_TYPE标识名例如text/html
* @param request
* javax.servlet.http.HttpServletRequest 请求对象
* @param response
* javax.servlet.http.HttpServletResponse 响应对象
* @param resource java.io.File 要发送的文件资源
* @param fname java.lang.String 要传递给客户端的文件名会加入到响应头中
* @param contentType java.lang.String 返回资源的CONTENT_TYPE标识名例如text/html
* @param request javax.servlet.http.HttpServletRequest 请求对象
* @param response javax.servlet.http.HttpServletResponse 响应对象
* @return int 操作完毕后返回的状态码例如200
*/
private int sendResource(File resource, String fname, String contentType, HttpServletRequest request,
@ -369,7 +364,7 @@ public class ResourceServiceImpl implements ResourceService {
@Override
public String getVideoTranscodeStatus(HttpServletRequest request) {
if (kfl.getExecutablePath() != null) {
if (kfl.isEnableFFmpeg()) {
String fId = request.getParameter("fileId");
if (fId != null) {
try {

View File

@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Sat Jan 13 17:31:21 CST 2024
#Sat Jan 13 17:49:51 CST 2024
m2e.projectLocation=/Users/kohgylw/Programs/java_workspace/kiftd
m2e.projectName=kiftd
groupId=kohgylw