Sujet : Re: Local Versus Global Command Options
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.vmsDate : 05. Mar 2025, 22:17:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vqaf1j$2jbji$1@dont-email.me>
References : 1
User-Agent : Pan/0.162 (Pokrosvk)
On Thu, 13 Feb 2025 22:52:44 -0000 (UTC), I wrote:
What’s the most complex *nix command you’ve come across? I think it has
to be ffmpeg.
For example, here’s a command I came up with for using ffmpeg to
convert an audio file for playback through the Asterisk telephony
engine. The sample rate has to be 8kHz, so to make sure there are no
aliasing artifacts, you have to make sure there are no frequency
components above about 3kHz. To achieve this, I apply a first-order
low-pass filter 16 times in a row, to produce a “brick wall” cutoff at
that frequency:
ffmpeg -i in.wav -f s16le -acodec pcm_s16le -ar 8000 \
-af $(sep=""; for i in $(seq 16); do echo -n ${sep}lowpass=f=3000; sep=","; done) \
out.slin
Note the substitution of the output of one command inside another, not
just to one, but two levels of nesting.