Dreambox - Twonky - PS3

General discussion about the media server. Feature requests. Hints, tips and tricks.
Locked
Flipit
Posts:4
Joined:Thu Mar 27, 2008 5:17 pm
AV Hardware:4TB BUFFALO TS-LIVE with TWONKY 4.4, PS3, Dreambox 500+
Dreambox - Twonky - PS3

Post by Flipit » Fri Sep 26, 2008 12:31 pm

(please move if it's in the wrong place)

I've done it...

This has been drivin me nuts for a while... PS3 issues.. Dreambox issues...Twonky issues... but I now at least have it working... I can stream satellite tv from my dreambox to the PS3 via a twonky video playlist...

Hardware:
Buffalo livestation NAS running twonky 4.4.6
PS3 2.42 (Important as this 2.40 changed the allowable ts auido type an now support pcm)
Dreambox 500+ Gemini 4.50 (custom script and streamts)

For anyone who maybe intersted this i how to do it...

1. The videolist playlists in twonky don't allow the link link: http://dreambox:31320/0,0405,0xa5,0x65 which is what the dreambox streamts program needs.
A. rewrite streamts... well kind of... I wrote a script in ths bourne shell to handle this... then had to rewrite streamts anyway.. I'll get to that.

2. Script..

stream.sh

#!/bin/sh
# Make web interface change to the correct channel (junks outputs and errors) n.b. Change path to correct one, path can be got from webinterface
wget -q http://localhost/cgi-bin/zapTo?path=...1:c00000:0:0:0: > /dev/null 2>&1
sleep 2
#starts streamts passinng in Transport Stream switch, reads (stdin) from file
/usr/sbin/streamts -ts < pids.conf
exit 0

N.B. This script needs a lot more work , like checking if streamts is already initated and killing it first, but it'll get me going..

-------------
Next you need the pids.conf, took me a while to figure out as it must have the following format as the streamts program parses the hex values, not sure about the rest but this is how I got it working. The 4 pids I have set up are in the first line 0,0405,0xa5,0x65.. (PAT,PMT,VIDEO,AUDIO)

1.GET /0,0405,0xa5,0x65 HTTP/1.1
2.Host: DREAMBOXIP:31320
3.User-Agent: VLC media player - version 0.8.6b Janus - (c) 1996-2007 the VideoLAN team
4.Range: bytes=0-
5.Icy-MetaData: 1
6.Connection: Close
7.

(N.B. Note the extra line (7.) at the end)

Then you need to add a line like this to the inetd.conf

31320 stream tcp nowait /etc/stream.sh

Then: killall inetd
Then: inetd

(Make sure the files are all chmod 755)

Word to the wise you can kill your dreambox if you do this incorrectly and will have to reflash .. be warned...

3. Next to test it with Twonky...

Create the playlist "dreambox.import.playlists" file as follows:

#VIDEOLIST
#NAME:DREAMBOX
#TITLE:TEST
#DEFAULT-EXTENSION:mpeg
http://Dreamboxip:31320

load it in to the twonkymedia.db... rescan.. check you can see it in the PVconnect software..

Now for the interesting bit..

4. rewrite streamts...

Ok it turns out that the twonky proxy is expecting a "content type" response from the streamts inetd server to initate streaming or else it just gives up with a 404 code... you can see this in the twonky logs if you highlight html option...

streamts only respons with a hTTP 1.1 200 OK and Server: ... no content type.... bugger....

4 hours later having installed VM debian etch.. openembedded .. monotone.. bitbake.. load of web site tutorials... setting up environments.. etc. and I have added the content type: video/mpeg to the response line and recomplied streamts...but now as pstreamts... (PM me if you want a copy) That was the easy bit !

ftp this to the dreambox /usr/sbin folder

change the script stream.sh to point to pstreamts instead of the old one...

fire up VLC... copy and paste the twonky proxy link from pvconnect ie.. http://192.168.2.102:9001/httpproxy/vid ... /TEST.mpeg

VLC starts no problem.. streams perfectly.. yes !

twonky logs confirm http loop in progress and the content type of video/mpeg

5. Now for the big test, the PS3.

clicked the "Test" playlist icon in the twonky server video menu... waited.. waited a little longer... corrupt data... bugger...

tried it again.... streaming like a baby...oh yeah... (I put the inital corruption down to a wireless link between the PS3 and the router upstairs) so far seems to work well apart from the occasional corrupt data..

Now if only sony would fix the TS streaming problem...

Anyway this was more just to see if it could be done then anything else.. now I know it can I'll spend some more time on pstreamts and the scripts... maybe even release something ... who knows..but this proves it possible..

Flipit

Locked