The command sometimes succesfully launches the batch file however, sometimes it doesn't work and it immediately closes.
When I launch the batch file directly from either cmd or by double clicking the file, it always works flawlessly.
I was wondering what I could do to fix this issue.
#a couple of the commands I have tried
start-process -wait -filepath "C:\Windows\System32\cmd.exe" -argumentlist "/c 'C:\path\stream3.bat' .\refresh.bat"
start-process -wait -filepath "C:\Windows\System32\cmd.exe" -argumentlist "/c 'C:\path\stream3.bat'"
#The contents of the batch file
ffmpeg -loglevel error -i "rtmp://mystream" -vf "scale=426:240,boxblur=luma_radius=1:chroma_radius=1" -vcodec libx264 -an -r 25 -b:v 550000 -crf 31 -sc_threshold 0 -f hls -hls_time 5 -segment_time 5 -hls_list_size 5 "C:\nginx\srv\hls\stream3\output.m3u8"