termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
12.63k stars 2.91k forks source link

[Bug]: vlc H265/HEVC Performance #20671

Open hansm629 opened 1 week ago

hansm629 commented 1 week ago

Problem description

When playing 4K@30fps H265/HEVC video using vlc-qt, the video screen is broken.

With the performance of the latest flagship SoC's CPU (Snapdragon 8 Gen2, Exynos 2400, Snapdragon 8 Gen3), playback would be sufficient without hardware decoding, but strangely, symptoms of screen crash are occurring separately from frame drops.

Screenshot_2024-06-25_23-24-05

Is it possible to fix the screen crash and performance above?

What steps will reproduce the bug?

4K@30fps H265/HEVC Sample

video sample above

On Snapdragon 8 Gen2, Exynos 2400, Snapdragon 8 Gen3 host devices Symptoms occur when playing through vlc-qt

zink, virpipe, llvmpipe are all the same

What is the expected behavior?

No response

System information

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=18475
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirror.sjtu.edu.cn/termux/termux-main/ stable main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# x11-repo (sources.list.d/x11.list)
deb https://mirror.sjtu.edu.cn/termux/termux-x11/ x11 main
Updatable packages:
All packages up to date
termux-tools version:
1.42.4
Android version:
14
Kernel build information:
Linux localhost 6.1.43-android14-11-abS926NKSU2AXE4 #1 SMP PREEMPT Tue May 28 05:26:39 UTC 2024 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-S926N
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.widget versionCode:13
com.termux.x11 versionCode:14
com.termux.api versionCode:51
DuilioPerez commented 3 days ago

I've experienced using vlc-qt in termux and it's performance is very poor. Even without hardware acceleration firefox and mpv can play a video in a high framerate. I don't know why vlc-qt is slow in termux, but maybe is related to Qt, because firefox uses GTK and mpv uses SDL

twaik commented 3 days ago

Disable OpenGL rendering, enable X11/XCB rendering.

DuilioPerez commented 3 days ago

Here it is a comparative video

https://github.com/termux/termux-packages/assets/135564120/70115329-2ed7-4f34-a839-3697acb13bbc

mpv and firefox work very well, but vlc-qt have performance and image decoding issues. This was done without hardware acceleration in a device with 4GB of RAM. The video was HD Quality

twaik commented 3 days ago

No need to compare. Just use this. image

DuilioPerez commented 3 days ago

No need to compare. Just use this. image

It worked, thanks. But why isn't this the default option?

hansm629 commented 3 days ago

@twaik Screenshot_2024-07-05_01-00-50 Screenshot_2024-07-05_01-01-20

When set to XVideo output (XCB) No video is displayed.

Screenshot_2024-07-05_01-02-12 Screenshot_2024-07-05_01-03-02

When set to X11 Video output (XCB) Video is displayed, but the screen is still broken and performance is slow.

This is a Snapdragon 8 Gen3 host device. (Galaxy S24 Ultra)

hansm629 commented 3 days ago

@twaik Screenshot_2024-07-05_01-03-02

When set to X11 Video output (XCB) Video is displayed, but the screen is still broken and performance is slow.

This is a Snapdragon 8 Gen3 host device. (Galaxy S24 Ultra)

hansm629 commented 3 days ago

@twaik Screenshot_2024-07-05_01-15-36 I tested it further

When playing via mpv There doesn't seem to be any signs of screen cracking.

However, the performance was very slow.

When playing video in vlc-qt

4K@60fps H.264/AVC1 4K@60fps VP9

Everything plays well

Only H265/HEVC codec 1080p@30fps and 4K@30fps are both very slow Symptoms of screen cracking appear.