Screen-Streamer

From Hackerspace Brussels
Jump to: navigation, search
Screen-Streamer
[[Image:{{{picture}}}|200px]]
What:
Stream your desktop to XBMC
Tagline:
Stare while you stare
Maintainer(s):
Tom
Archived:
Yodawg.jpg

Contents

[edit] What?

Find the best option to stream your computer screen to the remote XBMC screens.

[edit] Current state

Currently I found the best option is to use VLC. With VLC we create a stream of your screen, which you open on the XBMC instance.

[edit] Terminal stream

 vlc -vvv screen:// --sout '#transcode{vcodec=mpgv}:standard{access=http,mux=ogg,dst=:1234}'

[edit] Complete Bash Script

This is a complete bash script that will launch VLC, wait 3 seconds and asks XBMC to open that stream via the XBMC API. Give the xbmc url as command argument.

Example:

 ./stream.sh xbmc-groundfloor

Paste following script in stream.sh, make it executable, and execute.

 #!/bin/bash
 # USAGE: ./stream.sh xbmc-groundfloor
 url=http://$HOSTNAME:1234
 if  "$OSTYPE" == "darwin"* ; then
   VLC_PATH=/Applications/VLC.app/Contents/MacOS/VLC
 else
   VLC_PATH= which vlc
 fi
 if [ "$1" = "" ]; then
   echo -n "Insert XBMC URL: "
   read XBMC_HOST
 else
  XBMC_HOST="$1"
 fi
 ($VLC_PATH screen:// --sout '#transcode{vcodec=mpgv}:standard{access=http,mux=ogg,dst=:1234}') &
 sleep 3
 payload='{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "'${url}'" }}, "id": 1 }'
 curl -v -u xbmc:password -d "$payload" -H "Content-type:application/json" -X POST "${XBMC_HOST}/jsonrpc"

[edit] Research material