Hi,
my following code which triggered ffmpeg.exe to encode a video out of an image sequence does not work anymore, it works in Unity2017 but not in Unity2018 anymore:
public void EncodeMovieWithFFMPEG() {
var process = new Process();
try {
Debug.Log("Rendere Film: " + MovieFolder + "\\" + MovieName + ".mp4");
var sb = new StringBuilder();
process.StartInfo.FileName = Path.Combine(Application.streamingAssetsPath, "ffmpeg.exe");
process.StartInfo.Arguments = "-start_number 1 -framerate 25 -i " + DefaultMovieFrameFolder + "/%1d.png -c:v libx264 -pix_fmt yuv420p -crf 20 " + MovieFolder + "\\" + MovieName + ".mp4";
process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
process.WaitForInputIdle();
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.OutputDataReceived += (sender, args) => sb.AppendLine(args.Data);
process.ErrorDataReceived += (sender, args) => sb.AppendLine(args.Data);
process.StartInfo.UseShellExecute = false;
process.Start();
process.BeginOutputReadLine();
process.BeginErrorReadLine();
process.WaitForExit();
ClearFolder();
Debug.Log(sb.ToString());
} catch (Exception e) {
UnityEngine.Debug.LogError("Unable to launch ffmpeg: " + e.Message);
}
}
I get this error:
Unable to launch ffmpeg: No process is associated with this object.
Any idea?
Thanks very much!