|
@@ -1400,21 +1400,6 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
|
|
}
|
|
}
|
|
|
|
|
|
public void getDuration(String file) {
|
|
public void getDuration(String file) {
|
|
- String filePath = "D:\\LY\\1.m4a";
|
|
|
|
- try (FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(filePath)) {
|
|
|
|
- grabber.start();
|
|
|
|
- // 总时长(纳秒)
|
|
|
|
- long durationInNanoSeconds = grabber.getLengthInTime();
|
|
|
|
- // 转换为秒
|
|
|
|
- double durationInSeconds = durationInNanoSeconds / 1_000_000_000.0;
|
|
|
|
- log.info("Audio Duration: " + durationInSeconds + " seconds");
|
|
|
|
- grabber.stop();
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.getMessage();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
String filePath = "/opt/1.m4a";
|
|
String filePath = "/opt/1.m4a";
|
|
try (FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(filePath)) {
|
|
try (FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(filePath)) {
|
|
grabber.start();
|
|
grabber.start();
|