From 12835af1be4115d630b719c4a5dbc93b39d7b187 Mon Sep 17 00:00:00 2001 From: Jeff Bail Date: Wed, 25 Oct 2017 12:06:18 -0400 Subject: [PATCH 1/2] Return & log errors from Initialize() --- Assets/FFMpegUtils/FFMpegYUV4Texture.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Assets/FFMpegUtils/FFMpegYUV4Texture.cs b/Assets/FFMpegUtils/FFMpegYUV4Texture.cs index 129df6b..4c2fc6b 100644 --- a/Assets/FFMpegUtils/FFMpegYUV4Texture.cs +++ b/Assets/FFMpegUtils/FFMpegYUV4Texture.cs @@ -78,22 +78,29 @@ void OnEnable() // Creates a YUVReader and FFMpegLauncher to start playback. // If Source is specified in the Inspector, OnEnable will call Initialize and playback will // start immediately. Otherwise it can be called manually to start playback on command. - public void Initialize(string Source) + public bool Initialize(string Source) { m_yuvReader = new YUVReader(); // launch + if (Environment.GetEnvironmentVariable(KEY) == null) + { + Debug.LogWarning("FFMPEG_DIR environment variable not set"); + return false; + } var exec = Path.Combine(Environment.GetEnvironmentVariable(KEY), EXE); m_ffmpeg = FFMpegLauncher.Launch(exec, Source); if (m_ffmpeg == null) { Debug.LogWarning("fail to launch ffmpeg"); - return; + return false; } m_stdOutDisposable = m_ffmpeg.StdOut.BeginRead(new Byte[8192], (b, c) => m_yuvReader.Push(new ArraySegment(b, 0, c))); m_stdErrDisposable = m_ffmpeg.StdErr.BeginRead(new Byte[1024], (b, c) => OnRead(m_error, b, c)); + + return true; } // Allow the Material to be accessed so it can be assigned to geometry at runtime From 3c05f0d4b202005c23d3daef4962f9b4771045ea Mon Sep 17 00:00:00 2001 From: Jeff Bail Date: Wed, 25 Oct 2017 12:09:38 -0400 Subject: [PATCH 2/2] Updated & tested with Unity 2017.2.0f3 --- ProjectSettings/DynamicsManager.asset | 1 + ProjectSettings/Physics2DSettings.asset | 1 + ProjectSettings/ProjectVersion.txt | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ProjectSettings/DynamicsManager.asset b/ProjectSettings/DynamicsManager.asset index 1931946..0be3d78 100644 --- a/ProjectSettings/DynamicsManager.asset +++ b/ProjectSettings/DynamicsManager.asset @@ -17,3 +17,4 @@ PhysicsManager: m_EnablePCM: 1 m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_AutoSimulation: 1 + m_AutoSyncTransforms: 1 diff --git a/ProjectSettings/Physics2DSettings.asset b/ProjectSettings/Physics2DSettings.asset index e3b2d0b..132ee6b 100644 --- a/ProjectSettings/Physics2DSettings.asset +++ b/ProjectSettings/Physics2DSettings.asset @@ -24,6 +24,7 @@ Physics2DSettings: m_QueriesStartInColliders: 1 m_ChangeStopsCallbacks: 0 m_CallbacksOnDisable: 1 + m_AutoSyncTransforms: 1 m_AlwaysShowColliders: 0 m_ShowColliderSleep: 1 m_ShowColliderContacts: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index a211ccd..7a6fffb 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2017.1.1f1 +m_EditorVersion: 2017.2.0f3