It’s quite handy to be able to render a video on to spatial objects
It’s quite handy to be able to render a video on to spatial objects
When I wanted to play video and render them inside D3D12 scenes, I have used a higher-level one, IMFMediaEngine https://learn.microsoft.com/en-us/windows/win32/api/mfmediae...
That OS-supplied high-level video player object can demux containers, decode, play audio, and copy uncompressed frames to D3D11 textures. Then, it’s relatively easy to use DXGI surface sharing API to share the resulting RGBA8 frames from D3D11 into D3D12.
For instance, with VAAPI->OpenGL you would use vaExportSurfaceHandle in conjunction with glEGLImageTargetTexture2DOES.
Check out the "hwdec" mechanism in MPV:
https://github.com/mpv-player/mpv/blob/master/video/out/hwde...
https://github.com/mpv-player/mpv/blob/master/video/out/hwde...
Edit: missed the part about JS ecosystem. You can move DRM prime descriptors between processes, but I assume you can’t do this from the ffmpeg CLI and would need to write your own little C wrapper around libavcodec