Opened 4 years ago

Closed 4 years ago

#6987 closed enhancement (fixed)

Showinfo halves decoding speed

Reported by: tkalliom Owned by:
Priority: wish Component: avfilter
Version: git-master Keywords: showinfo
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:

Adding -vf showinfo slows down decoding by a factor of 2–3.5x compared to the same operation without showinfo.

I am trying to process some videos per-frame and utilize PTS information for the frames. I guess I should use ffprobe as a first step, but my workflow would be simpler using just ffmpeg.

Test 1: 1,5-hour 608x336 MPEG-4 video, Intel i3-3120M

-showinfo: real 2m38.671s, user 2m36.568s, sys 0m13.524s
-without: real 0m43.250s, user 1m58.456s, sys 0m3.480s

Test 2: 22-second 3840x1920 HEVC video, 2x Intel E5-2630 v4

-showinfo: real 0m16.380s, user 0m57.284s, sys 0m3.488s
-without: real 0m6.470s, user 0m44.716s, sys 0m3.800s

Maybe it’s due to the calculation of the checksums, or “mean”/“stdev” (seem undocumented)? If this is the case, could there be options for the user to choose which columns to display in showinfo, so the expensive fields could be left out?

For comparison, the “copy” filter only adds something like 20% to the decode time.

How to reproduce:

% time ffmpeg -i input.mp4 -f image2pipe -codec rawvideo -vf showinfo - 1>/tmp/frames.dat 2>/tmp/err.txt
% time ffmpeg -i input.mp4 -f image2pipe -codec rawvideo - 1>/tmp/frames.dat 2>/tmp/err.txt
ffmpeg version 3.4.1
built on gcc 7 (Debian 7.2.0-19)

Attachments (1)

err.txt (165.7 KB ) - added by tkalliom 4 years ago.
Console output of test run

Download all attachments as: .zip

Change History (7)

comment:1 by Carl Eugen Hoyos, 4 years ago

Version: 3.4unspecified

Please test current FFmpeg git head and provide the command line you tested together with the complete, uncut console output.

by tkalliom, 4 years ago

Attachment: err.txt added

Console output of test run

comment:2 by tkalliom, 4 years ago

Version: unspecifiedgit-master

I tried the development version. The delta was still there, which is not surprising considering there haven’t been any recent major changes to showinfo.

I’m a bit confused that you ask me to provide the command line I tested? It is right there in the “how to reproduce” section.

There is nothing special about the particular runs I made. This is not some isolated special case; I could not find a file where the performance impact does not occur. I nevertheless attached the output you requested.

comment:3 by Carl Eugen Hoyos, 4 years ago

How did you get the sources (I don't understand how you get the version number)?

comment:4 by Marton Balint, 4 years ago

Since showinfo calculates plane checksums, this is expected and hardly a bug.

in reply to:  4 comment:5 by Carl Eugen Hoyos, 4 years ago

Priority: normalwish
Type: defectenhancement

Replying to cus:

Since showinfo calculates plane checksums, this is expected and hardly a bug.

But the filter would also be useful if the checksums could be turned off, no?

comment:6 by Elon Musk, 4 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.