nova-video-player / aos-AVP

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

Use Exoplayer to improve playback and compatibility? #401

Open Pentaphon opened 3 years ago

Pentaphon commented 3 years ago

It may be worth looking into using Exoplayer (or the Amazon fork of Exoplayer) to solve many of the existing playback issues and to improve compatibility with Dolby Vision, etc.

It seems every commercial Android TV app is using Exoplayer in some form these days so it may be in the project's best interests to follow suit and rely on Exoplayer for playback.

courville commented 3 years ago

Yes this is being considered https://github.com/nova-video-player/ExoPlayer and https://github.com/nova-video-player/aos-Video/tree/dev/exoplayer but do not expect it anytime soon. It is quite some work and there are a lot of codecs/containers missing from exoplayer. It needs to be replugged to ffmpeg etc... There have been some attempts but nothing turnkey.

Pentaphon commented 3 years ago

do not expect it anytime soon. It is quite some work and there are a lot of codecs/containers missing from exoplayer.

That's fine and expected. I just wanted to get an official response whether it was being considered so myself and others would know for sure . Also, this issue would be good for tracking the progress of such an enormous undertaking. Thanks for letting us know. I think moving to Exoplayer is the only reasonable way forward for an Android-only player, and gives the project a massive advantage over other projects such as Kodi and VLC.

Pentaphon commented 3 years ago

Here is a promising new app based on Exoplayer if you guys want to see an existing project that plays video well.

https://github.com/moneytoo/Player

lars18th commented 3 years ago

Hi,

Regarding the "upgrade" to Exoplayer, I want to know if this change will remove any current functionality. For instance, I use some container formats not supported by ExoPlayer. So the question is: You will provide support of these formats? Or if not, you will continue providing a version with the current player?

I hope almost you continue providing a version with the "current" player. Regards.

Pentaphon commented 3 years ago

Regarding the "upgrade" to Exoplayer

The dev has stated that you will be able to toggle between Exoplayer and ffmpeg which is the best solution for everybody. He is well aware that Exoplayer has format limitations along with the benefits. With time, Exoplayer's limitations will fade away as more features are added to Exoplayer and certain formats become less and less used, but I expect the dev to continue supporting both Exoplayer and ffmpeg so we can always play what we want.

moneytoo commented 3 years ago

Seems like ExoPlayer is moving into AndroidX Media:

ExoPlayer was previously hosted in a separate ExoPlayer GitHub project. In AndroidX Media its package name is androidx.media3.exoplayer. We plan to continue to maintain and release the ExoPlayer GitHub project for a while to give apps time to migrate.

Pentaphon commented 2 years ago

Seems like ExoPlayer is moving into AndroidX Media:

Looks like a good reason to for this enhancement to take a little longer until that move is complete.

courville commented 2 years ago

I guess that we will need modifications on the stock exoplayer to enable more use cases that the one captured by the default androidx media one. Let's see how we handle that once v6.x is out (jan target).

Pentaphon commented 2 years ago

https://github.com/moneytoo/Player/releases/tag/v0.98 has recently gotten AVI container support, This is a very exciting development for all Exoplayer development going forward as it moves into Android X media.

Pentaphon commented 2 years ago

As an update, for anybody following this: AndroidX Media is in alpha status. When this project goes 1.0.0 stable, the Exoplayer project will be fully merged into AndroidX Media and cease to exist as Exoplayer. We can track the progress on this release page.

https://github.com/androidx/media/blob/release/RELEASENOTES.md

As soon as 1.0.0 goes stable, it would be a good time for Nova to begin incorporating AndroidX Media into v7.

courville commented 2 years ago

I was following progress of @moneytoo to have avi merged into exoplayer. To be honest, I am not convinced that google is very open and reactive enough for universal multimedia playback. Thus I do not have my mind set on the future external open-source library to use (exoplayer or libmpv or something else). Maintaining patches on top of exoplayer over time seems to be a sporty entertainment for which the ROI might be questionnable on my side.

Pentaphon commented 2 years ago

Maintaining patches on top of exoplayer over time seems to be a sporty entertainment for which the ROI might be questionnable on my side.

In that case, if I were you, I'd make it known on the README that switching to Exoplayer would mean users would have to report bugs to the AndroidX Media project only. Or simply close this issue and stick to what you're comfortable with while telling people to use Just Player as the external player if they want to use Exoplayer/AndroidXMedia. After all, this project is yours to decide what to do with.

Pentaphon commented 1 year ago

Thus I do not have my mind set on the future external open-source library to use (exoplayer or libmpv or something else).

@courville May I ask, which one would be harder to implement? libmpv or exoplayer/androidxmedia?

Considering that both have their own active development communities, it might be worth your time to implement one of them and let that community handle playback issues, thus freeing yourself up to work only on media-center functions.

courville commented 1 year ago

@Pentaphon, both will require significant work especially when trying to grant "universal playback" since exoplayer is lacking some parsers (justplayer does a good job at it). I agree that we could join forces on this matter. We need to settle on it with the team and not quite yet clear.

moneytoo commented 1 year ago

ExoPlayer devs state that their library is intended more as a streaming component (inside something like Youtube, Netflix or any other app in need to display a video). Local playback is there (and supported) but it's not their primary objective.

There are some "smaller" things that are missing but can be improved in the future (like bitstream of DTS HD, SSA styling, M2TS, M3U, dual layer PGS etc.).

Then there are much larger missing things. While there was amazing progress on the AVI support, it's still barely usable because of seek and sync issues. Even with working AVI container, videos with legacy formats like DivX/Xvid etc may not play because todays devices do not have such decoders.

