I would question why you are sending complete images every time? I'd rather run
it through FFMPEG and create an actual video stream and save a ton of
bandwidth.
I'd also try using an IFRAME for just he image.
________________________________
From: Marco Faletra <m.fale...@gmail.com>
To: witty-interest@lists.sourceforge.net
Sent: Tuesday, December 20, 2011 6:14 AM
Subject: [Wt-interest] View a Video Server with Wt
Hi all. I would expose my problem:
I need to display an image stream from a video server that sends 4
images sequentially (about 20 fps).
The best is to tell the browser: at this IP you can find the video
server (the IP address is not the same of web server), take the image
e show them. Unfortunately, try also without Wt, I found the
"Cross-site scripting" and "same origin policy" problem. If someone
know a solution I would be very grateful. Next step, if can do it,
will be use with Wt.
For this problem, a great solution, would be make a proxy-server in
order to bypass the "same origin policy": unfortunately I don't know
how code it with Wt.
Trying to give a solution to the problem, I insert a WImage and
refresh it every time an image arrive to Wt web server: in this manner
I have a worst refresh (I lose about 10-15% of image) and also I need
to refresh the whole page for "only" one image.
This is what I do:
in ctor:
m_imageResource = new Wt::WMemoryResource("image/telecamera", this);
m_link.setResource (m_imageResource);
m_telecamera = new WImage (m_link, "Telecamera1");
while, when an image arrive:
m_imageResource->setData (inStream_);
Wt::WApplication::UpdateLock lock(Wt::WApplication::instance());
if (lock) {
// Push the changes to the browser
Wt::WApplication::instance()->triggerUpdate();
}
where inStream_ it's a buffer where inside there is the jpeg image.
If I don't insert "Wt::WApplication::instance()->triggerUpdate()", the
refresh is done, about, every 5/6 seconds.
If it can help you I can post all source code.
Thank you.
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest