(C++) I need a program source to parse almost all parameters it receives into a new process call

I have a program that receive some arguments from another program i can't modify, i need to intercept the arguments and remove one argument (-i randomfilename.gif) from the arguments and then call the original renamed executable with the filtered argument, the original argument looks like this "ffmpeg.exe -y -i file1.tmp -i file2.tmp -i randomfilename.gif -c:v copy -g 9999 -c:a copy -threads 4 outputfile.mp4" The gif is a w4t3rmark, that's why i want it gone, a simple argument change can remove this stuff and make the conversion proccess much quicker if it doesn't have to reprocess the video stream to include the watermark. I can take the files and run the command manually, in fact i was using pssuspend to pause ffmpeg so the next stuff coming in gets queued for conversion eternally, the main program thinks it is still converting a file and gives me plenty time to take the original files from the temporary folder before ffmpeg tries to run the conversion with the w4t3rmark parameter and delete the original files, i want to automate this stuff so that i don't have to bother at all to do stuff manually.