Graphics.MJPEGVideoStreaming - lordmundi/wikidoctest GitHub Wiki
MJPEG Video Streaming
« Changing Anti-Aliasing Levels | EDGE User’s Guide | Pixelstream Plugin »
The ability to stream MJPEG images to a web browser or other compatible client was provided in Issue Issues.00423.
Simple directions
The simple usage is to open the web commanding server in a browser and go to either the /image resource for a static image or the /video resource for a series of streaming MJPEG images.
You can see the video resource in action by seeing it embedded into the Mobile WCS interface and have the option to switch between still images or streaming video among other viewport and camera controls.
What's really going on
If you want to specify a width and height to the image, simply append those parameters on to the URL. For example "/image?width=800&height=600" will return a single image of that size. Similarly, requesting "/video?width=800&height=600" will return a streaming video of 800×600 images. Keep in mind that in both of these cases the images are being resized to meet the request, not rendered at that resolution. So, if your window is not rendering an image that is close to the size you are requesting, there could be resizing artifacts in the images that come back.
Also, if you want to see how these are implemented, look in "gui/web_commanding_server.tcl". The video streaming is implemented in the "wcs_mjpg" and "wcs_send_next_mjpg_frame" procedures. You can see that by default, there is a delay of 75 ms between video frames. If you wanted this to be faster or slower, you would need to make your own video resource callback and specify a different delay. You can read about making your own resources and callbacks on the Web Commanding Capability page.
« Changing Anti-Aliasing Levels | EDGE User’s Guide | Pixelstream Plugin »