Play V-PID and A-PID TS-Stream!

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Closed
GeminiServer Offline
Senior Member
Posts: 174
Joined: Oct 2003
Reputation: 0
Post: #16
1. i send the changes for mplayer.cpp to cvs

script to switch [zap] to the channel and stream it..


Quote:############################################################
# xbmc dreambox-tv v0.1 [geminiserver]
#
# informations:
# zapto:
# 192.168.0.110/cgi-bin/zapto?path=1:0:1:6dca:44d:1:c00000:0:0:0:
############################################################

import urllib, time, xbmc, xbmcgui
from htmlparser import htmlparser

action_previous_menu = 10
action_select_item = 7

url = 'http://192.168.0.110' # this ist the ip adress from dreambox
port = ':31339' # this is the port to stream from
zapcod = '/cgi-bin/zapto?path=' # this si the url zap code to initialize the zap

zapch = '1:0:1:6d66:437:1:c00000:0:0:0:' # this is the channel to zap in
vpid = '6e' # this is the vpid from switched channel
apid = '78' # this is the apid from switched channel

#zap to the channel
urlzap = url+zapcod+zapch
fp = urllib.urlopen(urlzap)
data = fp.read()
fp.close()

# play the zapped channel
file = url+port+'/'+vpid+','+apid
xbmc.player().play(file)

py download: dreambox_playtest.py
for this script you need to edit the vpid, apid, the channel.. currently.. i will implement the rest.. after i study the python scripting tech Wink

here are some screen shot streaming from the dreambox
[Image: screenshot001.gif]

[Image: screenshot002.gif]

[Image: screenshot003.gif]



next todo:
1. get and build complete channel list

i need also one who can verifie this for dbox! so guys with dbox2.. send me am mail "melih@gmx.li" or pm me

regards
geminiserver

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find
kaisersose Offline
Member
Posts: 70
Joined: Apr 2004
Reputation: 0
Post: #17
great work geminiserver, it looks great.

with my router, the ip for the dreambox is 192.168.1.4 and i take it that the channel you are using is zdf from 19e and not 13e. so would the script just have to be changed to this for me or am i totally wrong and there is other stuff that has to be changed( anyways the script just runs and stops) :

here is the error that comes up when i press the white button after the script stops:
ioerror: [ermo(? cant make it out) socket error] (10061, " connection refused")

also theres no apid for zdf on 19e at the moment according to my dreambox, so what should i put in instead)


############################################################
# xbmc dreambox-tv v0.1 [geminiserver]
#
# informations:
# zapto: 192.168.1.4/cgi-bin/zapto?path=
#
# service reference: 1:0:1:6dca:44d:1:c00000:0:0:0:
# reftype:refflags:dvb_service_type:dvb_service_id:dvb_transportstream_id
# :dvb_original_network_id:dvb_namespace:unused:unused:unused
############################################################

import urllib, time, xbmc, xbmcgui
from htmlparser import htmlparser

action_previous_menu = 10
action_select_item = 7

url    = 'http://192.168.1.4' # this ist the ip adress from dreambox
port   = ':31339'   # this is the port to stream from
zapcod = '/cgi-bin/zapto?path=' # this si the url zap code to initialize the zap

zapch  = '1:0:1:6d66:437:1:c00000:0:0:0:' # this is the channel to zap in
vpid   = '6e' # this is the vpid from switched channel
apid   = '78'   # this is the apid from switched channel

#zap to the channel
urlzap = url+zapcod+zapch
fp = urllib.urlopen(urlzap)
data = fp.read()
fp.close()

# play the zapped channel
file = url+port+'/'+vpid+','+apid
xbmc.player().play(file)


any info on what i am doing wrong would be much appreciated.

ps: probably a stupid question but would it be ever possible to record the stream on to the xbox hardrive as i dont have a harddrive for my dreambox!
find
GeminiServer Offline
Senior Member
Posts: 174
Joined: Oct 2003
Reputation: 0
Post: #18
hi,
the mplayer change is on cvs, i have verified the last cvs build and it works! so everbody should able to stream from dreambox and dbox2!

i have now write a little script, it only streams the current channle on dreambox, no ui no msg.. just stream to that zappen channel! this script does not zap to that channel, you need to do it manual over remote or web interface!

download here: dreambox-tv v0.23.py

