VIM4: 4k60p video on ubuntu 22.04

Which version of system do you use? Khadas official images, self built images, or others?

Khadas official Ubuntu image vim4-ubuntu-22.04-gnome-linux-5.4-fenix-1.4-221229-emmc.img

Please describe your issue below:

We want to test 4K 60FPS video on Ubuntu OS, 4k24fps video is able to play smoothly but not able to play 4k60fps

Post a console log of your issue below:

Below Logs from the VLC player

khadas@Khadas:~$ vlc bbb_sunflower_2160p_60fps_normal.mp4 
VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[0000005584c5e590] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[0000007f00004310] gl gl: Initialized libplacebo v4.192.1 (API v192)
[0000007f004140f0] gl gl: Initialized libplacebo v4.192.1 (API v192)
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
[0000007f000ac840] gl gl: Initialized libplacebo v4.192.1 (API v192)
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[0000007f0cd903c0] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
[0000007f0cd903c0] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
[0000007f0cd903c0] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
[0000007f0cd903c0] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
[0000007f0cd903c0] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
[0000007f0cd903c0] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
[0000007f0cd903c0] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
[0000007f0cd903c0] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
[0000007f0cd903c0] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
[0000007f0cd903c0] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
[0000007f0cd903c0] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
[0000007f0cd903c0] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdfa9c0] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] co located POCs unavailable
[h264 @ 0x7f0cdb2f50] mmco: unref short failure
QObject::~QObject: Timers cannot be stopped from another thread

Below Logs from the MPV player:

khadas@Khadas:~$ mpv lg.ts 
 (+) Video --vid=1 (*) (hevc 3840x2160 60.000fps)
 (+) Audio --aid=1 (*) (eac3 2ch 48000Hz)
[vo/x11] Warning: this legacy VO has bad performance. Consider fixing your graphics drivers, or not forcing the x11 VO.
AO: [pulse] 48000Hz stereo 2ch float
VO: [x11] 3840x2160 yuv420p10
AV: 00:00:00 / 00:00:55 (1%) A-V:  0.494 Dropped: 30

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

AV: 00:00:04 / 00:00:55 (9%) A-V:  5.263 Dropped: 244
Audio device underrun detected.
AV: 00:00:05 / 00:00:55 (9%) A-V:  5.842 Dropped: 256
Audio device underrun detected.
AV: 00:00:05 / 00:00:55 (11%) A-V:  7.587 Dropped: 293
Audio device underrun detected.
AV: 00:00:06 / 00:00:55 (11%) A-V:  8.393 Dropped: 305

using mpv, atleast able to play 4k60fps video,but few framer drop observed.
CC @numbqq @Frank

There is hardware decoding for VLC and MPV.

And for H264 only support 4k@30fps.

You can check the usage of gstreamer.

Thanks @numbqq

H264 based video play smoothly, however sometime, see different errors

khadas@Khadas:~/Downloads$ vlc NASA_UHD_4K.mp4 
VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[000000557b9fa590] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[0000007f040042f0] gl gl: Initialized libplacebo v4.192.1 (API v192)
[0000007f044140d0] gl gl: Initialized libplacebo v4.192.1 (API v192)
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
[0000007f05df3a80] gl gl: Initialized libplacebo v4.192.1 (API v192)

[0000007f18cc8cf0] main decoder error: Timestamp conversion failed for 159092267: no reference clock
[0000007f18cc8cf0] main decoder error: Could not convert timestamp 0 for FFmpeg
[h264 @ 0x7f18d4f270] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x7f18d4f270] error while decoding MB 0 77, bytestream 186319

======================================================

[0000007efb2866b0] main decoder error: Timestamp conversion failed for 59989334: no reference clock
[0000007efb2866b0] main decoder error: Could not convert timestamp 0 for faad

======================================================

[h264 @ 0x7ef9196610] get_buffer() failed
[h264 @ 0x7ef9196610] thread_get_buffer() failed
[h264 @ 0x7ef9196610] decode_slice_header error
[h264 @ 0x7ef9196610] no frame!

May be issue with video file. not 100% sure.

I have tried with the weston steps as mention in the weston & gstreamer

same video play and got below error:

khadas@Khadas:~/Downloads$ gst-launch-1.0 playbin uri=file:///home/khadas/Downloads/NASA_UHD_4K.mp4 video-sink=waylandsink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...

(gst-launch-1.0:2024): GStreamer-CRITICAL **: 13:06:56.470: gst_value_collect_fraction: assertion 'collect_values[1].v_int != 0' failed

(gst-launch-1.0:2024): GStreamer-CRITICAL **: 13:06:56.471: passed '0' as denominator for `GstFraction'
Redistribute latency...
Redistribute latency...
Pipeline is PREROLLED ...0 %)
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstPulseSinkClock
0:01:46.7 / 0:06:00.4 (29.6 %)
** (gst-launch-1.0:2024): WARNING **: 13:08:43.590: v4l2h264dec0: Too old frames, bug in decoder -- please file a bug
WARNING: from element /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstWaylandSink:waylandsink0: A lot of buffers are being dropped.
Additional debug info:
../libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstWaylandSink:waylandsink0:
There may be a timestamping problem, or this computer is too slow.
0:03:08.4 / 0:06:00.4 (52.3 %)
** (gst-launch-1.0:2024): WARNING **: 13:10:05.304: v4l2h264dec0: Too old frames, bug in decoder -- please file a bug

** (gst-launch-1.0:2024): WARNING **: 13:10:05.338: v4l2h264dec0: Too old frames, bug in decoder -- please file a bug
0:03:08.5 / 0:06:00.4 (52.3 %)
** (gst-launch-1.0:2024): WARNING **: 13:10:05.371: v4l2h264dec0: Too old frames, bug in decoder -- please file a bug

** (gst-launch-1.0:2024): WARNING **: 13:10:05.438: v4l2h264dec0: Too old frames, bug in decoder -- please file a bug
0:03:08.6 / 0:06:00.4 (52.3 %)
** (gst-launch-1.0:2024): WARNING **: 13:10:05.505: v4l2h264dec0: Too old frames, bug in decoder -- please file a bug
0:03:08.7 / 0:06:00.4 (52.4 %)
** (gst-launch-1.0:2024): WARNING **: 13:10:05.571: v4l2h264dec0: Too old frames, bug in decoder -- please file a bug
0:03:08.8 / 0:06:00.4 (52.4 %)
** (gst-launch-1.0:2024): WARNING **: 13:10:05.671: v4l2h264dec0: Too old frames, bug in decoder -- please file a bug
0:03:08.9 / 0:06:00.4 (52.4 %)
** (gst-launch-1.0:2024): WARNING **: 13:10:05.772: v4l2h264dec0: Too old frames, bug in decoder -- please file a bug

** (gst-launch-1.0:2024): WARNING **: 13:10:05.838: v4l2h264dec0: Too old frames, bug in decoder -- please file a bug
0:03:09.0 / 0:06:00.4 (52.5 %)
** (gst-launch-1.0:2024): WARNING **: 13:10:05.938: v4l2h264dec0: Too old frames, bug in decoder -- please file a bug
0:03:09.1 / 0:06:00.4 (52.5 %)

Also tried the H.265/HEVC video, able to run the 24fps and 30fps video as expected. also observed the NOTE1

NOTE: weston window (or resolution ) size, not properly set as per the video resolution (3840x2160). Might need to explore the weston settings. let me know if you have weston.ini file.