Quantcast
Channel: Questions in topic: "webcam"
Viewing all articles
Browse latest Browse all 256

Converting Texture2D into a video

$
0
0
Hello, I've did a lot of research, but I can't find a suitable solution for my application. I'm using a Fove-HMD and would like to record/make a video of the integrated camera. So far I managed to take a snapshot every update of the camera, but I can't find a way to merge this snapshots into a video. Does someone know a way of converting them? Or can someone point me in the right direction, in which I could continue my research? public class FoveCamera : SingletonBase { private bool camAvailable; private WebCamTexture foveCamera; private List snapshots; void Start () { //-------------just checking if webcam is available WebCamDevice[] devices = WebCamTexture.devices; if (devices.Length == 0) { Debug.LogError("FoveCamera could not be found."); camAvailable = false; return; } foreach (WebCamDevice device in devices) { if (device.name.Equals("FOVE Eyes")) foveCamera = new WebCamTexture(device.name);//screen.width and screen.height } if (foveCamera == null) { Debug.LogError("FoveCamera could not be found."); return; } //-------------camera found, start with the video foveCamera.Play(); camAvailable = true; } void Update () { if (!camAvailable) { return; } //loading snap from camera Texture2D snap = new Texture2D(foveCamera.width,foveCamera.height); snap.SetPixels(foveCamera.GetPixels()); snapshots.Add(snap); } } The code works so far. The first part of the Start-Method is just for finding and enabling the camera. In the Update-Method I'm taking every update a snapshot of the video. After I "stop" the Update-Method, I would like to convert the gathered Texture2D object into a video. Thanks in advance

Viewing all articles
Browse latest Browse all 256

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>