public bool UseDeviceEncoding { get; set; } Public Property UseDeviceEncoding As Boolean
if true then the device encoding should be used. if false it will not be used.
If a selected device outputs the proper encoding, then setting it to true will not recompress the output. In this case, all the output encoding parameters will be ignored. Not every device outputs data that performs well with all the streaming protocols, hence evaluate the use of this option on a per device basis.
using Leadtools;using Leadtools.MediaStreaming;public Server _server = null;public bool _result = false;public void PrintLiveStreamsExample(){try{string strLiveStreams = "";// create an instance of the server object_server = new Leadtools.MediaStreaming.Server();// retrieve a copy of the Live StreamsLiveStreams Streams = _server.GetLiveStreams();strLiveStreams += string.Format("--- Live Streams (count = {0}) ---\n\n", Streams.Count.ToString());// print the all live streams properties to a stringfor (int nIndex = 0; nIndex < Streams.Count; nIndex++){LiveStream stream = Streams.GetLiveStream(nIndex);strLiveStreams += string.Format("Live Stream[{0}]: Path = \"{1}\".\n", nIndex.ToString(), stream.Path);int nSelection = stream.VideoDevices.Selection;string strDevice = "";if (nSelection < 0)strDevice = "<none selected>";elsestrDevice = stream.VideoDevices[nSelection].FriendlyName;strLiveStreams += string.Format("Video Device = \"{0}\".\n", strDevice);nSelection = stream.AudioDevices.Selection;strDevice = "";if (nSelection < 0)strDevice = "<none selected>";elsestrDevice = stream.AudioDevices[nSelection].FriendlyName;strLiveStreams += string.Format("Audio Device = \"{0}\".\n", strDevice);strLiveStreams += string.Format("Video Width = \"{0}\".\n", stream.VideoWidth.ToString());strLiveStreams += string.Format("Video Height = \"{0}\".\n", stream.VideoHeight.ToString());if (stream.UseVideoInputSize)strLiveStreams += string.Format("Use Video Input Size = \"true\".\n");elsestrLiveStreams += string.Format("Use Video Input Size = \"false\".\n");strLiveStreams += string.Format("Video Frame Rate = \"{0}\".\n", stream.VideoFrameRate.ToString());if (stream.UseVideoInputFrameRate)strLiveStreams += string.Format("Use Video Input Frame Rate = \"true\".\n");elsestrLiveStreams += string.Format("Use Video Input Frame Rate = \"false\".\n");strLiveStreams += string.Format("Video Bit Rate = \"{0}\".\n", stream.VideoBitRate.ToString());if (stream.QSVAcceleration)strLiveStreams += string.Format("QSVAcceleration = \"true\".\n");elsestrLiveStreams += string.Format("QSVAcceleration = \"false\".\n");if (stream.CUDAAcceleration)strLiveStreams += string.Format("CUDAAcceleration = \"true\".\n");elsestrLiveStreams += string.Format("CUDAAcceleration = \"false\".\n");nSelection = stream.AudioTypes.Selection;string strType = "";if (nSelection < 0)strType = "<none selected>";elsestrType = stream.AudioTypes[nSelection].FriendlyName;if (stream.UseDeviceEncoding)strLiveStreams += string.Format("Use Device Encoding = \"true\".\n");elsestrLiveStreams += string.Format("Use Device Encoding = \"false\".\n");strLiveStreams += string.Format("Minimum Fragment Duration = \"{0}\".\n", stream.MinimumFragmentDuration.ToString());if (stream.Enable)strLiveStreams += string.Format("Enable = \"true\".\n");elsestrLiveStreams += string.Format("Enable = \"false\".\n");if (stream.ActivateOnDemand)strLiveStreams += string.Format("ActivateOnDemand = \"true\".\n");elsestrLiveStreams += string.Format("ActivateOnDemand = \"false\".\n");strLiveStreams += string.Format("IdleTimeOut = \"{0}\".\n", stream.IdleTimeOut.ToString());if (stream.CUDADecoding)strLiveStreams += string.Format("CUDADecoding = \"true\".\n");elsestrLiveStreams += string.Format("CUDADecoding = \"false\".\n");if (stream.QSVDecoding)strLiveStreams += string.Format("QSVDecoding = \"true\".\n");elsestrLiveStreams += string.Format("QSVDecoding = \"false\".\n");if (stream.HasVideoDeviceURL){strLiveStreams += string.Format("VideoDeviceURL = \"{0}\".\n", stream.VideoDeviceURL);}}// display a message contains the Live Streams information stringMessageBox.Show(strLiveStreams, "LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information);_result = true;}catch (Exception){_result = false;}}
Imports LeadtoolsImports Leadtools.MediaStreamingPublic _server As Server = NothingPublic _result As Boolean = FalsePublic Sub PrintLiveStreamsExample()TryDim strLiveStreams As String = ""' create an instance of the server object_server = New Leadtools.MediaStreaming.Server()' retrieve a copy of the Live StreamsDim Streams As LiveStreams = _server.GetLiveStreams()strLiveStreams += String.Format("--- Live Streams (count = {0}) ---" & vbLf & vbLf, Streams.Count.ToString())' print the all live streams properties to a stringFor nIndex As Integer = 0 To Streams.Count - 1Dim stream As LiveStream = Streams.GetLiveStream(nIndex)strLiveStreams += String.Format("Live Stream[{0}]: Path = ""{1}""." & vbLf, nIndex.ToString(), stream.Path)Dim nSelection As Integer = stream.VideoDevices.SelectionDim strDevice As String = ""If nSelection < 0 ThenstrDevice = "<none selected>"ElsestrDevice = stream.VideoDevices(nSelection).FriendlyNameEnd IfstrLiveStreams += String.Format("Video Device = ""{0}""." & vbLf, strDevice)nSelection = stream.AudioDevices.SelectionstrDevice = ""If nSelection < 0 ThenstrDevice = "<none selected>"ElsestrDevice = stream.AudioDevices(nSelection).FriendlyNameEnd IfstrLiveStreams += String.Format("Audio Device = ""{0}""." & vbLf, strDevice)strLiveStreams += String.Format("Video Width = ""{0}""." & vbLf, stream.VideoWidth.ToString())strLiveStreams += String.Format("Video Height = ""{0}""." & vbLf, stream.VideoHeight.ToString())If stream.UseVideoInputSize ThenstrLiveStreams += String.Format("Use Video Input Size = ""true""." & vbLf)ElsestrLiveStreams += String.Format("Use Video Input Size = ""false""." & vbLf)End IfstrLiveStreams += String.Format("Video Frame Rate = ""{0}""." & vbLf, stream.VideoFrameRate.ToString())If stream.UseVideoInputFrameRate ThenstrLiveStreams += String.Format("Use Video Input Frame Rate = ""true""." & vbLf)ElsestrLiveStreams += String.Format("Use Video Input Frame Rate = ""false""." & vbLf)End IfstrLiveStreams += String.Format("Video Bit Rate = ""{0}""." & vbLf, stream.VideoBitRate.ToString())If stream.QSVAcceleration ThenstrLiveStreams += String.Format("QSVAcceleration = ""true""." & vbLf)ElsestrLiveStreams += String.Format("QSVAcceleration = ""false""." & vbLf)End IfIf stream.CUDAAcceleration ThenstrLiveStreams += String.Format("CUDAAcceleration = ""true""." & vbLf)ElsestrLiveStreams += String.Format("CUDAAcceleration = ""false""." & vbLf)End IfnSelection = stream.AudioTypes.SelectionDim strType As String = ""If nSelection < 0 ThenstrType = "<none selected>"ElsestrType = stream.AudioTypes(nSelection).FriendlyNameEnd IfIf stream.UseDeviceEncoding ThenstrLiveStreams += String.Format("Use Device Encoding = ""true""." & vbLf)ElsestrLiveStreams += String.Format("Use Device Encoding = ""false""." & vbLf)End IfstrLiveStreams += String.Format("Minimum Fragment Duration = ""{0}""." & vbLf, stream.MinimumFragmentDuration.ToString())If stream.Enable ThenstrLiveStreams += String.Format("Enable = ""true""." & vbLf)ElsestrLiveStreams += String.Format("Enable = ""false""." & vbLf)End IfIf stream.ActivateOnDemand ThenstrLiveStreams += String.Format("ActivateOnDemand = ""true""." & vbLf)ElsestrLiveStreams += String.Format("ActivateOnDemand = ""false""." & vbLf)End IfstrLiveStreams += String.Format("IdleTimeOut = ""{0}""." & vbLf, stream.IdleTimeOut.ToString())If stream.CUDADecoding ThenstrLiveStreams += String.Format("CUDADecoding = ""true""." & vbLf)ElsestrLiveStreams += String.Format("CUDADecoding = ""false""." & vbLf)End IfIf stream.QSVDecoding ThenstrLiveStreams += String.Format("QSVDecoding = ""true""." & vbLf)ElsestrLiveStreams += String.Format("QSVDecoding = ""false""." & vbLf)End IfIf stream.HasVideoDeviceURL ThenstrLiveStreams += String.Format("VideoDeviceURL = ""{0}""." & vbLf, stream.VideoDeviceURL)End IfNext' display a message contains the Live Streams information stringMessageBox.Show(strLiveStreams, "LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information)_result = TrueCatch generatedExceptionName As Exception_result = FalseEnd TryEnd Sub
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
