playback lag on an 4K video
The issue is reproducible on vlc 2.2.6 win version.
I have 2 video files both of them are exported from the same source, same program, the only difference is the resolution, on is 4k the other is low resolution. The number of frames and timestamps of frames are identical.
The issue is, the normal resolution one can be played perfectly by VLC but the 4k one can't. You can easily see some lag after 1st second. There're quite a lot warning in the log.
core debug: Received first picture
core debug: Decoder wait done in 625 ms
core debug: picture might be displayed late (missing 2 ms)
core debug: picture might be displayed late (missing 19 ms)
core warning: buffer too late (-113878 us): dropped
core warning: buffer too late (-87756 us): dropped
core warning: buffer too late (-61633 us): dropped
core debug: picture might be displayed late (missing 11 ms)
core debug: picture might be displayed late (missing 5 ms)
core warning: playback too late (97431): up-sampling
core debug: picture might be displayed late (missing 5 ms)
core debug: picture might be displayed late (missing 11 ms)
core debug: picture might be displayed late (missing 6 ms)
core debug: picture might be displayed late (missing 11 ms)
core debug: picture might be displayed late (missing 5 ms)
core debug: picture might be displayed late (missing 11 ms)
core debug: picture might be displayed late (missing 12 ms)
core debug: picture might be displayed late (missing 6 ms)
core debug: picture might be displayed late (missing 12 ms)
core debug: picture might be displayed late (missing 7 ms)
core debug: picture might be displayed late (missing 12 ms)
core debug: picture might be displayed late (missing 5 ms)
core debug: picture might be displayed late (missing 12 ms)
core debug: picture might be displayed late (missing 12 ms)
core debug: picture might be displayed late (missing 5 ms)
core debug: picture might be displayed late (missing 12 ms)
core debug: picture might be displayed late (missing 11 ms)
core debug: picture might be displayed late (missing 12 ms)
core debug: auto hiding mouse cursor
core warning: picture is too late to be displayed (missing 105 ms)
core warning: picture is too late to be displayed (missing 176 ms)
core warning: picture is too late to be displayed (missing 214 ms)
core warning: picture is too late to be displayed (missing 253 ms)
core warning: picture is too late to be displayed (missing 291 ms)
avcodec warning: More than 4 late frames, dropping frame
avcodec warning: More than 4 late frames, dropping frame
To find the root cause, I added traces into 2.2.6 sourcecode, and I'll attach logs of 4k and normal videos to the report. From the log I can see lot frames in 4k video are dropped because display_time < mdate(). Maybe it's caused by too much time used in decoding?