Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
| Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 16th, 2005, 03:03 AM
Authorized User
 
Join Date: Nov 2005
Location: Kathmandu, Kathmandu, Nepal.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default optimal utilization of network bandwidth

I have been involved recently in a video conferencing project. I have managed to capture the image frame by frame and compress it. The problem is the the frame size is still too large and takes up a lot of the network bandwidth to transmit. Will it help to use multithreading i.e instead of transmitting one frame at a time, transmit 4 or 5 frames using separate threads. Will this approach result in faster transfer?

 
Old November 16th, 2005, 08:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

It would, but it will not hugely improve the transfer rate. Eventually it'll all depend on the bandwidth and intrastructure (the routers, what kind of transfer support and checks and bottlenecks they provide in bitween, how much work is being taken care of by things like QoS etc.) that you have available for the transfer. Morever the thread management, packet buiding processes that you will write, have to written and managed in a very tidy manner or you will end up with missed or currupt or low quality frames.

By the way, to provide video feed to all the participants you dont have to capture the stream and transfer it frame by frame. I mean unless u need to do what you are doing to serve some specific requirement, u can just stream it to all the participents, in between u can also gauge the bandwith available to them and compress the stream for quick(low quality) .... good quility (slow) ratios for transfers.

Regards
Ankur Verma
 
Old November 17th, 2005, 12:07 AM
Authorized User
 
Join Date: Nov 2005
Location: Kathmandu, Kathmandu, Nepal.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually I do have a specific reason for transfering the media frame by frame. Actually i have capture my desktop image and send it to a central server from where others can view it as a stream. The problem here is the image i.e. 1 frame, captured is way too large (25kb) even after compression. With my current bandwidth it takes approximately 7 seconds to transfer one frame. So u can imagine the rate at which it will be rendered.

So i was thinking of using multithreading to enhance that speed. If multithreading won't help then can u suggest me another way by which i may acheive considerable optimization. You hinted on streaming my video. Could you please elaborate.

Thanks,
Saban


 
Old November 17th, 2005, 06:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Please verify if this is what you are doing. The desktop image that you have captured is captured only once and sent to the server for others to get it from there as an image. And then you start streaming the video for the other activities. I mean first people get the image and then they get the video which is sort of imposed on the image.

If this is what you are doing then share the image some other way, share it as you would any other normal file. Dont stream it as a media stream.

Then setuping a media server in between should help you anyways.

With media server set up in the middle the process of getting the video stream from network and propogating and (multicast or braodcast it, u will have to see what suits u better) it to other clients will be much easier for you to configure.

If you havent already, explore windows media server a little as that is the easiest to configure and get working. Then move on to more professional solutions if you need to.

Ankur
 
Old November 17th, 2005, 07:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Have a look at h323 lines TAPI samples that ship with Platform SDK. U might find something interesting over there as well. Its very easy to develop a good quality video conferencing software based on H323 protocol which is better optimised to handle hatrogenous enviroments and has structure level support for QoS. I'm not in touch with whats the latest thats happening in that domain, but I had developed a sample application for Voice XML Develper's Guide (a book), and i found the technology very promising.

Ankur
 
Old November 20th, 2005, 12:37 AM
Authorized User
 
Join Date: Nov 2005
Location: Kathmandu, Kathmandu, Nepal.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No not exactly. I am trying to capture the Desktop image and transmit it to the server, image by image, periodically. Say, I capture the Desktop image once and name it as "image1.gif" and then send it to the server. Again, after 100 milliseconds I capture another image and name it as "image2.gif" and send it to the server and so on. The server gets these images and routes them to the Clients. The clients may view the images in a continuos manner as if they were watching a video. Its more like Windows Desktop sharing, with the client only limited to view whats happening on the broadcasters desktop.

Capturing and sending image by image is not giving me good results in terms of speed. Is there any other way i may proceed that will give me considerable improvements in terms of speed. Will streaming be helpful. If it does how may I proceed.

Thanks,
Saban.



 
Old November 20th, 2005, 06:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

In that case, U just may find the COMPLETE solution in Windows Media Encoder. Encoder lets you create sessions where whatever happening on the screen is captured and braodcasted at a certain port for others to pick it from there.
On the top of it, it also lets you have a say on the quality of the stream. Like for networks where bandwidth is at a premium you can optimise the encoding for quicker transfer (trade off quality) and stuff like that.
And u dont have to use encoder as a package either. You just ship a few support DLLs (which actually do the work) with your software and use Encoder through your own programe. Encoder has been basically developed as a COMponent and can be used in the same manner.

For getting the feel of how it works just start encoder and configure the session to capture the screen. At the later tab pages you select -broadcasting to a certain port- instead of saving the stream to a file. once the session is started start windows media player and write the URL on which the stream is being braodcasted and you will have a presentable POC in front of you.

Regards
Ankur Verma
 
Old November 20th, 2005, 11:59 PM
Authorized User
 
Join Date: Nov 2005
Location: Kathmandu, Kathmandu, Nepal.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I will try out ur suggestion.

thanks,
Saban.

 
Old November 27th, 2005, 05:12 AM
Authorized User
 
Join Date: Nov 2005
Location: Kathmandu, Kathmandu, Nepal.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using Windows Media Series 9 and my problem is solved.

Thanx a lot,
Saban.

 
Old November 27th, 2005, 09:46 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

You are welcome. Feels good when you able to help.




Similar Threads
Thread Thread Starter Forum Replies Last Post
To minimize the CPU Utilization on DB server Scorpio1 J2EE 0 January 22nd, 2008 02:59 AM
how to calculate bandwidth debuajm C# 2005 0 January 16th, 2007 07:40 AM
Bandwidth Control or Limiting using JSP draggy Pro JSP 3 July 21st, 2006 02:58 PM
CPU utilization:Thread Pooling Bom VS.NET 2002/2003 1 October 11th, 2003 01:03 PM
CPU utilization:Thread Pooling Bom VS.NET 2002/2003 0 October 8th, 2003 08:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.