a-schild / jave2

The JAVE (Java Audio Video Encoder) library is Java wrapper on the ffmpeg project
GNU General Public License v3.0
1.28k stars 249 forks source link

ConversionOutputAnalyzer - Input Line (1): <Invalid file index 0 in filtergraph description #239

Open fendo8888 opened 1 year ago

fendo8888 commented 1 year ago

Report an error:

23:33:42.584 [main] DEBUG ws.schild.jave.ConversionOutputAnalyzer - Input Line (1): <Invalid file index 0 in filtergraph description [0:0][1:0][2:0][3:0][4:0][5:0][6:0][7:0][8:0][9:0][10:0][11:0][12:0][13:0][14:0][15:0][16:0]concat=n=17:v=0:a=1[a].>

debug Indicates the printed execution command

23:33:42.495 [main] DEBUG ws.schild.jave.process.ProcessWrapper - About to execute C:\Users\xxxx\AppData\Local\Temp\jave\ffmpeg-amd64-3.3.1.exe  -i G:\pptx-2023924-1695544991761\20230921\voice_1.wav -i G:\pptx-2023924-1695544991761\20230921\voice_2.wav -i G:\pptx-2023924-1695544991761\20230921\voice_3.wav -i G:\pptx-2023924-1695544991761\20230921\voice_4.wav -i G:\pptx-2023924-1695544991761\20230921\voice_5.wav -i G:\pptx-2023924-1695544991761\20230921\voice_6.wav -i G:\pptx-2023924-1695544991761\20230921\voice_7.wav -i G:\pptx-2023924-1695544991761\20230921\voice_8.wav -i G:\pptx-2023924-1695544991761\20230921\voice_9.wav -i G:\pptx-2023924-1695544991761\20230921\voice_10.wav -i G:\pptx-2023924-1695544991761\20230921\voice_11.wav -i G:\pptx-2023924-1695544991761\20230921\voice_12.wav -i G:\pptx-2023924-1695544991761\20230921\voice_13.wav -i G:\pptx-2023924-1695544991761\20230921\voice_14.wav -i G:\pptx-2023924-1695544991761\20230921\voice_15.wav -i G:\pptx-2023924-1695544991761\20230921\voice_16.wav -i G:\pptx-2023924-1695544991761\20230921\voice_17.wav -filter_complex [0:0][1:0][2:0][3:0][4:0][5:0][6:0][7:0][8:0][9:0][10:0][11:0][12:0][13:0][14:0][15:0][16:0]concat=n=17:v=0:a=1[a] -map [a] G:\pptx-2023924-1695544991761\20230921\combined.wav -hide_banner

Copying the above command to cmd can be executed correctly

Here is the code

  Integer num=17;
  String arrSb = "[0:0][1:0][2:0][3:0][4:0][5:0][6:0][7:0][8:0][9:0][10:0][11:0][12:0][13:0][14:0][15:0][16:0]";
  ffmpeg.addArgument(inFile);
  ffmpeg.addArgument("-filter_complex");
  ffmpeg.addArgument(arrSb + "concat=n=" + num + ":v=0:a=1[a]");
  ffmpeg.addArgument("-map");
  ffmpeg.addArgument("[a]");
  ffmpeg.addArgument(out);