The worst problems are those that colide with the "streaming" nature of ExoPlayer. For example ExoPlayer won't incorporate some Dolby Vision fallbacks because the profiles in question are considered deprecated (from the content providers point of view, while they are still in use on users BluRays). Also lots of media issues are closed because of "invalid media". ExoPlayer devs do not want incorporating various workarounds because they expect that video is under control by the app author. So for example some partialy downloaded files may not play for users.

Pentaphon commented 1 year ago

@moneytoo do you think Exoplayer/androidxmedia is a good long term playback solution for Nova or would you recommend that Nova go with another solution focused on playback such as libmpv?

moneytoo commented 1 year ago

@Pentaphon It's hard to say. I see ExoPlayer's power in handling stuff like HDR, audio passthrough, audio sync, buffering etc. It works great for me personaly as it handles all currently used media. So for people ripping BluRays or downloading mkv's, it will just work. On the other hand it may not be as good for anime fans (SSA styling) or people with a decades old video collection. It depends on where's the line.

Pentaphon commented 1 year ago

On the other hand it may not be as good for anime fans (SSA styling) or people with a decades old video collection. It depends on where's the line.

It sounds like libmpv is probably the better solution then, no? Since it handles all those things you mentioned. Perhaps libmpv being integrated into Nova and using your Just Player as an external player is the best practical solution in the long term.

Either way, forking ffmpeg is probably taking too much developer time on a small project with limited manpower such as Nova.

ghost commented 1 year ago

On the other hand it may not be as good for anime fans (SSA styling) or people with a decades old video collection. It depends on where's the line.

It sounds like libmpv is probably the better solution then, no? Since it handles all those things you mentioned. Perhaps libmpv being integrated into Nova and using your Just Player as an external player is the best practical solution in the long term.

Either way, forking ffmpeg is probably taking too much developer time on a small project with limited manpower such as Nova.

As a heavy user of ass subtitles I support this approach as well. I like justplayer, but there are also a lot of limitations.

Pentaphon commented 1 year ago

@courville have you looked at https://github.com/brianwernick/ExoMedia as a possible solution for implementing Exoplayer in Nova? Thought you might find it helpful for v7.

JJD2K commented 7 months ago

I did not see this thread and that is why I added #1176 @courville I understand that this is a side project and requires time, but fluent playback and passthrough are the most important things in a player. I understand that you want to support old formats, but that will keep dragging the project backwards and cause only issues and incompatibilities. You should evaluate cons and pros. Users that have old file formats are probably 1% and supporting those is not justified. Plus there is an easy solution to it. It is best for them to convert those files to newer formats - it is a one time operation - they do not keep downloading files in those formats. Plus at certain point in time no modern player will support them. Personally if I had such video library I would have converted it long ago. Imagine if vendors had to support old VHS/NTFS/PAL formats on newer TVs - noone does that and it's pointless.

If you are worried about supporting old formats you could just fork the project and rename the current one to Nova Classic and make it available for those who want to stay in the past. As @Pentaphon said and I observed too, all top players use ExoPlayer lib. Getting rid of old formats will probably simplify things a lot. Android TVs market share keeps growing and most of your users will soon use the app on a TV OS. The only alternatives to Nova are Plex and KODI.

KODI has extremely poor user interface and experience. No recently played, no recently added, no way to add movies and shows together, everything takes millions of clicks to do basic things - even pausing a video takes 2 clicks. It has its advantages and support plugins, but I doubt that common users care about those. There are so many things wrong with it that even if you waste days to configure it, there will still be things that keep annoying you.

Plex has really good UI, but it is a bit sluggish and requires a server to run which is no go for many and is useless as modern TVs do not require transcoding. Many users like me have attached an HDD to a powerful router and use it for NAS which is accessible 24/7 and does not draw extra power. My router could even run Plex server, but I think it is a dumb thing to install Plex server on a router. I will not keep a separate PC or NAS running just to use Plex.

And we are left wit NOVA. UI is fast - not as fancy as Plex, but that can be easily fixed. Does not require servers and other nonsense. User experience is great and intuitive with some small corrections that should be applied to subtitles. Parses library WAY better and faster than KODI and almost on par with Plex. (on some content NOVA downloads wrong info, but that is rare enough and can be fixed)

So if you go with ExoPlayer and fix playback and passthrough there will be no competition to NOVA.

That's my opinion. Thank you for your great project and for your development. I hope you will take the right decisions.

courville commented 7 months ago

@JJD2K your comments are correct. Note that I do not have an Android 12 AndroidTV to debug. This is indeed a project that I do on my spare time. We will have a look at the issue. You can use Just player in the meantime that is based on exoplayer.

JJD2K commented 7 months ago

@courville Your current Just Player integration with Nova is quite good - remembers playback position and reports it back to NOVA. If you could only fix the issue that it does not load the subs when launched from NOVA it will be perfect and absolutely usable alternative for the playback issues.

You could get a good Android TV for your bedroom/kitchen when you decide to upgrade. I purchased the TCL C845 because I did not want OLED because of burn-in and that TV is absolutely fantastic for its price. And those new Pentonic 700/1000 chips FLY. It is really fast and has enough memory - when I go back to NOVA it continues from the pause scene - my old Sony was restarting the app. Even Sony 2024 flagship TVs are now mini-led Android so I believe that is the right direction. The TCL with it's 2000nits has so much contrast and depth that it feels like you are looking through a window to a real 3D scene and not a TV. I do not emphasize on brightness - it looks like that even at 20-30% brightness.