xbmc.Player and playing strm with MPlayer
#1
i'm making a python script to watch tv from a french internet provider (only access for french people who are client)
the stream is rtsp format, but my script is a proxy to return the data stream on http.
this works like a charm... i start my proxy, then i can laucnh a .strm file containing the http url to the stream i want.
a couple of seconds later, the stream starts.
i f now, i want to launch the exactly same http adress using python xbmc.player stuff, it hangs, ang log respond
22:50:50 m: 35078144 info: loading web playlist http://xboxip:port/373
22:50:50 m: 35078144 info: get header url: http://xboxip:port/373

i can't figure why it is working with a strm file, but not from python script..
does someone have an idea ?
of coure, i think my proxy don't send a header... but i don't know why player from python hang on this, and why mplayer with a .strm file is just open it without any problem ??



Reply
#2
hi

none of you guys have an idea ?

works like a charm :
mystream.strm : http://mystreamserver:port/channel played with mplayer

does not work and hang :
xbmc.player().play("[url]http://mystreamserver:port/channel"[/url])

as a result i got an error saying
info: loading web playlist http://mystreamserver:port/channel
info: get header url: http://mystreamserver:port/channel
Reply
#3
what player does your log show is trying to load the stream? (dvdplayer or mplayer)

i'm sure you're aware of this change.

- 08-04-2006 added: pythonscripts can now decide what playcore to use. this allows playback of streams that mplayer does not support
example: xbmc.player(xbmc.player_core_dvplayer).play('.....');
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#4
no worries, my xbmc is from 13th of may.

before this date , it was not working at all because of thumbnail that mplaye rwas searching while laucnhing http request.

when i launch the strm file i got :
Quote:23:09:20 m: 34271232 info: loading web playlist http://127.0.0.1:8083/373
23:09:20 m: 34271232 info: get header url: http://127.0.0.1:8083/373

[...] then i got my "rtsp to http" proxy answering to the request

