[vtkusers] Stream the output of vtkrenderwindow to a HTML5 browser

Mengda Wu wumengda at gmail.com
Sun Nov 15 15:38:03 EST 2015


Hi Sebastien,

   Thanks a lot for your reply. I just tried vtk-web with the Cone
application. But I got some errors when I tested. I used Python 2.7.7 and
VTK 6.3.0. I am not sure what's wrong.

C:\Library\VTK\VTK-6.3.0\Build\bin\Release>.\vtkpython.exe
C:\Library\VTK\VTK-6.
3.0\Build\Wrapping\Python\vtk\web\vtk_web_cone.py --content
C:\Library\VTK\VTK-6
.3.0\Build\www\ --port 3800
2015-11-15 15:35:00-0500 [-] Log opened.
2015-11-15 15:35:01-0500 [-] Site starting on 3800
2015-11-15 15:35:01-0500 [-] Starting factory <twisted.web.server.Site
instance
at 0x0000000003E47F48>
2015-11-15 15:35:09-0500 [HTTPChannel,0,127.0.0.1] Unhandled Error
        Traceback (most recent call last):
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\protocols
\basic.py", line 571, in dataReceived
            why = self.lineReceived(line)
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\http.
py", line 1656, in lineReceived
            self.allContentReceived()
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\http.
py", line 1731, in allContentReceived
            req.requestReceived(command, path, version)
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\http.
py", line 827, in requestReceived
            self.process()
        --- <exception caught here> ---
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\serve
r.py", line 189, in process
            self.render(resrc)
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\serve
r.py", line 238, in render
            body = resrc.render(self)
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\resou
rce.py", line 250, in render
            return m(request)
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\stati
c.py", line 631, in render_GET
            producer.start()
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\stati
c.py", line 710, in start
            self.request.registerProducer(self, False)
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\http.
py", line 873, in registerProducer
            self.transport.registerProducer(producer, streaming)
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\internet\
abstract.py", line 112, in registerProducer
            producer.resumeProducing()
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\stati
c.py", line 720, in resumeProducing
            self.request.write(data)
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\serve
r.py", line 217, in write
            http.Request.write(self, data)
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\http.
py", line 1002, in write
            value = networkString('%s' % (value,))
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\python\co
mpat.py", line 364, in networkString
            raise TypeError("Can only pass-through bytes on Python 2")
        exceptions.TypeError: Can only pass-through bytes on Python 2

2015-11-15 15:35:09-0500 [HTTPChannel,0,127.0.0.1] Unhandled Error
        Traceback (most recent call last):
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\serve
r.py", line 321, in processingFailed
            % webutil.formatFailure(reason))
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\util.
py", line 425, in formatFailure
            flattenString(None,
FailureElement(myFailure)).addBoth(result.append
)
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\_flat
ten.py", line 420, in flattenString
            d = flatten(request, root, io.write)
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\_flat
ten.py", line 402, in flatten
            _writeFlattenedData(state, write, result)
        --- <exception caught here> ---
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\_flat
ten.py", line 359, in _writeFlattenedData
            element = state.next()
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\_flat
ten.py", line 326, in _flattenTree
            raise FlattenerError(e, roots, extract_tb(exc_info()[2]))
        twisted.web.error.FlattenerError: Exception while flattening:
          <twisted.web.util.FailureElement object at 0x0000000003ED3240>
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\_flat
ten.py", line 317, in _flattenTree
            element = stack[-1].next()
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\_flat
ten.py", line 286, in _flattenElement
            result = root.render(request)
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\_elem
ent.py", line 184, in render
            return loader.load()
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\templ
ate.py", line 465, in load
            self._loadedTemplate = self._loadDoc()
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\web\templ
ate.py", line 446, in _loadDoc
            f = self._path.open('r')
          File
"C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted\python\fi
lepath.py", line 828, in open
            return open(self.path, mode + 'b')
        IOError: [Errno 2] No such file or directory:
'C:\\Library\\VTK\\VTK-6.3
.0\\Build\\Wrapping\\Python\\twisted\\web\\failure.xhtml'

Thanks,
Guanglei

On Sat, Nov 14, 2015 at 11:33 AM, Sebastien Jourdain <
sebastien.jourdain at kitware.com> wrote:

> Hi Mengda,
>
> I guess it depend what kind of data you want to stream.
> VTK web is already doing that by sending images through Websockets.
> There is even an option that will send the scene geometry which will let
> you interact with the scene locally inside your browser.
>
> There is several example in the VTK repository that show how to setup a
> server with a basic VTK application.
>
> Seb
>
> On Fri, Nov 13, 2015 at 12:46 PM, Mengda Wu <wumengda at gmail.com> wrote:
>
>> Hi vtkusers,
>>
>>    I am thinking to stream the output of vtkrenderwindow to a HTML5
>> browser. I hope to do an offscreen rendering on the server and stream it
>> to a HTML5 browser on the client. Is this possible?
>>
>> Thanks,
>> Mengda
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151115/51c56b03/attachment.html>


More information about the vtkusers mailing list