GithubHelp home page GithubHelp logo

Question: Video HW Decoder about libnx HOT 9 CLOSED

proconsule avatar proconsule commented on June 15, 2024 8
Question: Video HW Decoder

from libnx.

Comments (9)

benwa avatar benwa commented on June 15, 2024 7

I've started a bounty for this to be implemented.
https://app.bountysource.com/issues/116504826-question-video-hw-decoder

from libnx.

averne avatar averne commented on June 15, 2024 1

I've released a FFmpeg fork enabling acceleration for all codecs supported by the hardware. I don't feel this really belongs in libnx, as most of it is not specific to the Switch/Horizon OS.
https://github.com/averne/FFmpeg/tree/tx1

from libnx.

averne avatar averne commented on June 15, 2024 1

I have to try this out on NXMP replacing the ffmpeg in use.

Thanks for this great result

You can contact me on discord @avhe if you run into issues.

Basic integration isn't hard, but for optimal performance you would need a deko3d graphics backend for mpv. In OpenGL, you are unable to directly import frames from the decoder, so the following happens:
decoder output (block linear) -> copied to staging buffer (pitch linear) using VIC -> copied to GPU texture (block linear) using GPU copy engine.

With deko3d, you just need to create a texture with DkImageFlags_UsageVideo over the frame data.

from libnx.

MRiCEQB avatar MRiCEQB commented on June 15, 2024

Any update on this?

from libnx.

Palidino avatar Palidino commented on June 15, 2024

Any plans for this ever?

from libnx.

benwa avatar benwa commented on June 15, 2024

I agree that this shouldn't be in libnx. @proconsule, can you close this so I can award @averne the bounty?

from libnx.

proconsule avatar proconsule commented on June 15, 2024

I have to try this out on NXMP replacing the ffmpeg in use.

Thanks for this great result

from libnx.

WinterMute avatar WinterMute commented on June 15, 2024

I've released a FFmpeg fork enabling acceleration for all codecs supported by the hardware. I don't feel this really belongs in libnx, as most of it is not specific to the Switch/Horizon OS. https://github.com/averne/FFmpeg/tree/tx1

Would be awesome if you got this upstreamed to FFmpeg but also PR'd needed changes to dkP packages repo. I've put a quick test @ https://github.com/devkitPro/pacman-packages/tree/ffmpeg-update but I'm not 100% what configure options we need.

fwiw, that package can be installed using [sudo] [dkp-]pacman -U https://pkg.devkitpro.org/packages/switch-ffmpeg-6.0-1-any.pkg.tar.zst if anyone wants to test.

from libnx.

averne avatar averne commented on June 15, 2024

Would be awesome if you got this upstreamed to FFmpeg

I contacted the FFmpeg maintainers, not sure it could be upstreamed in its current state as it contains nvidia headers (even though they are under a permissive license). There are also a number of hacks, especially surface alignment, that would need some cleaning up.

I'm not 100% what configure options we need.

At minimum, you need to add --enable-gpl since the hwaccel is gated by this. I used the following flags, but I see the devkitPro package has some others. I'll merge those flags and put together a proper PR.

--cc=aarch64-none-elf-gcc --cxx=aarch64-none-elf-g++ --ar=aarch64-none-elf-ar --nm=aarch64-none-elf-nm --extra-cflags='-isystem /opt/devkitpro/libnx/include' --enable-asm --enable-gpl --enable-tx1 --enable-static --disable-shared --enable-zlib --enable-bzlib --enable-libass --enable-libfreetype --enable-libfribidi --disable-doc --disable-programs --target-os=horizon --enable-cross-compile --cross-prefix=aarch64-none-elf- --arch=aarch64 --cpu=cortex-a57 --enable-neon --enable-pic --disable-autodetect --disable-runtime-cpudetect --disable-debug

from libnx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.