Thank you Steven.
Raising this topic from the dead.
In my scenario, concatenation of the command fails, as I get single apostrophes in the command that I don’t want, see my first comment.
Any ideas how I can avoid this?
Hardcoding the parameters (second run command) is a workaround (but obviously I loose much flexibility)
infile = raw"C:\temp\t\in.flac"
outfile = raw"C:\temp\t\out.mp3"
@assert splitext(infile)[2] == ".flac"
parms = "-ar 48000 -ab 320k -y -ac 2 -vn -map_metadata 0 -id3v2_version 3"
cmd = `ffmpeg -i $infile $parms $outfile`
run(cmd)
#THIS FAILS, because there are single quotes in the parameters, how can I get rid of them?
`ffmpeg -i 'C:\temp\t\in.flac' '-ar 48000 -ab 320k -y -ac 2 -vn -map_metadata 0 -id3v2_version 3' 'C:\temp\t\out me mo.mp3'`
cmd = `ffmpeg -i $infile -ar 48000 -ab 320k -y -ac 2 -vn -map_metadata 0 -id3v2_version 3 $outfile`
#run(cmd) #works but prints to stdout
rs = run(pipeline(cmd, stdout=devnull, stderr=devnull))
@assert rs.exitcode == 0
@assert rs.termsignal == 0