Opened 4 months ago

Last modified 4 months ago

#6987 new enhancement

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

Description

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 months ago.
Console output of test run

Download all attachments as: .zip

Change History (6)

comment:1 Changed 4 months ago by cehoyos

  • Version changed from 3.4 to unspecified

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

Changed 4 months ago by tkalliom

Console output of test run

comment:2 Changed 4 months ago by tkalliom

  • Version changed from unspecified to git-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 Changed 4 months ago by cehoyos

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

comment:4 follow-up: Changed 4 months ago by cus

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

comment:5 in reply to: ↑ 4 Changed 4 months ago by cehoyos

  • Priority changed from normal to wish
  • Type changed from defect to enhancement

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?

Note: See TracTickets for help on using tickets.