aliubimov / xbmc

Kodi is an award-winning free and open source home theater/media center software and entertainment hub for digital media. With its beautiful interface and powerful skinning engine, it's available for Android, BSD, Linux, macOS, iOS and Windows.
https://kodi.tv/
Other
7 stars 2 forks source link

Get away from v4l2 stuff, and switch to ffmpeg nvv4l2 tegra stuff...... #13

Open GavinDarkglider opened 2 years ago

GavinDarkglider commented 2 years ago

Roadmap or todo item

Detailed Description Basically nix the tegra decoder code in kodi for the most part, and use the pretty much perfect ffmpeg decoder switchroot developer CTCaer has been working on, which increases decoder performance at 1080p by 70%. Currently in moonlight we are getting a 2-4 milisecond lag, and that is on a network stream at 1080p.

Context

In general, it is better to fix minor issues, than implement a huge code change to add a feature that has pretty much been perfected somewhere else, and has been tested.

Possible Implementation

Use the patches from this ffmpeg, and it will force proper decoders in kodi. https://gitlab.com/switchroot/switch-l4t-multimedia/FFmpeg This still needs some sort of timestamp fix in kodi to fix issues with hle streams with where video is split. It should be noted here that all patchsets are designed to force tegra decoders, so do not merge this in upstream kodi ffmpeg, or it will break things.

This is easy to revert, you just need to reorder the codecs below software versions. and remove some hacks in ffmpeg/ffplay stuff.

Here is a libreelec build, using this implementation for the Switch. I dont have any jetson boards currently, so this is what I have available. https://nightly.builds.lakka.tv/members/gavin/70_percent_faster_decoder_encoder/LibreELEC-Switch.aarch64-10.0-devel-20220301001124-ac865eb.tar

Additional context, screenshots or links

Here are some relevant links or screenshots

Here is the bug report I made in kodi upstream using these patches. https://github.com/xbmc/xbmc/issues/21022 Here are the patches for kodi matrix ffmpeg 4.3.2 version. https://github.com/GavinDarkglider/Lakka-LibreELEC/tree/Final_decoder_encoder/packages/multimedia/ffmpeg/patches/L4T

I need to squash them into 1 patch file at some point, but this is still in development.

Note: Team Kodi is considering this item, but we are not making any promises if and when it will be included.