Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, November 29, 2022 1:55:29 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367


The code below shows how to use the streaming features of LEADTOOLS Multimedia SDKs to implement live video screen capture from one PC and stream the captured video to a different PC, using 2 different network protocols.

Video capturing is achieved using the LEAD Screen Capture Video Source which is easily accessed by the LEAD CaptureCtrl. The CaptureCtrl then sends the data over the network, and it can be received and displayed at the second PC using the LEAD PlayCtrl.

The 2 approaches are:

1. Lossless video streaming with LTSF:
The LEAD Screen Capture video encoder supports lossless compression of video frames and is especially suited for screen capture videos.
This encoder can be used in conjunction with the proprietary LTSF streaming protocol as follows:

Code:

// Sender-side code
// First, select the LEAD Screen Capture video source
captureCtrl.VideoDevices[@"@device:sw:{E2B7DFB2-38C5-11D5-91F6-00104BDB8FF9}\{E2B7DE13-38C5-11D5-91F6-00104BDB8FF9}"].Selected = true;
// Specify format and compression
captureCtrl.TargetFormat = TargetFormatType.NET;
captureCtrl.VideoCompressors.ScreenCapture.Selected = true;
// Specify protocol and IP address
captureCtrl.TargetFile = "ltsf://" + ipAddress;
// Next line is important to build the filter graph
captureCtrl.ReadyCapture(0);
captureCtrl.StartCapture(CaptureMode.Video);

// Receiver-side code
playCtrl.SourceFile = "ltsf://" + ipAddress;
playCtrl.Run();



2. Standard video streaming with UDP and MPEG4:
If there's a need to use the common UDP protocol for streaming, standard MPEG4 video compression can be used as follows:

Code:

// Sender-side code
// First, select the LEAD Screen Capture video source
captureCtrl.VideoDevices[@"@device:sw:{E2B7DFB2-38C5-11D5-91F6-00104BDB8FF9}\{E2B7DE13-38C5-11D5-91F6-00104BDB8FF9}"].Selected = true;
// Specify format and compression
captureCtrl.TargetFormat = TargetFormatType.MPEG2Transport;
captureCtrl.VideoCompressors.Mpeg4.Selected = true;
// Specify protocol and IP address
captureCtrl.TargetFile = "udp://" + ipAddress;
// Next line is important to build the filter graph
captureCtrl.ReadyCapture(0);
captureCtrl.StartCapture(CaptureMode.Video);

// Receiver-side code
playCtrl.SourceFile = "udp://" + ipAddress;
playCtrl.Run();


Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2023, Yet Another Forum.NET
This page was generated in 0.031 seconds.