void ReceiveStream() { // var opt = " -i http://123.176.34.172:8090/" + (SkypeManager.Instance.isCaller ? "test2.mpg" : "test1.mpg") + "-g 60 -map 0 -vcodec rawvideo -f segment -reset_timestamps 1 -segment_format rawvideo -pix_fmt rgb24 " + Application.persistentDataPath // + "/out%03d.seg"; // string opt = "-y -i http://13.126.154.86:8090/" + (SkypeManager.Instance.isCaller ? "test2.mpg" : "test1.mpg") + " -f segment -segment_time 2 -reset_timestamps 1 -vcodec libx264 -b 465k -pix_fmt yuv420p -profile:v baseline -preset ultrafast " + path; string opt = "-y -i rtsp://13.126.154.86:5454/" + (SkypeManager.Instance.isCaller ? "caller.mpeg4" : "caller.mpeg4") + " -f image2pipe -vcodec mjpeg -"; // string opt = "-nostdin -y -i http://13.126.154.86:8090/callerAudio.mp3 -f s16le -acodec pcm_s16le -"; print(opt); ProcessStartInfo info = new ProcessStartInfo(ffmpegPath, opt); info.UseShellExecute = false; info.CreateNoWindow = true; info.RedirectStandardInput = false; info.RedirectStandardOutput = true; info.RedirectStandardError = false; receiveProcess = new Process(); receiveProcess.StartInfo = info; receiveProcess.EnableRaisingEvents = true; receiveProcess.Exited += new EventHandler(ProcessExited); receiveProcess.Disposed += new EventHandler(ProcessDisposed); receiveProcess.OutputDataReceived += new DataReceivedEventHandler(ProcessOutputDataReceived); receiveProcess.ErrorDataReceived += new DataReceivedEventHandler(ErrorDataReceived); receiveProcess.Start(); streamReceiver = new StreamReceiver(receiveProcess.StandardOutput, receiverImage, textureSize); streamReceiver.StartReceivingStream(); soundStreamReceiver = new SoundStreamReceiver(); soundStreamReceiver.StartReceivingAudio(); }