GStreamerUnityHardwareDecoding
Using GStreamer to view UDP/RTS stream, decoded on the GPU using DX11.
Install / Use
/learn @stuw-u/GStreamerUnityHardwareDecodingREADME
GStreamerUnityHardwareDecoding
Decode UDP video streams using hardware decoding with DX11, using a native plugin GStreamer application.
Setup
- Install GStreamer. The version 1.22.6 was used in this project but any version that supports DX11 commands should work. Install MSVC 64bit version, both runtime only. I recommend doing a full install.
- Setup Path Variables for gstreamer: Windows start icon > Search "environment variables" > Edit the system environment variables > Environment Variables > System variables > Variable :Path > Edit > New > Paste "C:\gstreamer\1.0\msvc_x86_64\bin" > Ok
- This project was made on Unity 2023.2, but any version after 2020 should be supported. You don't need to include the visual studio in this project, everything you need is in the UnityProject/Plugin folder
- Add a GStreamerSingleton in the scene and a GStreamerVideoPlayer. The video resolution doesn't matter.
- You have to play around with the firewall settings to let the UPD packages throught! Google "allow UPD packets inbound in control panel".
Setup (Compiling the plugin)
- Install the MSVC development installer from the same link and version you downloaded the runtime installer.
- Setup System Variable: Windows start icon > Search "environment variables" > Edit the system environment variables > Environment Variables > System variables > New... then set "Variable name" to "GSTREAMER_1_0_ROOT_MSVC_X86_64" and "Variable value" to "C:\gstreamer\1.0\msvc_x86_64"
Limitations
- Only supports DX11
- Only supports UDP streams
- Only supports 64bit application
- Only supports hardware decoding, no CPU option.
Adding support for different graphic api should not be toooo hard. Everything that would need to be modified is the plugin itself, adding the necessary IUnityInterfaces for your graphic api, then change the texture creating/dispose function. Don't forget to modify the pipeline to also use the decoding/display keywords. Hope that helps?

Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
