Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Assets/FFMpegUtils/FFMpegYUV4Texture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<byte>(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
Expand Down
1 change: 1 addition & 0 deletions ProjectSettings/DynamicsManager.asset
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ PhysicsManager:
m_EnablePCM: 1
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation: 1
m_AutoSyncTransforms: 1
1 change: 1 addition & 0 deletions ProjectSettings/Physics2DSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
m_EditorVersion: 2017.1.1f1
m_EditorVersion: 2017.2.0f3