I am using ffmpeg on linux for real time video recording to Youtube.
When I put the ffmpeg command, ffmpeg is running well. But, audio device becomes fail, frame count is not increase at all from time of audio device failure.
Video record on Youtube is stopped. but ffmpeg command is still running with not increasing frame count as follow image.
My question is that how can I get the status of ffmpeg running at outside of ffmpeg command?
My first solution is that I read frame counter field, if counter is not changed, then something fail on ffmpeg.
Best Answer
If you run ffmpeg with the
-progress - -nostats
options, it'll print its progress in a parsable format to the output:Query that output repeatedly from whatever script or shell you are calling ffmpeg from, and watch for lines starting with
frame=
. If the number does not change, the encoding process is hanging.You can see an example of a Python function querying the output of an ffmpeg command repeatedly,
yield
ing its progress in terms ofout_time
, here.