How to highlight terms in an output that has a live update?
1
vote
2
answers
336
views
I'm doing a loop over ffmpeg to convert a bunch of videos, and I would like to highlight some terms in ffmpeg's output. But the solution I tried always made the live progress of the conversion disappear.
What I have tried is mainly to redirect stderr to stdout, and grep or ack like this (ffmpeg's command is simplified for readability) :
ffmpeg -i input.mp4 ouput.mkv 2>&1 | ack --passthru --color "pcm_s16le|aac"
or
ffmpeg -i input.mp4 ouput.mkv 2>&1 | grep -E "pcm_s16le|aac|$"
(note the |$
hack that allow to match everything without coloring it, acting like a passthrough)
And what I mean by live progress info is the line that look like this :
frame=190 fps=3.7 q=-0.0 size=308kB time=06:08.66 bitrate=677kbits/s speed=0.17x
So, is there a way to highlight some words that output, _and_ keep the live progress ?
Asked by Cqoicebordel
(11 rep)
Feb 12, 2019, 11:44 PM
Last activity: Feb 13, 2019, 09:33 PM
Last activity: Feb 13, 2019, 09:33 PM