nova-video-player / aos-AVP

NOVA opeN sOurce Video plAyer: main repository to build them all
Apache License 2.0
3.14k stars 189 forks source link

Latest version very slow even on 1080p #139

Closed JJD2K closed 4 years ago

JJD2K commented 5 years ago

The latest version is very slow - skipping frames even on 1080p files, 4K unplayable. Last relatively usable version was 3.2...everything newer is very slow. I installed ARCHOS again for comparison and it is way faster even than 3.2. MX Player has a NEON hardware accelerator plugin for FFMPEG I do not know if you can't use it too: https://forum.xda-developers.com/apps/mx-player/mx-player-custom-codec-dts-support-t2156254

I am sorry if I am annoying, but if playback is slow (unusable) then all other features are just useless.

courville commented 5 years ago

Thanks for testing. Please report which codec/container you are experiencing the issue. We do use neon software acceleration in ffmpeg but again, ffmpeg is not used for hwdec: mediacodec platform ones are used (like for mxplayer or vlc). 4k plays well on nvidia shield. I will test on the mtk sony platform more.

courville commented 5 years ago

Talking about version 3.2 might help narrowing down when the regression might have occurred. Looking at https://github.com/nova-video-player/aos-AVP/releases v3.2 tag is 4/2/2019 (no apk available). Since v3.0 new ffmpeg-4.2-dev is used thus multimedia wise nothing really changed... If you could pinpoint the apk from https://github.com/nova-video-player/aos-AVP/releases that would lead to this behavior that would help. Please be sure that the indexing is not running when you perform the video playback testing.

JJD2K commented 5 years ago

Codec: H264 - MPEG-4 AVC (part 10) (avc1)

JJD2K commented 5 years ago

I took this from VLC on windows as I do not see any debugging info in NOVA. I will try to copy all the file info as there is no copy option in the damned thing and I have to copy 20 rows from a tree.

courville commented 5 years ago

I took this from VLC on windows as I do not see any debugging info in NOVA. I will try to copy all the file info as there is no copy option in the damned thing and I have to copy 20 rows from a tree.

no need, what is provided is enough. Thx

JJD2K commented 5 years ago

I do not recommend you testing performance on Nvidia Shield - it is more than 2 times faster than the fastest tv box on the market. So even if it runs on the Shields it may not run on anything else. I will be purchasing a Shield if MXPlayer stops playing too, but for now it manages to play 80-90GB 4K files really smooth.

courville commented 5 years ago

I do not recommend you testing performance on Nvidia Shield - it is more than 2 times faster than the fastest tv box on the market. So even if it runs on the Shields it may not run on anything else. I will be purchasing a Shield if MXPlayer stops playing too, but for now it manages to play 80-90GB 4K files really smooth.

ok buy me a slow hardware ;-) I have adt2 amlogic playing 4k fine. Will try on sony tomorrow when in front of such a tv.

JJD2K commented 5 years ago

I have Amlogic too...S905x2 T95Q - it can not play any 4k at ll. Much worse than the Sony- can not even compare them. Looking at your adt2 my t95q should be even a bit faster than your device, but nova with 4k is unusable there. Maybe drivers, firmware - I do not know...its a Chinese crap. Also picture flickering on 4k content - even on antutu.

JJD2K commented 5 years ago

About the codec - I do know its a MEDIATEK chip in the TV, but without that codec MX PLAYER is unusable too. With the codec it is perfect so it must be using it. Actually without the codec MXPlayer seems much slower than NOVA.

Is it possible to load it in NOVA? It should be.

JJD2K commented 5 years ago

Here is the full file info. File is playing but there is constant frame skip maybe every second or so.

1

JJD2K commented 5 years ago

Maybe it is a 3.1 or 3.3 ... there is no way to check in the app settings - I wrote this in my past tests. I can not upload it here as it is big. Maybe you can identify it by size. 1

courville commented 5 years ago

info is displayed in android settings apps info there is sometihng like 1.0.20190515.2029

JJD2K commented 5 years ago

I checked it by size - it is the 3.1 version - my mistake.

JJD2K commented 5 years ago

