2017-09-15 2 views

답변

0

사용 방법에 따라 다릅니다. Unity3D 또는 Unreal을 사용하고 있다면 가능합니다.

예를 들어, 단일화는 RenderTexture입니다. rendertexture 만들려면 다음 자습서를 확인하십시오

https://www.youtube.com/watch?v=pA7ZC8owaeo

실행하는 스크립트를하고 업데이트 루프에서 다음 코드를 사용 : 위의 코드는 here

에서 차용 된

int i = 0; // in Start() 

int width = Screen.width; 
int height = Screen.height; 
Texture2D tex = new Texture2D(width, height, TextureFormat.RGB24, false); 

// Read screen contents into the texture 
tex.ReadPixels(new Rect(0, 0, width, height), 0, 0); 
tex.Apply(); 

// Encode texture into PNG 
byte[] bytes = tex.EncodeToPNG(); 
File.WriteAllBytes(Application.dataPath + "/../pic" + i + ".png", bytes); 
i++; 

이제 ffmpeg를 사용하여 다음 명령을 사용하여 해당 PNG 파일을 MP4 파일로 변환 할 수 있습니다.

ffmpeg -r 60 -f image2 -s 1920x1080 -i pic%04d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p test.mp4 

희망이 도움이됩니다.

관련 문제