When you are using
strings.Fields(command), the fields are being split on spaces. This results in the
parts slice containing a value
'fade=in:0:15,fade=out:105:15', with quotes. This complete value (with quotes) is being passed to the
ffmpeg command, which the command is unable to recognize.
A shell would strip off these quotes and pass the string
fade=in:0:15,fade=out:105:15 only which Go isn't doing. To fix, try:
// remove the quotes around fade=in:0:15,fade=out:105:15 command := "ffmpeg -y -loop 1 -i image.png -vf fade=in:0:15,fade=out:105:15 -c:v mpeg2video -t 5 -s 1280x720 -r 30 -q:v 1 -preset ultrafast image.mpg" parts := strings.Fields(command)