I am running some commands in bash (basically some ffmpeg
commands), that I'm using grep
and awk
to filter out the results. The command takes some time and continously outputs some results as it progresses through the video. The grep
pipe is the same. But the awk
pipe waits until the command is completed and prints all at once, which is not good. I want it to output as soon as it found a match.
How to change this command to output results in real-time as it progresses?
ffmpeg -i freeze.mp4 -vf "freezedetect=n=-60dB:d=2" -map 0:v:0 -f null - 2>&1 | grep freezedetect | awk '{print $4,$5}' | tr -d , | grep lavfi