A utility python library to display video files in OpenGL textures and record openGL textures into video files. The library can optionnaly perform GPUdecode->openGL->GPUencode without copying data to the CPU (which is its main interest).
The library supports two backends (PyAV and Vali), at least one must be installed.
- PyopenGL
- PyAV (at least version 17 is required dor dlpack support)
For hardware decode/encode and direct GPU<->GL tansfer, you will need the following
- Vali (optionnal, depends on the backend)
- pycuda compiled with openGL support (the distributed versions on conda and pip do not have GL support)
- dlpack
For the demo program:
- moderngl and moderngl-window
- imgui (either pyimgui or imgui-bundle)
Just drop pyglvideo folder in your repo. running the test program requires to set the environment variable "TEST_VIDEO_FILE" to the path of a valid video/image.
- The file moderngl_window_integrations_imgui_bundle.py is a pending pull release for compatibility between moderngl-window and imgui-bundle.
- Using direct gpu<->gl transfers becomes interesting for hi res videos (4k and more). Don't expect major speed improvements with low resolution videos
- Consider the library as beta software
- When using full hardware pipelines, vali and av backends achieve comparable speed. In my experience, VALI is slower when decoding multiple streams at the same time.
- Provide CudaBridgeRGB for transfering RGB(a) textures to cuda.