유니티엔진에서 Kinect를 이용해서 띄운 RGB 영상을 녹화하고 싶습니다.

조회수 1941회

유니티엔진에서 키넥트카메라를 이용해서 띄운 RGB 영상을 녹화하고 싶습니다.

openCV를 이용해서 녹화후 저장하고 불러오는 방법이 있을까요??

  • (•́ ✖ •̀)
    알 수 없는 사용자
  • XBOX 게임을 개발하시는건가요? 어떤 환경에서 개발하시는건지, 더 자세한 설명이 필요합니다. 정토드 2016.5.13 11:30
  • 게임을 개발하는 것이 아니고 스마트헬스 프로젝트를 진행하면서 유니티와 키넥트를 이용해서 사용자의 움직임을 녹화하는 부분을 개발하는것 입니다. 언어는 C#을 사용하고 싶습니다. 알 수 없는 사용자 2016.5.13 13:41

1 답변

  • (openCV는 뭔지 잘 모릅니다) 꼭 유니티상에서 녹화하시려면 Application.CaptureScreenshot을 이용하는 방법이 있기는 합니다. 아래 코드와 같이 매 프레임마다 화면 캡쳐를 하고 나중에 이걸 조합하는 방법입니다. 출처

    using UnityEngine;
    using System.Collections;
    using System.IO;
    
    public class ScreenRecorder : MonoBehaviour {
    
        public int maxFrames; //amount of frames you want to record before closing the game
    
        int shotCount;
    
        void Awake () {
            Application.targetFrameRate = 1; //forces frame rate to 1
            if (!System.IO.Directory.Exists("Screenshots")) //check if "Screenshots" folder exists
            {
                System.IO.Directory.CreateDirectory(Application.dataPath + "/Screenshots");
            }
        }
    
        void Update () {
            if (shotCount <= maxFrames) //we don't want to include the first frame since it's a mess
            {
                Application.CaptureScreenshot(Application.dataPath + "/Screenshots/" + "shot" + shotCount + ".png");
                shotCount += 1;
            }
            else //keep making screenshots until it reaches the max frame amount
            {
                StopRecording(); //quit game
            }
        }
    
        public void StopRecording() //you can call this function for different reasons (e.g camera animation stops)
        {
            Application.Quit();
        }
    }
    

    하지만 유니티에서 이걸 인코딩까지 실시간으로 하는건 대부분의 경우 성능상 무리입니다. iOS나 Android에서 실시간 인코딩까지 지원하는 서비스(everyplay)들은 대부분 Native Plugin을 이용해서 각 플랫폼에 맞는 별도 코드를 사용합니다. 녹화한 다음에 그걸 바로 영상으로 업로드 하는 기능이 필요하시면 XBOX에서 제공하는 Native API를 알아보시는게 빠를것 같네요.

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)