here is the source:
Quote:################################################################
# xbmc geminiserver dreambox-tv v0.23
#
# informations:
# get the current stream info:
# http://192.168.0.110/cgi-bin/streaminfo?requester=webif
#
# set audiopid:
# http://192.168.0.110/cgi-bin/setaudio?audio="+audiopid
#
# zapto:
# 192.168.0.110/cgi-bin/zapto?path=1:0:1:6dca:44d:1:c00000:0:0:0:
#################################################################
# next to do:
# - is to make better vapid detection
# - receive all channels an bouquets
# - analyse an create the channel list..
# - create zapto
# - create ui
#
# comments:
# - this is my first python script guys..
# - if some one own a dreambox and good in python..
# he is welcome to help to create..
#
# installation:
# - copy this py to [xbmc]\scripts\dreambox-tv\*.*
# - 1. this script only stream the current running channel
# - 2. do not switch chnl on dreambox during streaming
# - 3. some chnls can't be stream [don't know why!! dream bug!]
#################################################################

import xbmc, xbmcgui, os, urllib, time, string, stringio, re
from htmlparser import htmlparser

# please add here your dreambox settings
ip = '192.168.0.110'
user = 'root'
password = 'dreambox'

# xbmc ui settings
action_previous_menu = 10
action_select_item = 7

#global settings
port = ':31339'
url = 'http://'+user+':'+password+'@'+ip
tmp_html = 'q:\\scripts\\dreambox-tv\\dreambox-tv.html'
#tmp_html = 'dreambox-tv.html'
tmp_line = 'q:\\scripts\\dreambox-tv\\new.txt'
#tmp_line = 'new.txt'
tmp_strm = 'q:\\scripts\\dreambox-tv\\dreambox-tv.strm'
#tmp_strm = 'dreambox-tv.strm'
flocvpid = 'vpid: 0x'
flocapid = 'apid: 0x'

# lets try to connect to the dreambox!
def tryopenurl(url):
try:
fp = urllib.urlopen(url)
data = fp.read()
fp.close()
start_stream(data)
except:
#message('unable to connect to the dreambox!')
print '\nunable to connect to the dreambox!'
print 'or there is another problem...'
return ''

def start_stream(data):
print '1.opening the dreambox url:'+url
# write the start page to the local file
fpx = open(tmp_html,'w')
fpx.write(data)
fpx.close()

print '2.created the tmp file: dreambox-tv.html'
# extract the information to a new file
f = open(tmp_html,'r')
o = open(tmp_line,'w')
newlines = []
for line in f:
while 'vpid' in line:
#print "gefunden \n"
newlines.append(line)
x = line
#print x
o.writelines(line)
break
f.close()
o.close()

print '3.finding the apid and vpid line'
# extract the vpid and apid locations
o = open(tmp_line,'r')
a1 = o.readline()
cc = a1
locvpid = str(re.search(flocvpid, cc).span())
locapid = str(re.search(flocapid, cc).span())
o.seek(0)
a2 = o.readline()
o.close()

print '4.define the apid and vpid location'
# define the vpid and apid locations
locvpid_x = locvpid[1:4]
locvpid_y = locvpid[6:9]
locapid_x = locapid[1:4]
locapid_y = locapid[6:9]

print '5.define exact apid and vpid value'
# define the ecaxt vapid loc value
locvpid_y = int(locvpid_y)
locapid_y = int(locapid_y)

boost_dreambox_tv(a2,a2,locvpid_y,locapid_y)


# find and set the ecaxt vpid&apid value
def boost_dreambox_tv(f_vpid,f_apid,lvpid,lapid):
# this is for the latest dreambox web interface
lvpidy = int(lvpid) + 3
lvpidx = int(lvpid) + 2
if f_vpid[lvpidy] == '&':
fok_vpid = f_vpid[lvpid:lvpidy]
elif f_vpid[lvpidx] == '&':
fok_vpid = f_vpid[lvpid:lvpidx]
#this is for the older dreambox web interface!
elif f_vpid[lvpidy] == '<':
fok_vpid = f_vpid[lvpid:lvpidy]
elif f_vpid[lvpidx] == '<':
fok_vpid = f_vpid[lvpid:lvpidx]

lapidy = int(lapid) + 3
lapidx = int(lapid) + 2
if f_apid[lapidy] == '<':
fok_apid = f_apid[lapid:lapidy]
elif f_apid[lapidx] == '<':
fok_apid = f_apid[lapid:lapidx]

file = url+port+'/'+fok_vpid+','+fok_apid
print '6.got the vpid:'+fok_vpid
print '7.got the apid:'+fok_apid
print '\n\ncreated the play string \n-->'+file+'\nok! then lets try to stream!'
xbmc.player().play(file)

# just write the strm file.. only for testing!
print '\n\nwell the stream works.. \nthen lets write a sample stream file!'
print '\nregards\ngeminiserver;)'
strm = open(tmp_strm,'w')
strm.write(file)
strm.close()

