download 添加 倍速参数 -filter:v "setpts=4.0*PTS" 4倍速推流
This commit is contained in:
parent
260ac344a9
commit
67ccc748e7
@ -15,6 +15,7 @@ public class FfmpegConfig {
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class Rtp {
|
public static class Rtp {
|
||||||
|
private double downloadSpeed = 4.0;
|
||||||
private String download = "-i";
|
private String download = "-i";
|
||||||
private String input = "-re -i";
|
private String input = "-re -i";
|
||||||
private String output = "-vcodec h264 -acodec aac -f rtp_mpegts";
|
private String output = "-vcodec h264 -acodec aac -f rtp_mpegts";
|
||||||
|
@ -8,6 +8,7 @@ import org.apache.commons.exec.*;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ -33,7 +34,8 @@ public class FfmpegSupportService {
|
|||||||
public Executor pushDownload2Rtp(String input, String output, long time, TimeUnit unit, ExecuteResultHandler resultHandler){
|
public Executor pushDownload2Rtp(String input, String output, long time, TimeUnit unit, ExecuteResultHandler resultHandler){
|
||||||
FfmpegConfig.Rtp rtp = ffmpegConfig.getRtp();
|
FfmpegConfig.Rtp rtp = ffmpegConfig.getRtp();
|
||||||
FfmpegConfig.Debug debug = ffmpegConfig.getDebug();
|
FfmpegConfig.Debug debug = ffmpegConfig.getDebug();
|
||||||
String inputParam = debug.getDownload()? rtp.getDownload() : StringUtils.joinWith(" ", rtp.getDownload(), input);
|
String downloadSpeed = StringUtils.joinWith(" ","-filter:v", MessageFormat.format("\"setpts={0}*PTS\"",rtp.getDownloadSpeed()));
|
||||||
|
String inputParam = debug.getDownload()? rtp.getDownload() : StringUtils.joinWith(" ", rtp.getDownload(), input, downloadSpeed);
|
||||||
log.info("视频下载参数 {}", inputParam);
|
log.info("视频下载参数 {}", inputParam);
|
||||||
|
|
||||||
String outputParam = debug.getOutput()? rtp.getOutput() : StringUtils.joinWith(" ", rtp.getOutput(), output);
|
String outputParam = debug.getOutput()? rtp.getOutput() : StringUtils.joinWith(" ", rtp.getOutput(), output);
|
||||||
|
Loading…
Reference in New Issue
Block a user