Is it possible to load it in NOVA? It should be. In MXPlayer I have it on HW+ with the above-mentioned decoder.

courville commented 5 years ago

OK I play 4k smoothly on sony tv using poor mtk cpu. Can you please confirm that you have disabled audio passthrough?

JJD2K commented 5 years ago

Hello both audio pass-through and automatic refresh are disabled. I am experiencing issues on a 1080p file - not 4k - there is stutter every few seconds. I will test in Archos now and let you know.

Ok tested in Archos - playing same file very smooth-no stutter at all. This confirms that it is not an issue with the file itself.

courville commented 5 years ago

Could you please try this apk (media engine from v2.1 with all v3.x changes): https://drive.google.com/file/d/1geJy5RdQ6dVuMLOx-vjQU7LcEcL5q7LU/view?usp=sharing and report if this is any better? Thank you for your testing and comments.

JJD2K commented 5 years ago

Hello I tested this intensively and it seems that it is not a media engine issue. As far as I see the latest version from app store and the one that you sent have almost identical performance. Not much difference with the original Archos too.

While testing I noticed that it does not happen always (the stutter) and when it happens is within the first 3-4 minutes of the movie. Maybe a background thread is running which causes slowdowns. I tried also to kill the app and start the video fast, but it is not related too as it sometimes played smoothly.

Why you say poor MTK cpu? My poor MTK cpu decodes better than S905x2....

What about my question? Can you load the MXPlayer codec in NOVA? That would be really great. If you can make such build I will be glad to test.

courville commented 5 years ago

OK thanks for the report. The background task might be the multimedia indexer especially after first app install. There is no need to use MXPlayer codec since it is software codecs that are almost never used. Anyhow, mxplayer uses ffmpeg and I trust that we are using a more recent library with all optimization enabled. There is indeed a difference with mxplayer but this does not come from this pack. I say poor MTK CPU because there are many issues with MTK and I find overall the experience on the sony TVs very poor in terms of UI and reactivity and this independently from nova.

courville commented 5 years ago

FYI the shared apk is aligned with the Archos Video Player in terms of ffmpeg version used and thus should have exactly the same performance (just like nova v2.1 previous release on google play i.e. not beta).

JJD2K commented 5 years ago

"There is no need to use MXPlayer codec since it is software codecs that are almost never used."

I do not think that this is right - I set it to HW+ and it is very smooth. Please download and try - I gave you the link above - it is extremely fast on ALL content.

courville commented 5 years ago

"There is no need to use MXPlayer codec since it is software codecs that are almost never used."

I do not think that this is right - I set it to HW+ and it is very smooth. Please download and try - I gave you the link above - it is extremely fast on ALL content.

Respectfully, can you please trust me when I say that HW+ has nothing to do with libffmpeg.mx.so.neon.1.9.18.2 from mxplayer? We do use ffmpeg as well cf. https://github.com/nova-video-player/aos-ffmpeg-android-builder Mxplayer uses https://sites.google.com/site/mxvpen/ffmpeg XDA link you provided uses https://github.com/USBhost/MX_FFmpeg Now if you find any option that I did not use that yields to better performance please let me know. But again this is only for software decoding and this is not what is used for mxplayer HW or HW+ which uses your platform i.e. hardware codecs interfaced with Android MediaCodec OMX or whatelse. This secret sauce makes the difference not ffmpeg.

courville commented 5 years ago

Using this issue to record that mxplayer uses https://github.com/USBhost/MX_FFmpeg/blob/master/ffmpeg/JNI/ffmpeg/Changelog ffmpeg 3.4 not 4.2, there is no magic detected here https://github.com/USBhost/MX_FFmpeg/blob/master/ffmpeg/JNI/config-ffmpeg.sh

JJD2K commented 5 years ago

Ok, one last thing - I reported that if MXPlayer is opened via ES File Explorer or other file manager works properly and is able to load the subtitles in the folder where the video is. If used as external player in NOVA it does not see subtitles. Can you check what is causing this issue? I still want to use the NOVA even with an external player.

courville commented 5 years ago

Ok, one last thing - I reported that if MXPlayer is opened via ES File Explorer or other file manager works properly and is able to load the subtitles in the folder where the video is. If used as external player in NOVA it does not see subtitles. Can you check what is causing this issue? I still want to use the NOVA even with an external player.

