I need to run an audio filter on a piped input using its own lufs value as a variable, without writing to disk.
I previously bounced the piped input to processedaudio.wav
and the command works as:
ffmpeg -i pipe:0 -af $(echo "startofafilter$(echo "$(
ffmpeg -i processedaudio.wav -vn -af ebur128=framelog=verbose -f null - 2>&1 |awk '/I:/{print $2}')")
restofthefilter") -f null - 2>&1);
which pulls the lufs value from processedaudio.wav
in that nested ffmpeg command (which is the same as pipe:0), but the value needs to change dynamically with each file. I need it to read from the pipe (or whatever gets me a similar effect) like this:
ffmpeg -i pipe:0 -af $(echo "startofafilter$(echo "$(
ffmpeg -i pipe:0 -vn -af ebur128=framelog=verbose -f null - 2>&1 |awk '/I:/{print $2}')")
restofthefilter") -f null - 2>&1);
where the only change is the nested input, but that command just hangs. Any ideas?
Edit: This is basically the workflow needed:
Edit2: Attempting a named pipe seems to cause ffmpeg to hang. Named pipes are working in general:
mkfifo outpipe.wav | ffmpeg -y -i test.mov outpipe.wav | ffmpeg -f wav -i outpipe.wav testout.wav
and this command works with an actual file name:
echo "$(ffmpeg -f wav -i test.wav -vn -af "ebur128=framelog=verbose" -f null - 2>&1 | awk '/I:/{print $2}')"
But it doesn't work with a piped input:
mkfifo outpipe.wav | ffmpeg -y -i test.mov outpipe.wav | echo "$(ffmpeg -f wav -i outpipe.wav -vn -af "ebur128=framelog=verbose" -f null - 2>&1 | awk '/I:/{print $2}')"
At this point, I'm not sure what's going on. Am I missing something? Is this a bug?