# main!
tryopenurl(url)

regards
geminiserver

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find
kaisersose Offline
Member
Posts: 70
Joined: Apr 2004
Reputation: 0
Post: #19
im gettin this error:
('unable to connect to the dreambox!')
or there is another problem...'

any idea what the problem might be, i have the right ip settings for the dreambox anyways but im havent a clue what to do to get it workin now. is there some program i gotta have running on the dreambox first or something?
find
Mausman Offline
Junior Member
Posts: 33
Joined: Jun 2004
Reputation: 0
Post: #20
looks great and commplete, but..........
i ran the script and filled in the right ip and port and nothing!
it says for a second running but nothing.

does anyone know why ? i do have a cvs build 8-7-04

:kickass:
find
Sam Offline
Junior Member
Posts: 13
Joined: Jul 2004
Reputation: 0
Post: #21
thank you so much for starting this nice mod :kickass: i don´t have a dreambox so does anybody tried out if it works on a dbox2 , too?
find
pathetic Offline
Junior Member
Posts: 21
Joined: Jul 2004
Reputation: 0
Post: #22
i own a phillips and a nokia dbox2 and i'll test it later this evening. i'm interested in helping you out to make a more comfortable way to record. maybe something like jack the grabber would be nice. i don't knwo about python but i'm a professinal programmer so maybe i can help.

i'll send a test report later.

thx guys :o
find
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 10
Location: Sweden
Sad   
Post: #23
(pathetic @ july 13 2004,19:00 Wrote:...don't knwo about python but i'm a professinal programmer so maybe i can help.
maybe you and geminiserver can work together to port the script to c++ for native xbmc integration :o hint, hint, wink, wink Wink

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find
Mausman Offline
Junior Member
Posts: 33
Joined: Jun 2004
Reputation: 0
Post: #24
is there someone out there who has it working on a dreambox?
i tried everything, but the xbox just says (running) and then............ nothing.

:bomb:
find
GeminiServer Offline
Senior Member
Posts: 174
Joined: Oct 2003
Reputation: 0
Post: #25
@gamester17
well if dreambox-tv should be a part or a feature for the next official xbmc release, why not! but we need then a ok for the implementation, so then wen can dev in c++ instead of using the python!

@mausman
you need the latest cvs release also your dreambox should support the stream!

regards
geminiserver

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find
pathetic Offline
Junior Member
Posts: 21
Joined: Jul 2004
Reputation: 0
Post: #26
hi,
i just tried to connect to my dbox2 but the script doesnt work.
i simply does nothing, "running" is flashing shortly a nothing to see ... do i need a special dbox2 version - i dont have any cgis on it.
i'm using on of the latest yadi images and xbmc 07/10/04
any suggestions ?
find
pathetic Offline
Junior Member
Posts: 21
Joined: Jul 2004
Reputation: 0
Post: #27
... log says "unable to connect to the dreambox!"
i filled the ip correctly and also tried the stream on port 31339
in my browser an the stream opens,
might be some differences between dreambox and dbox2
find
GeminiServer Offline
Senior Member
Posts: 174
Joined: Oct 2003
Reputation: 0
Post: #28
!!!! this script works only on dreambox !!!!
the script for dbox2 will follow after i finished the dreambox port! currently i can only dev and test on dreambox. i have no dbox2, if some one have a dbox2 for me i can also create for that one or some who own a dbox2 + xbox and has python experience he can use the above script to port the same for dbox2!

well here is the preview for next dreambox-tv release:
i had to finish the bouquet listing and switching.. need some evenings of my free time..
[Image: screenshot012.gif]

[Image: screenshot013.gif]

[Image: screenshot014.gif]

[Image: screenshot015.gif]

[Image: screenshot016.gif]

regards
geminiserver

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find
Mausman Offline
Junior Member
Posts: 33
Joined: Jun 2004
Reputation: 0
Post: #29
looks great! keep up the work.
can you tell me what program and what version you use ion the dreambox?
maybe it can help me and others out to find the solution of our problems with connecting.
also what codecs and versions do we have to use.

tia


:bowdown: :nuts: :bowdown:
find
pathetic Offline
Junior Member
Posts: 21
Joined: Jul 2004
Reputation: 0
Post: #30
hi,
really looks great - i'm trying o convert your script fro the dbox... something seem to be easier with the dbox ... ie if you want the pids from the actual channel
http://dbox/control/zapto?getpids
returns
105
106
so i changed the script so it get the current pids but xbmx.play doesnt get anything into buffer ...
what exactly are all these pid conversions - a short explanation would be nice
find
Thread Closed