• 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 8
[REQUEST] 2012 London Olympics
#61
No luck with proxy either ... hmm. ... investigating further.
Reply
#62
(2012-07-30, 08:04)ailingcoot Wrote: It did play but only for about 7 seconds?

i had the 7 second buffer problem, but looking at the download i would suggest that you set the delay to 30 seconds OR pause the playback as soon as it starts.

My connection needed to "warm up" and the default 10 seconds wasn't long enough to get a decent enough buffer, hence the playback stopped at the end of the file. Pausing the playback or increasing the wait period allows my connection to get up to speed and download enough content so that xbmc cant get to the end of the file.

Reply
#63
(2012-07-30, 08:04)ailingcoot Wrote:
(2012-07-30, 01:01)dlake02 Wrote: @castalla

Debug log please ?
It did play but only for about 7 seconds?

Then your bandwidth is not high enough for the stream quality you've selected..... Outside the UK, you'll be VERY lucky to get anything above 1.2M working. Start low and work up. I had to go with 1296 and 25 seconds buffer pause.
Reply
#64
(2012-07-29, 05:07)dlake02 Wrote: OK - here goes.

I've built a script based on K-S-V's "AdobeHDS.php" for stream recorder that kicks-off a download to disk of the Olympics channel, and then plays it via XBMC. I've asked and asked and asked on XBMC forum if there is anyway to pipe the output from one program direct into DVDPlayer, but no answer.

So, the only way that I can think of doing this is to write to a file, and then have XBMC read it after a suitable gap (default is 10 seconds).

The plugin is here http://code.google.com/p/bbcsports-addon...ip&can=2&q=

So, install, setup your proxy, your stream quality (start LOW and work up - if the playing overtakes the downloading, the player will fail), set up a directory that has plenty of GIGs free to act as a temporary staging post for the flv file, and give it a whirl.

Adobe HDS uses HTTP, so don't expect to be able to get anything over about 800kbit/s quality if you're through a proxy. I have tested it in Windows and Linux from outside the UK.

This has been a real pain to put together - porting the Adobe HDS from PHP to Python took an age.

I can't find any information that gives me a programme schedule to scrape for the 24 channels - I'm in Vancouver for this week on business, so unlikely to find ANY time to support/adapt/fault-find this plugin. Code is open; feel free to contribute/fix/adapt.

Hey there dlake02,

