loading
 
Resizing Video Stream on the Webpage
spacehermit from United States  [28 posts]
7 years
Is there a way to change the video stream's width and height on the webpage from the webpage?

Say I start off with one camera outputting at 320x240

<applet width=320 height=240 codebase="/[authorization]" code="RoboRealm.class">
<param name="timeout" value="0">
<param name="port" value="[port]">
<param name="authorization" value="[authorization]">
</applet>

then I switch to a mosaic view of four cameras at an output total of 640x480.  

<applet width=640 height=480 codebase="/[authorization]"
code="RoboRealm.class">
<param name="timeout" value="0">
<param name="port" value="[port]">
<param name="authorization" value="[authorization]">
</applet>

So far I've had to put the mosaic camera view on a second webpage with the width and height static, but I'd like to make it so the user can change the size of the video stream window in a table on one page.

I'm not that great at javascript but I figure there might be a solution if I can make the applet's width and height not static.  If I take out the width and height in the applet the video stream window drops down to 160x120.

Please let me know what you think
Thanks
spacehermit
from United States  [214 posts] 7 years
I have a similar need: I'd like to use the web interface on an external monitor attached to my laptop to show the audience at RoboGames what my robot sees.  The laptop will be facing me, the monitor will face the audience.   I run RoboRealm at 320x240 to keep my FPS high, but I'd like to magnify the image on the web page for the audience, similar to the Zoom ability within RoboRealm's own interface.

Thanks!
patrick
from United States  [214 posts] 7 years
I managed to play with the RoboRealm web page HTML so that I can now change the displayed image size on the fly.  This method works with Firefox--I don't think it will work with IE.  I've attached the resulting HTML file below.  Note that this solution does not use the Java applet provided by RoboRealm but instead uses the mjpeg.cgi script that RoboRealm also provides at:

http://localhost:8080/mjpeg.cgi

Note also that it does not affect the image size in the RoboRealm instance at all, just the height and width parameters in the web page.  To use this solution, you would save the attached file to your hard disk then point your browser to the file after making sure RoboRealm is running and configured to publish the web page.

--patrick

_RoboRealm.zip
spacehermit from United States  [28 posts] 7 years
Oh that's so great!!
Thank you very much
Anonymous 7 years
Another suggestion if you are just wanting to relay video to another screen is to use the Distributor_Server module on the main machine and then a second instance of RoboRealm just running the Distributor_Client module on the display monitor.  You can then set the display version into Kiosk mode which will perform better than a browser based reply (Java is not as fast as pure C++). Plus you also have all the other viewing options of RoboRealm available.

A final technique if you are on the same machine for both displays is to use the Virtual Camera to pump the video to another display application like VLC, AmCap, etc.

Probably too many options here!!

STeven.
from United States  [214 posts] 7 years
Thanks STeven!  Those are great suggestions that I will give a try.

--patrick

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index