23:09:20 m: 33714176 error: invalid reply from server
23:09:20 m: 33742848 notice: url http://127.0.0.1:8083/373 not found
23:09:20 m: 33742848 debug: capplication::processandstartplaylist(e:\freeboxtv\009 - w9.strm, 2)
23:09:20 m: 33742848 debug: cplayercorefactor::getplayers(http://127.0.0.1:8083/373)
23:09:20 m: 33591296 debug: kernel32.dll fake function disablethreadlibrarycalls called
23:09:20 m: 33554432 info: xcurl::dlllibcurlglobal::easy_aquire - created session to http://127.0.0.1
23:09:20 m: 33554432 info:
23:09:20 m: 33554432 debug: curl:: debug about to connect() to 127.0.0.1 port 8083
23:09:20 m: 33554432 debug: curl:: debug trying 127.0.0.1...
23:09:20 m: 33554432 debug: curl:: debug connected
23:09:20 m: 33554432 debug: curl:: debug connected to 127.0.0.1 (127.0.0.1) port 8083
23:09:20 m: 33554432 debug: curl:: debug head /373 http/1.1

user-agent: xbmc/2.0.0 (compatible; msie 6.0; windows nt 5.1; winampmpeg/5.09)

host: 127.0.0.1:8083

accept: */*
23:09:20 m: 33554432 debug: curl:: debug http/1.0 200 ok
23:09:20 m: 33554432 debug: curl:: debug content-type: application/octet-stream
23:09:20 m: 33554432 debug: curl:: debug cache-control: no-cache
23:09:20 m: 33554432 debug: curl:: debug closing connection #0
23:09:20 m: 33554432 debug: filecurl::close(d00a1904) http://127.0.0.1:8083/373
23:09:20 m: 33554432 info: loading skin file: dialogprogress.xml
23:09:20 m: 33144832 info: mplayer play:http://127.0.0.1:8083/373 cachesize:4096
23:09:21 m: 26931200 debug: msg: set audio functions called
23:09:21 m: 26931200 debug: msg: done
23:09:21 m: 26931200 info: flipping bi-directional subtitles disabled
23:09:21 m: 26931200 debug: msg: mplayer_init()
23:09:21 m: 26931200 debug: msg: enable mplayer osd
23:09:21 m: 26931200 debug: msg: mplayer dev-cvs-060420-17:33-3.4.4 © 2000-2004 mplayer team
23:09:21 m: 26931200 debug: msg: cpu: intel celeron 2/pentium iii coppermine,geyserville
23:09:21 m: 26931200 debug: msg: (family: 6, stepping: 10)
23:09:21 m: 26931200 debug: msg: detected cache-line size is 32 bytes
23:09:21 m: 26931200 debug: msg: cpuflags: mmx: 1 mmx2: 1 3dnow: 0 3dnow2: 0 sse: 0 sse2: 0
23:09:21 m: 26931200 debug: msg: compiled for x86 cpu with extensions:
23:09:21 m: 26931200 debug: msg: mmx
23:09:21 m: 26931200 debug: msg: mmx2
23:09:21 m: 26931200 debug: msg: sse
23:09:21 m: 26931200 debug: msg:
23:09:21 m: 26918912 debug: msg:
23:09:21 m: 26918912 error: emulated function dll_fgets failed
23:09:21 m: 26931200 debug: curl::curl - url has no protocol config, empty curl created
23:09:21 m: 26931200 debug: msg: creating config file: q:\system\players\mplayer\config
23:09:21 m: 26918912 debug: msg:
23:09:21 m: 26918912 error: emulated function dll_fgets failed
23:09:21 m: 26574848 error: emulated function dll_fgets failed
23:09:21 m: 26574848 debug: msg: 88 audio & 199 video codecs
23:09:21 m: 25591808 error: emulated function dll_fgets failed
23:09:21 m: 25550848 debug: msg: mplayer_open_file(http://127.0.0.1:8083/373)
23:09:21 m: 25550848 info: stating file http://127.0.0.1:8083/373.conf
23:09:21 m: 25550848 info: stating file q:\system\players\mplayer\373.conf
23:09:21 m: 25554944 debug: msg: playing http://127.0.0.1:8083/373.
23:09:21 m: 25554944 debug: msg: find subtitles
23:09:21 m: 25554944 debug: msg: auto open z:\subtitle
23:09:21 m: 25554944 debug: msg: protocol:http
23:09:21 m: 25554944 debug: msg: open stream protocol:http
23:09:21 m: 25534464 debug: msg: connecting to server 127.0.0.1[127.0.0.1]:8083 ...
23:09:21 m: 25010176 debug: msg: cache size set to 4096 kbytes
23:09:21 m: 25010176 debug: msg: connected to server: 127.0.0.1
23:09:21 m: 20254720 debug: msg:
cache fill: 0.00% (0 bytes)

[...]cache process...

23:09:25 m: 20885504 info: xcurl::dlllibcurlglobal::checkidle - closing session to http://127.0.0.1
23:09:25 m: 20918272 debug: msg:
cache fill: 18.75% (786432 bytes)
23:09:25 m: 20918272 debug: msg:
cache fill: 18.75% (786432 bytes)
23:09:25 m: 20918272 debug: msg:
cache fill: 18.75% (786432 bytes)
23:09:25 m: 20918272 debug: msg:
cache fill: 18.75% (786432 bytes)
23:09:25 m: 20918272 debug: msg:
cache fill: 18.75% (786432 bytes)
23:09:25 m: 20918272 debug: msg:
cache fill: 18.75% (786432 bytes)
23:09:25 m: 20918272 debug: msg:
cache fill: 18.75% (786432 bytes)
23:09:25 m: 20918272 debug: msg:
cache fill: 18.75% (786432 bytes)
23:09:25 m: 20918272 debug: msg:
cache fill: 18.75% (786432 bytes)
23:09:25 m: 20918272 debug: msg: ts file format detected.
23:09:25 m: 20918272 debug: msg: demux open, audio_id: -1, video_id: -1, subtitle_id: -1,
23:09:25 m: 20815872 debug: msg: probing up to 2000000, prog: 0
23:09:29 m: 20815872 debug: msg: video mpeg2(pid=68)...
23:09:29 m: 20815872 debug: msg: audio mpa(pid=69)
23:09:29 m: 20815872 debug: msg: no subs (yet)!
23:09:29 m: 20815872 debug: msg: program n. 1
23:09:29 m: 20815872 debug: msg: opened ts demuxer, audio: 50(pid 69), video: 10000002(pid 68)...pos=752
23:09:29 m: 19664896 debug: msg: video: mpeg2 720x576 (aspect 2) 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
23:09:29 m: 19664896 debug: msg: starting lookup for subs
23:09:29 m: 19664896 debug: msg: global subsize: 0 - vobsub: -1, demux: -1, subs: -1
23:09:29 m: 19664896 debug: msg: global subpos : -1
23:09:29 m: 19664896 debug: msg: ==========================================================================
23:09:29 m: 19664896 debug: msg: opening audio decoder: [mp3lib] mpeg layer-2, layer-3
23:09:29 m: 19595264 debug: msg: audio: 48000 hz, 2 ch, 16 bit (0x10), ratio: 32000->192000 (256.0 kbit)
23:09:29 m: 19595264 debug: msg: selected audio codec: [mp3] afm:mp3lib (mp3lib mpeg layer-2, layer-3)
23:09:29 m: 19595264 debug: msg: ==========================================================================
23:09:29 m: 19595264 debug: cxboxrendermanager::preinit - selected rgb-renderer
23:09:29 m: 19070976 debug: msg: opening video filter: [pp=ci]
23:09:29 m: 19070976 debug: msg: ==========================================================================
23:09:29 m: 19070976 debug: msg: opening video decoder: [mpegpes] mpeg 1/2 video passthrough
23:09:29 m: 19070976 debug: msg: vdec: vo config request - 720 x 576 (preferred csp: mpeg pes)
23:09:29 m: 19070976 debug: msg: [pp] using external postprocessing filter, max q = 6.
23:09:29 m: 19070976 debug: msg: could not find matching colorspace - retrying with -vf scale...
23:09:29 m: 19070976 debug: msg: opening video filter: [scale]
23:09:29 m: 19070976 debug: msg: the selected video_out device is incompatible with this codec.
23:09:29 m: 19070976 debug: msg: vdecoder init failed Sad
23:09:29 m: 19070976 debug: msg: opening video decoder: [libmpeg2] mpeg 1/2 video decoder libmpeg2-v0.4.0b
23:09:29 m: 17821696 debug: msg: selected video codec: [mpeg12] vfm:libmpeg2 (mpeg-1 or 2 (libmpeg2))
23:09:29 m: 17821696 debug: msg: ==========================================================================
23:09:29 m: 17821696 debug: msg: checking audio filter chain for 48000hz/2ch/16bit -> 48000hz/6ch/16bit...
23:09:29 m: 17821696 debug: msg: af_pre: af format: 2 bps, 2 ch, 48000 hz, little endian signed int
23:09:29 m: 17821696 debug: msg: af_pre: 48000hz 2ch signed 16-bit (little-endian)
23:09:29 m: 17801216 debug: msg: ao: [win32] 48000hz 2ch signed 16-bit (little-endian) (2 bps)
23:09:29 m: 17801216 debug: msg: building audio filter chain for 48000hz/2ch/16bit -> 48000hz/2ch/16bit...
23:09:29 m: 17731584 debug: msg: starting playback...
23:09:29 m: 17731584 debug: msg: mplayer_open_file(http://127.0.0.1:8083/373) done 1.0000
23:09:29 m: 17629184 debug: activating window id: 12005
23:09:29 m: 21479424 debug: playback has started
23:09:29 m: 21680128 info: loading skin file: videofullscreen.xml
23:09:29 m: 21680128 notice: start led control
23:09:29 m: 22204416 notice: led control: playing video led is switched off!
23:09:29 m: 22204416 info: loading skin file: videoosd.xml
23:09:30 m: 21614592 info: loading skin file: videoosdsettings.xml
23:09:30 m: 20905984 info: loading skin file: videoosdsettings.xml
23:09:30 m: 20443136 debug: msg: vdec: vo config request - 720 x 576 (preferred csp: planar yv12)
23:09:30 m: 20467712 debug: msg: [pp] using external postprocessing filter, max q = 6.
23:09:30 m: 20467712 debug: msg: vdec: using planar yv12 as output csp (no 0)
23:09:30 m: 20467712 debug: msg: movie-aspect is 1.33:1 - prescaling to correct movie aspect.
23:09:30 m: 18841600 debug: msg: vo: [directx] 720x576 => 768x576 planar yv12
23:09:30 m: 18857984 notice: display resolution auto : pal 4:3 (6)
23:09:30 m: 17199104 info: created yuv texture
23:09:30 m: 16535552 debug: created yv12 texture 0
23:09:30 m: 16793600 debug: msg: ffrw:normal play
23:09:30 m: 16134144 debug: cguiinfomanager:Confusedetcurrentmovie(http://127.0.0.1:8083/373)
23:09:30 m: 15519744 debug: cvideodatabase::getmovieinfo(http://127.0.0.1:8083/373), query = select * from movie join path on movie.idpath = path.idpath join movieinfo on movie.idmovie = movieinfo.idmovie join files on movie.idmovie = files.idmovie where (path.strpath like 'http://127.0.0.1:8083' and files.strfilename like '/373') or path.strpath like 'stack://http://127.0.0.1:8083'
23:09:30 m: 14995456 debug: streaming media detected... using e:\freeboxtv\009 - w9.strm to find a thumb
after at least 10minutes of playing stream just fine, no more logs, neither xbmc nor my proxy have something to say in debug log. it juste play fine, i've got commands.

for my attempts with python, i tryed to leave the player() to use default player, i tryed the dvdplayer and the mplayer (others are audio players only i think.)

i really hope someone could explain this difference...
Reply
#5
no help, but the following does work. i couldn't find an html stream that would play as a stream file.

Quote:import xbmc

xbmc.player().play("http://www.ontoptv.com/asx/ontoptv.asx")
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#6
this one works like a charm...
no, i definetly think my script needs to send a header or something...
but i don't understand why it does not work the same inside python and from the video screen...
someone else ?
any xbmc devs maybe can have a look inside the xbmc code to know what difference may occur... ?
Reply
#7
your log shows

Quote:user-agent: xbmc/2.0.0 (compatible; msie 6.0; windows nt 5.1; winampmpeg/5.09)

as your header.

launchbrowser uses one if you need an example.

edit: m_struseragent = "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1)";



For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#8
this http-header is the one returned by mplayer when launching the stream from the 'video' screen.
so you think i should try to set a user-agent in my script before opening the stream with python player() ?

i will test it as soon as i get back home tomorrow evening.
Reply
#9
in launchbrowser, http-header seems to be only used for urllib2 to get http datas.
any other idea ?
Reply
#10
up to make you know that the problem is not solved...

maybe it is not possible, but what i would love to know, is why from python or from "my video" screen, behaviour is different...
Reply
#11
hi !

no success...

these are my tests results :

from 'my video' screen :
- .strm file with http://127.0.0.1:8083/201 inside : works
- .m3u file with http://127.0.0.1:8083/201 inside : works

from python script :
- xbmc.executehttpapi('playfile(http://127.0.0.1:8083/373)') : works
- xbmc.executebuiltin("xbmc.playmedia(http://127.0.0.1:8083/373)") : works
- xbmc.player().play("[url]http://127.0.0.1:8083/373"[/url]) : does not work
- xbmc.player().play(myfolder+"mystream.strm") : does not work


can really someone think about that, because i definetly thin it is a bug...



Reply
#12
does xbmc.player().play(filename.strm) work?



For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#13
no ! it does not !

(post edited now)
Reply
#14
i don't even want to mention this, but i will. Smile

it may sound stupid, but could python have problems with proxies? can you enter the xbox's ip instead of 127.0.0.1.

if stupid i will delete.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#15
is the script available anywhere? i like to take a look at it and see if i can get it working.
Reply

Logout Mark Read Team Forum Stats Members Help
xbmc.Player and playing strm with MPlayer0