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

Mengda Wu wumengda at gmail.com
Sun Nov 15 19:01:43 EST 2015


Hi Sebastien,

   Thanks a lot for your reply. I think it might be some simple errors:
   (1)           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

    (2) 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'


   Here are the files under VTK-6.3.0\Build\Wrapping\Python\twisted:

C:\Library\VTK\VTK-6.3.0\Build\bin\Release>dir
C:\Library\VTK\VTK-6.3.0\Build\Wr
apping\Python\twisted
 Volume in drive C is OS
 Volume Serial Number is 2400-6FCB

 Directory of C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\twisted

11/15/2015  03:05 PM    <DIR>          .
11/15/2015  03:05 PM    <DIR>          ..
11/15/2015  03:05 PM    <DIR>          application
11/15/2015  03:05 PM    <DIR>          conch
09/01/2015  04:44 PM             1,507 copyright.py
11/15/2015  03:05 PM             1,630 copyright.pyc
11/15/2015  03:05 PM             1,630 copyright.pyo
11/15/2015  03:05 PM    <DIR>          cred
11/15/2015  03:05 PM    <DIR>          enterprise
11/15/2015  03:05 PM    <DIR>          internet
11/15/2015  03:05 PM    <DIR>          lore
11/15/2015  03:05 PM    <DIR>          mail
11/15/2015  03:05 PM    <DIR>          manhole
11/15/2015  03:05 PM    <DIR>          names
11/15/2015  03:05 PM    <DIR>          news
11/15/2015  03:05 PM    <DIR>          pair
11/15/2015  03:05 PM    <DIR>          persisted
09/01/2015  04:44 PM             8,534 plugin.py
11/15/2015  03:05 PM             8,080 plugin.pyc
11/15/2015  03:05 PM             8,080 plugin.pyo
11/15/2015  03:05 PM    <DIR>          plugins
11/15/2015  03:05 PM    <DIR>          positioning
11/15/2015  03:05 PM    <DIR>          protocols
11/15/2015  03:05 PM    <DIR>          python
11/15/2015  03:05 PM    <DIR>          runner
11/15/2015  03:05 PM    <DIR>          scripts
11/15/2015  03:05 PM    <DIR>          spread
11/15/2015  03:05 PM    <DIR>          tap
11/15/2015  03:05 PM    <DIR>          test
11/15/2015  03:05 PM    <DIR>          topfiles
11/15/2015  03:05 PM    <DIR>          trial
11/15/2015  03:05 PM    <DIR>          web
11/15/2015  03:05 PM    <DIR>          words
09/01/2015  04:44 PM               266 _version.py
11/15/2015  03:05 PM               352 _version.pyc
11/15/2015  03:05 PM               352 _version.pyo
09/01/2015  04:44 PM             2,152 __init__.py
11/15/2015  03:05 PM             2,018 __init__.pyc
11/15/2015  03:05 PM             2,018 __init__.pyo
              12 File(s)         36,619 bytes
              27 Dir(s)  60,059,516,928 bytes free



On Sun, Nov 15, 2015 at 4:52 PM, Sebastien Jourdain <
sebastien.jourdain at kitware.com> wrote:

> Oops sorry miss read the issue.
>
> VTK-Web is actually disabled on Windows as Twisted require an external
> library (api32.dll, I think).
> It is possible to make it run on Windows but not really validated and
> tested.
>
> You will have to install that dependency on your system.
>
> Moreover, could you list the content of that directory? (I want to make
> sure Twisted get installed on your system)
>
> C:\Library\VTK\VTK-6.3.0\Build\Wrapping\Python\
>
> Seb
>
>
> On Sun, Nov 15, 2015 at 3:43 PM, Sebastien Jourdain <
> sebastien.jourdain at kitware.com> wrote:
>
>> It seems that you have a twisted version installed inside your system
>> Python that conflict with the one provided within VTK.
>>
>> On Sun, Nov 15, 2015 at 2:38 PM, Mengda Wu <wumengda at gmail.com> wrote:
>>
>>> 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/60f1b788/attachment.html>


More information about the vtkusers mailing list