All Projects β†’ cjroth β†’ Aframe Phantomjs Continuous Streaming

cjroth / Aframe Phantomjs Continuous Streaming

Licence: mit
Browse the web in VR by live streaming a web page into Aframe using PhantomJS and ffmpeg.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Aframe Phantomjs Continuous Streaming

virtual-reality-tour
πŸ“ Virtual reality travel in Google Street View.
Stars: ✭ 34 (-15%)
Mutual labels:  vr, aframe
streamingDemo
No description or website provided.
Stars: ✭ 56 (+40%)
Mutual labels:  ffmpeg, websockets
aframe-xylayout
Flexbox like 2D layout + UI components for A-Frame.
Stars: ✭ 23 (-42.5%)
Mutual labels:  vr, aframe
a-blast
πŸ’₯ Save the World From the Cutest Creatures in the Universe!
Stars: ✭ 116 (+190%)
Mutual labels:  vr, aframe
Aframe Inspector
πŸ” Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
Stars: ✭ 469 (+1072.5%)
Mutual labels:  aframe, vr
lvr
πŸ‘“ Augmented Reality for everyone - Out of the world experiences
Stars: ✭ 92 (+130%)
Mutual labels:  vr, aframe
aframe-registry
[DISCONTINUED] Curated collection of community A-Frame components.
Stars: ✭ 76 (+90%)
Mutual labels:  vr, aframe
Altspacesdk
Software Development Kit for AltspaceVR
Stars: ✭ 159 (+297.5%)
Mutual labels:  aframe, vr
Ideaspace
😎 Create interactive 3D and VR web experiences for desktop, mobile & VR devices
Stars: ✭ 344 (+760%)
Mutual labels:  aframe, vr
3dio Js
JavaScript toolkit for interior apps
Stars: ✭ 255 (+537.5%)
Mutual labels:  aframe, vr
zanzarah-tools
The set of various zanzarah browsing and editing tools, written entirely in coffee and js.
Stars: ✭ 29 (-27.5%)
Mutual labels:  vr, aframe
Quick Media
media(audio/image/qrcode/markdown/html/svg) support web service (倚εͺ’δ½“ηΌ–θΎ‘ζœεŠ‘, ι…·η‚«δΊŒη»΄η , ιŸ³ι’‘, 图片, svg, markdown, htmlζΈ²ζŸ“ζœεŠ‘ζ”―ζŒ)
Stars: ✭ 612 (+1430%)
Mutual labels:  ffmpeg, phantomjs
Aframe
πŸ…°οΈ web framework for building virtual reality experiences.
Stars: ✭ 13,428 (+33470%)
Mutual labels:  aframe, vr
aframe-react
React library for A-frame
Stars: ✭ 58 (+45%)
Mutual labels:  vr, aframe
Aframe Effects
A VR Ready Post processing framework for Three.js and/or A-Frame
Stars: ✭ 176 (+340%)
Mutual labels:  aframe, vr
aframe-controller-cursor-component
A cursor for tracked controllers.
Stars: ✭ 30 (-25%)
Mutual labels:  vr, aframe
Thehallaframe
WebVR demo that displays art
Stars: ✭ 120 (+200%)
Mutual labels:  aframe, vr
Aframe Particle System Component
Particle systems for A-Frame.
Stars: ✭ 156 (+290%)
Mutual labels:  aframe, vr
pacman
Pacman WebVR using Aframe
Stars: ✭ 20 (-50%)
Mutual labels:  vr, aframe
A Painter
🎨 Paint in VR in your browser.
Stars: ✭ 539 (+1247.5%)
Mutual labels:  aframe, vr

Browse the web in VR by live streaming a web page into Aframe using PhantomJS and ffmpeg.

Screenshot

I am using:

  • Node v7.2.0
  • PhantomJS v2.1.1
  • Chrome v54
  • ffmpeg v3.2
  • OSX v10.12.1

This setup allows you to continuously render a web page in PhantomJS and stream it into an Aframe VR scene by rendering it onto a canvas. It then forwards user events (eg click, keypress) back to PhantomJS allowing the user to interact with the "browser". Not surprisingly, the performance is shit. This is just a proof of concept. Originally my idea was that I could port existing 2D code editing or text editing web applications into Aframe.

I drew a lot of help from Stef van den Ham's blog post on Recording A Website With PhantomJS And FFMPEG and Dominic Szablewski's post on HTML Live Video Streaming Via Websockets.

Going forward I would like to look into SlimerJS instead of Phantom and even using virtual machines such as VirtualBox.

Install

First install PhantomJS with npm install phantomjs-prebuilt -g or yarn global add phantomjs-prebuilt. You can check if it's installed with phantomjs -v.

For Mac users, install ffmpeg with brew install ffmpeg. You can check if it's installed with ffmpeg -version. I'm not sure how you'd install ffmpeg on Windows or Linux, so you are on your own.

Then run npm install or yarn install. This will automatically run browserify public/packages.js > public/packages.combined.js after it installs all of the Node dependencies - see package.js.

Run

This is a little complex to run. You'll need to run:

  1. A static file server to host the Aframe scene. You can run this using npm start or yarn start. These are just shortcuts for node app.js. This will run on port 3000.
  2. The web socket server that will stream our mpeg data to the browser, adapted from jsmpeg. I've also put the command for this into a script so you can just run sh scripts/start-streaming-server.sh. This listens for data from PhantomJS on port 8082 and then allows the browser to connect via a Websocket on port 8084. Once the browser connects, it will send all of the mpeg data to the browser.
  3. A script that runs PhantomJS, pipes the rendered PNG output to ffmpeg, and then streams the mpeg output from that to the server mentioned in step 2. I've put the command for this into a script, so you can just run sh scripts/phantom-ffmpeg-stream.sh.

Navigate to http://localhost:3000. It will probably take a few seconds for streaming to start. If the 3D web page doesn't show up, try refreshing.

Development

The PhantomJS script will output to two logfiles:

  • logs/main which will show general PhantomJS log messages
  • logs/page_errors which will show any Javascript errors on webpages that you load.

I'd recommend tailing these logs as you work with tail -f logs/main and tail -f logs/page_errors. The reason for doing this instead of using the usual console.log is that we can't output anything to stdout except for the raw PNG data since we are piping this into ffmpeg.

Related Reading

License

MIT Licensed

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].