Example #1
0
        private void StartPipe()
        {
            Log.Info("iPiMPWeb - StartPipes");
            if (_mediaStream != null)
            {
                Log.Info("iPiMPWeb - mediaStream isNot Null");
                encoderInput.Start(false);
                Log.Info("iPiMPWeb - encoderInput started");
                if (encCfg.outputMethod == TransportMethod.None)
                {
                    Log.Info("iPiMPWeb  - call StartProcess STREAM/NONE {0}", encoderInput.Url);
                    StartProcess(encoderInput.Url);
                }
                else
                {
                    Log.Info("iPiMPWeb  - call StartProcess STREAM/BOTH {0} {1}", encoderInput.Url, encoderOutput.Url);
                    StartProcess(encoderInput.Url, encoderOutput.Url);
                }
                Log.Info("iPiMPWeb  - CopyStream");
                encoderInput.CopyStream(_mediaStream);
            }
            else
            {
                if (encCfg.outputMethod == TransportMethod.None)
                {
                    Log.Info("iPiMPWeb  - call StartProcess FILE/NONE {0}", _filename);
                    StartProcess(_filename);
                }
                else
                {
                    Log.Info("iPiMPWeb  - call StartProcess FILE/BOTH {0} {1}", _filename, encoderOutput.Url);
                    StartProcess(_filename, encoderOutput.Url);
                }
            }
            if (encCfg.outputMethod != TransportMethod.None)
            {
                Log.Info("iPiMPWeb - outputMethod is Not None");
                encoderOutput.Start(false);
                Log.Info("iPiMPWeb - encoderInput started");
                // Wait for the output encoder to connect.
                int tries = 10000;

                do
                {
                    if (encoderOutput.IsReady)
                    {
                        break;
                    }

                    System.Threading.Thread.Sleep(1);
                } while (--tries != 0);
            }
        }
Example #2
0
        private void StartPipe()
        {
            // Start the transcoder.
            //if (mediaStream != null)
            //{
            //  encoderInput.Start(false);
            //  StartProcess(encoderInput.Url, encoderOutput.Url);
            //  encoderInput.CopyStream(mediaStream);
            //}
            //else
            //  StartProcess(filename, encoderOutput.Url);
            if (mediaStream != null)
            {
                encoderInput.Start(false);
                if (encCfg.outputMethod == TransportMethod.None)
                {
                    StartProcess(encoderInput.Url);
                }
                else
                {
                    StartProcess(encoderInput.Url, encoderOutput.Url);
                }
                encoderInput.CopyStream(mediaStream);
            }
            else
            {
                StartProcess(filename, encoderOutput.Url);
            }
            if (encCfg.outputMethod != TransportMethod.None)
            {
                encoderOutput.Start(false);
                // Wait for the output encoder to connect.
                int tries = 10000;

                do
                {
                    if (encoderOutput.IsReady)
                    {
                        break;
                    }

                    System.Threading.Thread.Sleep(1);
                } while (--tries != 0);
            }
        }