1

I've done quite a bit of searching on this and there are a lot of references to long CLASSPATHS and command line string length limits -- see here and here -- but these are all quite old and don't seem relevant to my issues.

The process being spawned is only slightly under 200 characters, including all arguments.

The stack trace:

java.io.IOException: Cannot run program ""C:\Users\Dan\workspace\CCTV Simulator\bin\swri\sim\cctv\stream\bin\ffmpeg.exe" -r 10 -vcodec bmp -f image2pipe -i - -r 10 -vcodec mpeg4 -f mpegts udp://127.0.0.1:12345": CreateProcess error=87, The parameter is incorrect
    at java.lang.ProcessBuilder.start(Unknown Source)
    at swri.sim.cctv.stream.MpegStream.initProc(MpegStream.java:52)
    at swri.sim.cctv.stream.MpegStream.<init>(MpegStream.java:32)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    ...

Running the exact same command directly works as expected. I'm at a loss.

EDIT: I'm running Eclipse Luna (4.4.0) and JDK 1.7.

Community
  • 1
  • 1
Dan
  • 3,246
  • 1
  • 32
  • 52
  • It's better to paste your code newing `ProcessBuilder`. I suspect that the parameters which you've given to the constructor are erroneously mapped to the arguments to Windows's system call `CreateProcess`. – findall Feb 01 '15 at 06:11
  • @findall Good call. Just re-looked at my code and I'm calling with a single string containing the executable and its arguments. Splitting it out into an array resolved the issue. Want to post as an answer? – Dan Feb 01 '15 at 06:16
  • Good for you! I would like to decline your proposal, because the solution you've got on your own. What I said is no more than a hint. – findall Feb 01 '15 at 06:27

0 Answers0