Help needed before I pull out all of my hair. (Visual Basic)

A spot for any other misc. programing languages not covered above.
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Help needed before I pull out all of my hair. (Visual Basic)

Post by perfo »

I hope a VBA or VB guru lurks these forums..
With all the complexities of building a ROV that is controlled over the internet there is one I can't get over and it should be the simplest of them all..

My problem is I have a foscam ip camera and I want to show the video stream in Excel / VBA eith on a form or work sheet.

I can type in http://............/live.htm in chrome or Firefox and I get a nice video stream.
Internet explorer doesn't allow the video.htm....it automatically tries to run the .cgi which then needs an active X to run which isn't part of Windows.
So why not just view it with chrome then ...even chrome portable..
Well the other problem is I just can't find out how to put a chrome or firefox window on a VBA form.. There is a WebBrowser tool but that uses IE and doesn't work for this camera even if I download the active X as I don't think the WebBrowser tool picks up the active X 's install in the main browser...
There is a nice you tube video of someone doing it with a .net bit of code but he doesn't show or explain the code and I'm not sure it's genuine..
I can't download the active X on the final version as it will be on a site where installing non standard stuff is not allowed.. but as they have office and thus VBA I hoped to do it in that....

So in short does anyone have any ideas how to view an MJPEG stream in Excel or VBA ? Thanks
a_shorething
Posts: 289
Joined: Sep 10th, 2013, 5:26 pm
Location: New Jersey Shore

Re: Help needed before I pull out all of my hair.

Post by a_shorething »

perfo wrote:I hope a VBA or VB guru lurks these forums..
With all the complexities of building a ROV that is controlled over the internet there is one I can't get over and it should be the simplest of them all..

My problem is I have a foscam ip camera and I want to show the video stream in Excel / VBA eith on a form or work sheet.

I can type in http://............/live.htm in chrome or Firefox and I get a nice video stream.
Internet explorer doesn't allow the video.htm....it automatically tries to run the .cgi which then needs an active X to run which isn't part of Windows.
So why not just view it with chrome then ...even chrome portable..
Well the other problem is I just can't find out how to put a chrome or firefox window on a VBA form.. There is a WebBrowser tool but that uses IE and doesn't work for this camera even if I download the active X as I don't think the WebBrowser tool picks up the active X 's install in the main browser...
There is a nice you tube video of someone doing it with a .net bit of code but he doesn't show or explain the code and I'm not sure it's genuine..
I can't download the active X on the final version as it will be on a site where installing non standard stuff is not allowed.. but as they have office and thus VBA I hoped to do it in that....

So in short does anyone have any ideas how to view an MJPEG stream in Excel or VBA ? Thanks
Are you even sure it's an mjpeg format stream? I thought Foscam used the H.264 or whatever format.

Those Chinese cameras don't play nicely with a lot of things. I'm afraid I don't have any help for you on that (had a similar problem with a 'Tenvis IP Robot' camera which I think is a Foscam clone. I couldn't get it working in C#.NET and I'm a C#.NET programmer by trade. Ended up going a different way with my design entirely and now it's in the spare parts box (Nobody wants a Charlie-in-the-box! :)).

Good luck and keep us posted.

Mike

PS- the 'user comments' and tech support sites for those cameras are HEAVILY moderated. You won't see any bad reviews or reported issues that are unresolved.
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Help needed before I pull out all of my hair.

Post by perfo »

Thanks for the comment....
I've got two work arounds which are less than perfect.
One:- I've done a simple auto update html5 form which works ok in IE and gets a snap shot every 0.5 seconds. It wont run much faster and you can easily see stagger but it would work at a push.
Two:- My much better solution is a batch file open a border less portable chrome browser page with the cam stream in the middle. I then autostart up Excel which then launches a border less form ( nicely shaped not rectangular ) with a transparent window in that then sits on top of the chrome page... again this works and is much smoother than the IE one. Problem is getting them to line up neatly if something changes or isn't maximized etc...

Yep as far as I know it is mjpeg but id have the same problem no matter what with IE... I never thought his bit was going to be such a time consuming bit... plug and play...ha...
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Help needed before I pull out all of my hair.

