티스토리 뷰

Unity

GPU Video Player

빵원군 2020. 1. 9. 10:47

얼마전 Unity에서 Video Player를 통해 고용량의 비디오 클립을 재생하는데 버벅거림이 발생하였다.

 

3분 35초 동영상인데 2.6 GB...

 

CPU Decoding 중... 이 PC는 i9-9900K이다. 이것보다 저사양 PC에서 테스트할때 버벅거림(CPU사용량 70~100%)이 발생하였다.

해결방법은 GPU Decoding 방식으로 변경하면 CPU 사용량을 급격히 줄일수 있다.

GPU Decoding.. 이 PC는 RTX 2080 Ti 

 

GPU Decoding 관련 자료는 

https://software.intel.com/en-us/articles/hardware-accelerated-video-decode-in-unity

 

Hardware-Accelerated Video Decode in Unity*

This tutorial teachs you how to merge the hardware decode path within Unity* software. The main components within this solution are the creation of an external video texture mapped to Unity software, the creation of the media player, and the calls exposed

software.intel.com

 

Plugin 소스와 사용예제를 다운받을수 있다.

 

예제를 조금만 다듬으면 개발중인 프로젝트에서도 바로 사용할 수 있다.

예제를 다운받고 Playback.cs 를 보면 OnEnable 함수에 자기에 부착되어 있은 Renderer의 Material 에 부착하는데..

이런식으로 수정해서 다른 Material에 부착도 할 수 있다

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG more
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
글 보관함