C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 9th, 2012, 08:21 PM
BobS0327 BobS0327 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 118 BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 18 h 48 m 29 sec
Reputation Power: 44
C#.... Perplexed by video streaming latency

I am developing a windows GUI client app that accesses a Closed Circuit TV (CCTV) video stream from a Linux based open source back end server app called ZoneMinder. I am using a Web browser control in my Windows client. Specifically, I'm calling the following function:

Code:
webBrowser1.Navigate(@"http://XXX.XXXXXX:PORT/index.php?action=login&view=postlogin&username=XXXXX&password=XXXXXX&view=watch&mid=7");


The above function refreshes the image about once every five seconds. But if I use the native web page front end, the image is refreshed about once every second. That is, if I use Firefox or IE to access and display the video stream, the refresh rate is one second.

The backend ZM server is generating the video stream using a H.264 codec.

So, my questions; why is Navigate so sloooooow? And how can I reduce the time between image refreshes?

Net version is 4.030319 RtmRel.

Also, to avoid any cross posting issues. This issue has been previously posted on Code Guru

The remote network connection security issue brought up on that forum is a non issue. SSL is being used for remote connections.

Reply With Quote
  #2  
Old December 12th, 2012, 10:44 PM
admiraln admiraln is offline
Still Learning
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Location: Montreal, Canada
Posts: 55 admiraln User rank is Sergeant Major (2000 - 5000 Reputation Level)admiraln User rank is Sergeant Major (2000 - 5000 Reputation Level)admiraln User rank is Sergeant Major (2000 - 5000 Reputation Level)admiraln User rank is Sergeant Major (2000 - 5000 Reputation Level)admiraln User rank is Sergeant Major (2000 - 5000 Reputation Level)admiraln User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 18 h 57 m 51 sec
Reputation Power: 38
This is just a hunch but what browser identification is your control presenting to the site.

The User Agent information may change how the sever responds to the client.

The server may think the "browser" is not capable of receiving full speed transfers.

Reply With Quote
  #3  
Old December 13th, 2012, 01:13 AM
salem's Avatar
salem salem is online now
Contributed User
Click here for more information
 
Join Date: Jun 2005
Posts: 3,840 salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 153 Folding Title: Novice Folder
Time spent in forums: 2 Months 3 Weeks 2 Days 19 h 39 m 7 sec
Reputation Power: 1774
http://www.wireshark.org/
Use this to spy on all the network traffic between you and the video server.

Focus on the initial protocol exchanges and compare differences between what you do in your code, and what a regular browser does.
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper

Reply With Quote
  #4  
Old December 13th, 2012, 10:19 AM
BobS0327 BobS0327 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 118 BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 18 h 48 m 29 sec
Reputation Power: 44
I did determine that the control was using the default IE webbrowser. Wireshark output is as follows:

Code:
..U
0090  73 65 72 2d 41 67 65 6e 74 3a 20 4d 69 63 72 6f   ser-Agent: Micro
00a0  73 6f 66 74 2d 57 69 6e 64 6f 77 73 2f 36 2e 31   soft-Windows/6.1


Also, using the following code in my app

Code:
 string js = @"<SCRIPT type=text/javascript>function getUserAgent(){document.write(navigator.userAgent)}</SCRIPT>";

            System.Windows.Forms.WebBrowser wb = new WebBrowser();
            wb.Url = new Uri("about:blank");
            wb.Document.Write(js);
            wb.Document.InvokeScript("getUserAgent");

            string userAgent = wb.DocumentText.Substring(js.Length);

            System.Console.WriteLine(userAgent);


produces the following output:

Code:
			"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MDDC)"	



Previously, I had briefly checked both browsers (Firefox and IE) for any issues. Neither exhibited any slowness issues during my very brief test independent of using my control. So, I focused my attention on potential Webbrowser control issues. I revisited IE after wireshark etc. gave me the impression that it was the default browser used by the control and realized that initially it is very fast as in one second refresh rates but it eventually slows down to about 5 second refresh rates. The five second refresh rate become consistent with IE after a few minutes.

So, now I have to override the default bahavior of the control to use Firefox if it is installed. Otherwise, I'm stuck with IE.

Unfortunately, I developed "tunnel vision" on this issue and incorrectly made the assumption that the control was the source of the problem.

Thanx guys. I really appreciate the help getting me back on the right track!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > C#.... Perplexed by video streaming latency

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap