{"id":17980948,"url":"https://github.com/nvidia/gmat","last_synced_at":"2025-05-11T17:52:41.980Z","repository":{"id":44490109,"uuid":"465077362","full_name":"NVIDIA/GMAT","owner":"NVIDIA","description":"A toolkit showing GPU's all-round capability in video processing","archived":false,"fork":false,"pushed_at":"2023-08-07T12:02:51.000Z","size":30462,"stargazers_count":187,"open_issues_count":3,"forks_count":41,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-10T16:56:28.431Z","etag":null,"topics":["codec","cpp","cuda","deep-learning","ffmpeg","gpu","image-processing","nvidia","video","video-codec"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NVIDIA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-03-01T22:30:37.000Z","updated_at":"2025-05-06T09:55:05.000Z","dependencies_parsed_at":"2022-07-16T02:17:59.483Z","dependency_job_id":null,"html_url":"https://github.com/NVIDIA/GMAT","commit_stats":null,"previous_names":["nvidia/gmat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA%2FGMAT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA%2FGMAT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA%2FGMAT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA%2FGMAT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NVIDIA","download_url":"https://codeload.github.com/NVIDIA/GMAT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253450206,"owners_count":21910511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codec","cpp","cuda","deep-learning","ffmpeg","gpu","image-processing","nvidia","video","video-codec"],"created_at":"2024-10-29T18:07:02.028Z","updated_at":"2025-05-10T16:56:39.682Z","avatar_url":"https://github.com/NVIDIA.png","language":"C","readme":"[![License](https://img.shields.io/badge/License-MIT-yellogreen.svg)](https://opensource.org/licenses/Apache-2.0)\n\n![Platform](https://img.shields.io/badge/Platform-linux--64-gray)\n\nGPU toolkit on Multimedia, AI and Transcoding (GMAT)\n=============================================\nGMAT is a collection of tools for accelerating video/image processing and transcoding using GPUs in datacenter.\n\n### Upgrade ffmpeg-gpu-demo to GMAT\nFor those who have known this repo as ffmpeg-gpu-demo, you can still find the demo pipelines in the [ffmpeg-gpu-demo branch](https://github.com/NVIDIA/FFmpeg-GPU-Demo/tree/ffmpeg-gpu-demo). GMAT is developed based on ffmpeg-gpu-demo, and features like tensorrt filter are kept in GMAT. We have been listening and gathering feedback from the industry during the past year, and developed tools that users told us useful but missing in GPU video processing. We organized these tools together and hence the new GMAT, hope you can find what you need here : )\n\n## Features\n* [ffmpeg-gpu](): GPU-enhanced ffmpeg\n    * GPU filters: crop, rotate, flip, smooth, tensorrt\n    * libgpuscale: GPU accelerated libswscale, providing rgb\u003c-\u003eyuv conversion and scaling on GPU\n    * CUDA Runtime API support\n* [MeTrans SDK](): GPU transcoding toolkit\n    * GPU codec tools: Programs to access and benchmark nvdec/nvenc/nvjpeg\n    * Smart decoding: Decode video frames at uniform intervals, or decode frames with scene cut detection.\n    * HEIF codec: HEIF image encoding/decoding accelerated by nvenc/nvdec\n\nIt should be noted that GMAT does not aim to provide a complete set of APIs for GPU video processing, there are a lot of great libraries/SDKs doing that already. Instead, our target is to solve the missing puzzle pieces. It's intented to use GMAT along with other libraries/SDKs you have been using in your current pipeline or solution. You can carve out whatever you need and integrate it into your project.\n\n### Feedbacks are welcome!\nIf you want to do something using GPU but can't find it in GMAT or elsewhere, you are welcome to submit an issue or even better, a PR, we would be happy to look into it.\n\n## Getting Started\nCurrently, ffmpeg-gpu and MeTrans need to be compiled separately.\n\n### Compile ffmpeg-gpu\nffmpeg-gpu has the following dependencies:\n- CUDA Toolkit \u003e= 11.0\n- TensorRT \u003e= 8.2 (Optional)\n- CV-CUDA \u003e= 0.3.0 (Optional)\n\nWe strongly recommend you to start with the [NGC containers](https://catalog.ngc.nvidia.com/containers). If you would like to use the tensorrt filter, choose the [tensorrt image](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/tensorrt); If you do not care for the tensorrt filter, the [CUDA image](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda) will do. Note that for CUDA images, tags including `devel` are required since we need NVCC and CUDA header files, which are not included in `base` or `runtime` images.\n\n```Bash\n# use CUDA image\ndocker run --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all -it --rm -v $(pwd):/gmat nvcr.io/nvidia/cuda:12.2.0-devel-ubuntu20.04 bash\n\n# use TensorRT image\ndocker run --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all -it --rm -v $(pwd):/gmat nvcr.io/nvidia/tensorrt:23.07-py3 bash\n```\n\nOnce inside the container, you can install CV-CUDA. Please refer to [CV-CUDA's GitHub repo](https://github.com/CVCUDA/CV-CUDA/tree/v0.3.0-beta) for more details on installation.\n```Bash\nwget https://github.com/CVCUDA/CV-CUDA/releases/download/v0.3.1-beta/nvcv-lib-0.3.1_beta-cuda12-x86_64-linux.deb\nwget https://github.com/CVCUDA/CV-CUDA/releases/download/v0.3.1-beta/nvcv-dev-0.3.1_beta-cuda12-x86_64-linux.deb\n\nsudo apt install ./nvcv-lib-0.3.1_beta-cuda12-x86_64-linux.deb ./nvcv-dev-0.3.1_beta-cuda12-x86_64-linux.deb\n```\n\nLike compiling the original ffmpeg, we need to configure ffmpeg before running make.\n```Bash\ncd gmat/ffmpeg-gpu\n./configure --disable-ptx-compression --enable-cvcuda --enable-libtensorrt --extra-cflags=-I/opt/nvidia/cvcuda0/include/ --disable-static --enable-shared --enable-nonfree --enable-cuda-nvcc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --nvccflags='-gencode arch=compute_86,code=sm_86 -I./' --extra-libs=-lstdc++\nmake -j10\n```\n\nThe TensorRT filter is enabled by the `--enable-libtensorrt` option. Remember to change the `--nvccflags` option to match your GPU arch. E.g. `arch=compute_86,code=sm_86` is for Ampere GPUs except A100. If you are using L4 (Ada), you should change it to `arch=compute_89,code=sm_89`. FFmpeg does not support PTX JIT at this moment, CUDA will report `no kernel image available` if you don't get the arch correct.\n\n### Compile MeTrans SDK\nMeTranshas the following dependencies:\n- CUDA Toolkit\n- ffmpeg-gpu\n- HEIF (Optional)\n\n(Optional) If you need HEIF codec, you need to install [HEIF reader/writer](https://github.com/nokiatech/heif) before compiling MeTrans:\n```Bash\ngit clone https://github.com/nokiatech/heif.git\ncd heif/build\ncmake ../srcs\nmake -j10\nsudo mkdir /usr/local/include/heif\nsudo cp -r ../srcs/api/* /usr/local/include/heif\nsudo cp ./lib/*.so /usr/local/lib\n```\n\nMeTrans does not require ffmpeg-gpu to be built with cvcuda or tensorrt, so we can use the CUDA image:\n```Bash\ndocker run --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all -it --rm -v $(pwd):/gmat nvcr.io/nvidia/cuda:12.2.0-devel-ubuntu20.04 bash\n\n# build and install ffmpeg-gpu\ncd gmat/ffmpeg-gpu\n./configure --disable-ptx-compression --disable-static --enable-shared --enable-nonfree --enable-cuda-nvcc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --nvccflags='-gencode arch=compute_86,code=sm_86 -I./' --extra-libs=-lstdc++\nmake -j10\nsudo make install\n\ncd ../metrans\nmake -j10\n# make all_but_gl -j10\n```\nThe compiled binaries are located in `metrans/build`.\n\nIf you need HEIF codec, run `make all_but_gl -j10` instead of `make -j10`. If you also need the `AppNvDecGL` sample which demonstrates how to display decoded video frames in OpenGL using CUDA OpenGL interoperation, run `make all -j10`. Note that `AppNvDecGL` requires OpenGL to be setup properly, it is recommended to run the sample on a local machine, as setup display on a remote environment can be tricky.\n\n## License\n\nFFmpeg GPU Demo is under MIT license, check out the [LICENSE](LICENSE.md) for details.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvidia%2Fgmat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvidia%2Fgmat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvidia%2Fgmat/lists"}