/// <summary> /// Launches a new process to play the output of a realtime stream in a window. /// </summary> /// <param name="stream">The stream to play back.</param> /// <param name="cameraName">Name of the directshow device to capture.</param> /// <param name="bitrateKbps">Bitrate of the stream to send.</param> /// <param name="showWindow">Set to false to hide the command prompt. (Not recommended.)</param> /// <param name="width">Width of the video to capture. (Not Set = Device Default)</param> /// <param name="width">Height of the video to capture. (Not Set = Device Default)</param> /// <returns>Windows Process handle</returns> public Process launchWebcamSenderForStream(DeepAI.RealtimeStream stream, String cameraName, int bitrateKbps, Boolean showWindow = true, int width = -1, int height = -1) { String[] cmdAndArgs = getWebcamInputStreamCmdForRealtimeStream(stream, cameraName, bitrateKbps, width: width, height: height); var processInfo = new ProcessStartInfo { UseShellExecute = false, CreateNoWindow = (!showWindow), FileName = cmdAndArgs[0], Arguments = cmdAndArgs[1] }; var process = Process.Start(processInfo); return(process); }
/// <summary> /// Launches a new process to play the output of a realtime stream in a window. /// </summary> /// <param name="stream">The stream to play back.</param> /// <param name="showWindow">Set to false to hide the command prompt. (Not recommended.)</param> /// <returns>Windows Process handle</returns> public Process launchPlayerForStream(DeepAI.RealtimeStream stream, Boolean showWindow = true) { String[] cmdAndArgs = getPlayerCmdForRealtimeStream(stream); var processInfo = new ProcessStartInfo { UseShellExecute = false, CreateNoWindow = (!showWindow), FileName = cmdAndArgs[0], Arguments = cmdAndArgs[1] }; var process = Process.Start(processInfo); return(process); }
/// <summary> /// Get the program name and arguments to launch a process that will play the output of a realtime stream. /// </summary> /// <param name="stream">The realtime stream to play.</param> /// <returns>program name and arguments as array</returns> public String[] getPlayerCmdForRealtimeStream(DeepAI.RealtimeStream stream) { String input_format = "mpegts"; return(getPlayerCmdForSettings(input_format, stream.output_url)); }
/// <summary> /// Get the program name and arguments to launch a process that will send webcam input to a realtime stream. /// </summary> /// <param name="stream">The stream to send input to.</param> /// <param name="cameraName"Name of the directShow device to capture.</param> /// <param name="bitrateKbps">Bitrate of the compressed video stream to send.</param> /// <returns>program name and arguments as array</returns> public String[] getWebcamInputStreamCmdForRealtimeStream(DeepAI.RealtimeStream stream, String cameraName, int bitrateKbps, int width = -1, int height = -1) { String output_format = "mpegts"; //make ths adjustable return(getWebcamInputStreamCmdForSettings(cameraName, bitrateKbps, stream.input_url, output_format, stream.fps, width: width, height: height)); }