|
@@ -720,8 +720,10 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
|
|
|
log.info(ffmpegPath + " -re -i /opt/streams/file/" + code + ".mp4 -c:v copy -c:a copy -f rtsp rtsp://124.70.58.209:8554/live/" + code);
|
|
|
try {
|
|
|
// 创建ProcessBuilder对象,设置ffmpeg命令及参数
|
|
|
- ProcessBuilder pb = new ProcessBuilder("/usr/local/ffmpeg/bin/ffmpeg", "-re", "-i", "/opt/streams/file/"+code+".mp4", "-c:v", "copy", "-c:a", "copy", "-f", "rtsp", "rtsp://124.70.58.209:8554/live/44");
|
|
|
+ ProcessBuilder pb = new ProcessBuilder("/usr/local/ffmpeg/bin/ffmpeg", "-re", "-i", "/tmp/file/"+code+".mp4", "-c:v", "copy", "-c:a", "copy", "-f", "rtsp", "rtsp://124.70.58.209:8554/live/44");
|
|
|
|
|
|
+ // 设置工作目录,如果需要的话
|
|
|
+ pb.directory(new File("/usr/local/bin/ffmpeg"));
|
|
|
Map<String, String> environment = pb.environment();
|
|
|
environment.put("LD_LIBRARY_PATH", "/usr/local/ffmpeg/lib");
|
|
|
|