Beispiel #1
0
        void ClosePipe()
        {
            var camera = GetComponent <Camera>();

            // Destroy the blitter object.
            if (_tempBlitter != null)
            {
                Destroy(_tempBlitter);
                _tempBlitter = null;
            }

            // Release the temporary render target.
            if (_tempTarget != null && _tempTarget == camera.targetTexture)
            {
                camera.targetTexture = null;
                RenderTexture.ReleaseTemporary(_tempTarget);
                _tempTarget = null;
            }
            // Close the output stream.
            if (_pipe == null)
            {
                return;
            }
            Debug.Log("Capture ended (" + _pipe.Filename + ").");
            // Write pupil timestamps to a file
            var timeStampFileName  = "Unity_" + PupilManager.Instance.Settings.currentCamera.name;
            var timeStampByteArray = timeStampList.ToArray();

            File.WriteAllBytes(_pipe.FilePath + "/" + timeStampFileName + ".time", timeStampByteArray);

            PupilController.SaveRecording(_pipe.FilePath);
            _pipe.Close();
            if (!string.IsNullOrEmpty(_pipe.Error))
            {
                Debug.LogWarning(
                    "ffmpeg returned with a warning or an error message. " +
                    "See the following lines for details:\n" + _pipe.Error
                    );
            }
            _pipe = null;
        }
Beispiel #2
0
 void Start()
 {
     _material = new Material(Shader.Find("Hidden/FFmpegOut/CameraCapture"));
     PupilController.StartRecording();
 }
Beispiel #3
0
 public void Stop()
 {
     PupilRecorder.isRecording = false;
     PupilController.StopRecording();
     _recorderState = RecorderState.PROCESSING;
 }