Post by perfo »

It's not looking good on the VBA /VB experts then :(
User avatar
Moki
Posts: 119
Joined: Oct 21st, 2014, 2:19 am
Location: The Netherlands

Re: Help needed before I pull out all of my hair.

Post by Moki »

I think IE needs javascript to display mjpeg video.
Atleast thats the trick they use for mjpg-streamer

As for the experts... We all have a past, that got us here.... Maybe vba is not a road that takes you to rov building. ;)
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Help needed before I pull out all of my hair.

Post by perfo »

Yep, As I said before the last thing I thought would hold me up is getting a picture on the screen. I can get it to work with IE but need to download and install stuff which is messy..It seems it should be so easy to embed chrome or firefox in to a VB form but it just isn't... which is most annoying...

I may well end up using you fine software MOKI but I really want to do my own layout and frontend and I don't know enough about the HTML and stuff to do it with your set up.. It is still my no 1 back up plan...
User avatar
Moki
Posts: 119
Joined: Oct 21st, 2014, 2:19 am
Location: The Netherlands

Re: Help needed before I pull out all of my hair.

Post by Moki »

Draw me a picture, of your layout. Maybe its easy (cant be hard)
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Help needed before I pull out all of my hair.

Post by perfo »

Thanks for the offer, I'll finalise what it sorta looks like in a few days when as I'm playing with gyros and stuff in my spare time at present and I've got all the bits for a 3d printer turning up tomorrow I hope.
If the offer is still open in a week or so ,,then I may take you up on it.. :)
Basically it will have two scales for Heading and Depth (demand and actual) ,, it will have a graphic to show both joystick left right centre. And some other stuff showing the gyro data and joystick buttons though I'm not sure what they will all do yet... I am still hoping to put a sonar distance gadget on it but not sure what that will look like..
I bet it isn't that difficult once you've got the basics handled I've just got too many learning curves surrounding me at the moment..
rossrov
Posts: 383
Joined: Feb 28th, 2013, 5:01 pm
Location: Australia

Re: Help needed before I pull out all of my hair.

Post by rossrov »

Hi Perfo. Choosing a particular control and instrument GUI to accompany the video display was something I spent a fair bit of time on. Like Moki says, VB may not be the way to go with IP-based video, be it IP cameras or RasPi.

What you are wanting to display in terms of heading and depth can be done using "divs" in JavaScript/HTML. The div can be statically (can have text in it) or dynamically (think moving bar graph) placed on the screen. As mentioned earlier, operator input can be with mouse or keyboard or emulator, not needing anything else in terms of 3rd-party software, just the a standard browser. Alternatively of course the joystick add-on could be used.

Before starting my IP camera based ROV project, I had only done 2 or 3 very simple HTML websites. Probably the sort of level that young secondary school kids would start with. This was without an HTML compiler or editor, just notepad. Doing an internet search for how to read a mouse in a webpage found an example that also moved a div up and down the screen. That needed JavaScript, which if kept simple was fairly easy. I only became familiar with the few tiny pieces of JavaScript that I needed for the project.

You may have already seen this. It gives you the idea about divs. viewtopic.php?f=15&t=997#p5596
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Help needed before I pull out all of my hair.

Post by perfo »

Thanks for the link... are you saying that page shown in the video link was simple ?
I know I must drag myself in to the newer way of doing things...and learn to do everything web based but as I mentioned sometimes I've just got too many learning curves ahead so wished something I know fairly well will do...
However have you got any suggestions for an editor / scriptor for html / java ....I guess a wysiwyg type thing maybe handy. I could start with a few simple things and have a gauge just how long it's going to take me to get somewhere...
If you do a compass graphic (for example) thus an input from the gryro board gives a reading and you display it on the screen as a moving compass. Would you have to draw the complete thing and then rotate it or whatever ? What I mean is really could I get a bmp or jpeg from somewhere and animate it or would I have to actually draw it on the canvas every time the page loaded..
Do you know if it is fairly easy to get a joystick input in to a java/html page ?
hmmm one final question the drivers or add ins or whatever you need to get something like a joy stick to work , would these need installing on the client machine/browser ?

Thanks for the food for thought....
Post Reply