DELETE file after render & ADD properties
This commit is contained in:
@@ -30,7 +30,7 @@ public class FfmpegService {
|
||||
private Float fps;
|
||||
private Float fileSize;
|
||||
|
||||
private static final float AUDIO_RATIO = 0.2f;
|
||||
private static final float AUDIO_RATIO = 0.15f;
|
||||
private static final float BITRATE_MULTIPLIER = 0.9f;
|
||||
|
||||
private Pattern timePattern = Pattern.compile("time=([\\d:.]+)");
|
||||
@@ -56,7 +56,7 @@ public class FfmpegService {
|
||||
|
||||
private void buildFilters() {
|
||||
List<String> filters = new ArrayList<>();
|
||||
System.out.println(fps);
|
||||
|
||||
if (fps != null) {
|
||||
filters.add("fps=" + fps);
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class FfmpegService {
|
||||
|
||||
private void buildBitrate() {
|
||||
float length = endPoint - startPoint;
|
||||
float bitrate = (fileSize / length) * BITRATE_MULTIPLIER;
|
||||
float bitrate = ((fileSize * 8) / length) * BITRATE_MULTIPLIER;
|
||||
|
||||
float video_bitrate = bitrate * (1 - AUDIO_RATIO);
|
||||
float audio_bitrate = bitrate * AUDIO_RATIO;
|
||||
@@ -128,10 +128,10 @@ public class FfmpegService {
|
||||
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
|
||||
if (line.startsWith("out_time_ms=")) {
|
||||
out_time_ms = parseLong(line.substring("out_time_ms=".length()));
|
||||
}
|
||||
logger.debug(line);
|
||||
// if (line.startsWith("out_time_ms=")) {
|
||||
// out_time_ms = parseLong(line.substring("out_time_ms=".length()));
|
||||
// }
|
||||
}
|
||||
|
||||
logger.info("FFMPEG finished");
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ddf.vodsystem.services;
|
||||
|
||||
import com.ddf.vodsystem.entities.Job;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -21,7 +22,9 @@ import org.slf4j.LoggerFactory;
|
||||
@Service
|
||||
public class UploadService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(UploadService.class);
|
||||
private static final String UPLOAD_DIR = "videos/";
|
||||
|
||||
@Value("${temp.vod.storage}")
|
||||
private String UPLOAD_DIR;
|
||||
private final JobService jobService;
|
||||
|
||||
@Autowired
|
||||
|
||||
Reference in New Issue
Block a user