https://github.com/nova-video-player/aos-AVP/issues/140

JJD2K commented 5 years ago

This happens on other 1080p files too and stutters really badly. I do not know what it is related to, but it is not related to hardware performance - also the app is not indexing any files when this happens,

courville commented 5 years ago

OK my guess at this point is that you have a file rescanning in loop and failing causing terrible performance. I need to get adb logs from your setup when it happens i.e. get a pc hooked up to your device through usb with adb debug enabled. I can send also a special apk that will increase the logs to get an idea of what is going wrong. Could we work together on setting this up?

JJD2K commented 5 years ago

I have adb working - I removed the bloat from my tv, though I do not see much performance difference as I had those already disabled. Now I just completely uninstalled them via adb. I have also enabled scan for new content on startup - maybe related, but I do not see any scan activity in the top-right corner. Only one 1 appears for a brief moment and then it hides. Also this issue may not happen even if I start the tv and run NOVA - first time for the day. Anyway...if you need logs let me know which.

courville commented 5 years ago

Good to hear that you have adb setup. In order to collect some more logs, I will enable more verbose options and sent you a special apk. Now I read something interesting in your comment: it seems that you state that fresh install works or when tv is freshly rebooted but situation degrades after a while. Worth investigating too.

JJD2K commented 5 years ago

No I wrote that it is not deterministic - even if I have freshly started NOVA (no tv reboot - just wake from sleep) , it may work ok.

JJD2K commented 5 years ago

New update seems to play smoother - don't know if you changed something. Codec: MPEG-H Part2/HEVC (H.265) (hevc) - no hardware decoding still - I posted it as separate issue.

Btw I updated my T95Q and both KODI and MX play fine ALL 4K- Even very heavy files. KODI stays below 50% CPU on 4k video. Even manages to go under 10% at times. Nova still stutters even on that powerful S905X2 Amlogic CPU on most files. Do not know why that is.

courville commented 5 years ago

The issue with nova is not a decoding performance issue. It has been identified as an audio buffer management/size producer/consumer problem. It is not yet resolved. Since the video playback is dictated by audio, if this is not well handled it causes the issues you are experiencing. The audiotrack problem can be solved (i.e. not using passthrough), passthrough is another story.

JJD2K commented 5 years ago

Yes that is very likely as if I enable passthrough on videos that it supports (passthrough) the video gets smooth. (On some videos it works on mode2) Even on videos where there is no sound the video plays smooth too. Hope you can address this soon.

P.S. I do not see the stutter in this new release, but it does not happen always anyway so can not confirm yet.

JJD2K commented 5 years ago

Stutter on FHD maybe not related to audio - latest releases are very bad - so annoying that I switch to MXPlayer as I forget about this issue and start NOVA usually. Very noticeable if camera moving or people walking. Please check. Issue present on 99% of files.

Thank you.

courville commented 5 years ago

Stutter on FHD maybe not related to audio - latest releases are very bad - so annoying that I switch to MXPlayer as I forget about this issue and start NOVA usually. Very noticeable if camera moving or people walking. Please check. Issue present on 99% of files.

Have you activated adaptive frame rate? If not, then you will drop frames because refresh rate of your TV is not a multiple of the video frame rate which might cause this visual effect you describe.

JJD2K commented 5 years ago

Yes I have tried everything - this was not like that before. And it is not a performance issue.

courville commented 5 years ago

Yes I have tried everything - this was not like that before. And it is not a performance issue.

What you describe is exactly not a performance issue and a misalignment between frame rate and refresh rate. But if you have tried everything this is not it obviously.

courville commented 4 years ago

Closing the issue based on latest modifications https://github.com/nova-video-player/aos-avos/commit/0f265912723c672b37848696363b4dfa9eeca415 and https://github.com/nova-video-player/aos-avos/commit/c12725a8e3105c8d6069af6e6041dad3117f9c9e that should help with HEVC playback on MTK based devices. These modifications are available on latest beta on Google Play. I propose to open a specific new issue to track any problem that are appearing starting v4.14.