Unsolved FFmpeg output string
-
frame= 91 fps= 45 q=30.0 size= 25kB time=00:00:02.17 bitrate= 94.0kbits/s dup=39 drop=12 this is ffmpeg output i want to get only fps value how can i get.
-
@satyanarayana143 the description of your issue is not very detailed.
So assuming you'll be running ffmpeg from Qt with the QProcess class, you may want to read the output when the QProcess::readyReadStandardOutput() signal is emitted.
Then you can use a QRegularExpression object to extract the captured string for fps= (i.e. 45)
-
what Pablo said...but it's more complicated than that...Hint...file processing status lines are not newline terminated in ffmpeg. I use ffmpeg A LOT.
-
@Kent-Dorfman thank you for sharing your experience. Since I haven't used ffmpeg this way I was talking from a general point of view of the QProcess class.
-
i am using ffmpeg with Qporcess and from that output i want to extract fps= value
-
@Pablo-J.-Rogina your methodology is correct. The only gotcha is that line based REs won't work since the output lines are not newline terminated. The RE needs to be smart enough to deal with that...or even partial output lines like " fp" being in one pattern search string and "s=???" in the next so " fps=???" isn't seen in one text block at all, but in two consecutive blocks.
-
ffmpeg is a very fast video and audio converter that can also grab from a live audio/video
source. It can also convert between arbitrary sample rates and resize video on the fly
with a high quality polyphase filter vivavideomaker