I am trying to run ffmpeg via the exec call on linux. However I have to use quotes in the command (ffmpeg requires it). I've been looking through the java doc for processbuilder and exec and questions on stackoverflow but I can't seem to find a solution.
I need to run
ffmpeg -i "rtmp://127.0.0.1/vod/sample start=1500 stop=24000" -re -vcodec copy -acodec copy -f flv rtmp://127.0.0.1/live/qltv
I need to insert quotes into the below argument string. Note simply adding single or double quotes preceded by a backslash doesn't work due to the nature of how processbuilder parses and runs the commands.
String argument = "ffmpeg -i rtmp://127.0.0.1/vod/"
+ nextVideo.getFilename()
+ " start=" + nextVideo.getStart()
+ " stop=" + nextVideo.getStop()
+ " -re -vcodec copy -acodec copy -f flv rtmp://127.0.0.1/live/qltv";
Any help would be greatly appreciated.