I've made a few improvements to the code - I'll post it up tomorrow because my approach was somewhat bruteforced (it's 1 AM over here, just wanted to get things working before I went to bed), but I'll outline briefly what changes I made here.
  • Used a FIFO for the backing file where possible - this makes XBMC simply wait, buffering, if playback catches up with downloading
  • Use pyCURL for downloading, to enable persistent connections (urllib makes a new connection for every request, very slow)
  • Perform all downloads in a seperate thread, so as not to block on decoding
  • Read ahead as far as possible, as new fragments are available long before the bootstrap info is updated

All together, those changes have made playback amazingly smooth for me, should make things much better for everyone else too Smile

Also thought you might like to know, the FIFOs are a nice, simple way to let you pipe data into DVDPlayer. I've yet to find a convenient way to do this for Windows, more's the pity.
Reply
#65
(2012-07-30, 07:34)BlueCop Wrote: AddonScriptorDE: I was able to get those Akamai SecureHD streams working with help with KSV. He pointed me in the right direction for the token generation. Also that large data64 block is really a swf file encoded in the meta-data of the FLV file. It contains the action script that generates the tokens that KSV showed me how to generate.

It works by just downloading the file locally and having xbmc play it as it downloads. It uses flvlib to read the onEdge blocks and sends the proper command to the server. I am just going to put together a script module that one can feed the stream url and swf url so it will start the stream playing in XBMC for you.

I was hoping for something better then saving the file locally but I couldn't work out a good way to feed it to XBMC Player.

Let me know if you are interested in trying what I have currently.

Edit:
I am actually making a modified version of XBMCLocalProxy from http://forum.xbmc.org/showthread.php?tid=95369

You basically base64 encode the video url of the stream and the url of the swf player to be used as parameters for the local proxy. The local proxy will then serve video to XBMC and handled all the tokens, signing and hashes for you.

It has to jump through a few hoops to get everything going. When XBMC connects we have to start the flv download to get the first onEdge dictionary. It uses the session and streamname values in the onEdge dictionary. It downloads the swf player to calculate an MD5 of the decompressed player. It will decompress the swf for you if it isn't already. That MD5 is appended to the sessionID. That string is then hmac sha1 signed and that digest is encoded to base64. This base64 balue is the x-Akamai-Streaming-SessionToken header value. It then sends the sendNewToken command to the correct streamname. The flv data is passed on to XBMC for playback. It will then continue to play and not drop after a short time.

Hopefully this will make it easier to use these streams with XBMC in the future.

I still need to work out a couple problems with content length being sent so XBMC doesn't think it is buffering a 2GB file. I also need to work on it properly shutting down the proxy server.
WOW!!! Absolutely awesome Smile You're incredible...
Many thanks to you and KSV to get this working!

When I read your first post with all the technical details, I thought this would never going to work... Really awesome!
After reading through this, I now understand whats going on there - But I would never get this working on my own...
It seems really tricky. Would be even better (but not possible?) to pipe it directly into xbmc somehow...

So, thanks again for working on this! I think more and more sites are using this so it helps alot for new addons too...
Good luck on fixing the last few problems...
Reply
#66
@predakanga

Great - please upload to this site and I'll take a look.

I asked and asked and asked for the FIFO details for DVDPlayer on the dev forum and got ZERO answers, so I really want to look at how to do this !

Thanks !
Reply
#67
predakanga: I too would like to see how you accomplished this. It sucks windows doesn't work. It sounds like a better solution to what I am trying to do.

AddonScriptorDE: I posted a the proxy code over here

I have been running the proxy process separate from XBMC right now. I couldn't get it to shutdown when needed in XBMC. I am not sure I know what I am doing. I need to learn more about threading in python.

I am curious if it would work for your Olympic streams.
Reply
#68
(2012-07-30, 16:27)dlake02 Wrote:
(2012-07-30, 08:04)ailingcoot Wrote:
(2012-07-30, 01:01)dlake02 Wrote: @castalla

Debug log please ?
It did play but only for about 7 seconds?

Then your bandwidth is not high enough for the stream quality you've selected..... Outside the UK, you'll be VERY lucky to get anything above 1.2M working. Start low and work up. I had to go with 1296 and 25 seconds buffer pause.
"Closed This channel has now ended?" Maybe I watched them at a wrong time ? Huh
Reply
#69
dlake02: I've uploaded my code to http://github.com/predakanga/bbcsports-addon (credit given to you of course, I just prefer working on github) - you can see the changes here

I've also implemented an untested method of piping data in Windows, using named pipes - if someone could give it a try, I'd appreciate it.

dlake02, BlueCop: You can see the FIFO/pipe code specifically here - the fifo code is really simple - create the fifo with mkfifo, then use it like a perfectly normal file. If you want to play with it, you can do it with simple shell utilities. For instance, this is how I normally stream things (XBMC's HTTP downloader has issues sometimes):

mkfifo ~/stream.flv
wget -O ~/stream.flv http://wherever.com/original_streaming_file.flv

Then simply play ~/stream.flv in XBMC (note, the download won't begin until you start playing it in XBMC)
Reply
#70
predakanga: Superb ! Thanks !

I'll test this out on Windows and Linux later today and then upload as a zipped installer for XBMC.

Thanks for the pointer to the pipe - that is EXACTLY what I had been trying to do from day 1 ! I can now start to use this on my Pluzz plugin as well.

D
Reply
#71
predakanga:

Not working for me on Win7. Just a script error at outset - doesn't even display stream listings
Reply
#72
(2012-07-31, 18:55)castalla Wrote: predakanga:

Not working for me on Win7. Just a script error at outset - doesn't even display stream listings

Exactly the same for me? Sad

Reply
#73
Not working in ubuntu either, error message out of the logfiles:

http://tinypaste.com/9ab503b4
Reply
#74
Just working on this now. There are formatting errors going to/from github, and lib pycurl doesn't seem to be included in the Windows XBMC build.

I've fixed the indentation errors - should have the pycurl up soon....
Reply
#75
So it seems that pycurl is NOT included with the standard Python build of XBMC Eden in Windows. That means that the "import pycurl" fails.

Assuming that XBMC was probably built from the latests Python, I downloaded the pycurl modules for Python 27 and moved across to the inbuilt Python in XBMC. It fails which means that XBMC was probably built using a different version of Python.

The documentation for XBMC 11 is rubbish - the page that talks about Python development is here http://wiki.xbmc.org/index.php?title=Python_development but is totally out-of-date.

Who knows how to implement PyCurl on Eden ?
Reply
  • 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 8

Logout Mark Read Team Forum Stats Members Help
[REQUEST] 2012 London Olympics 0