Kodi Community Forum

Full Version: XBMC Video Server: stream/download your library contents
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
snatch22 Wrote:What I don't understand is if it was a bug in xbmc -- why would downloading or streaming on the same machine the server is running on work perfectly every time?

It is XBMC that operates the web server that serves these files (whether you're streaming or downloading), so if it doesn't work it's most likely a bug in XBMC.

Regarding Madsonic I'm not sure if this will be able to replace that, it seems focused on transcoding music (which this application doesn't concern itself with at all)?
(2014-03-24, 04:15)snatch22 Wrote: [ -> ]The download or stream will always begin, and then abruptly stop downloading (with a broken file resulting) or just no more visible stream. Occasionally the entire thing will complete, but very very rarely. What I don't understand is if it was a bug in xbmc -- why would downloading or streaming on the same machine the server is running on work perfectly every time? Isn't it more likely it has something to do with serving the file over the internet?

To clarify, streaming over the internet or even lan over wifi essentially does not work, same machine always works.

Anyway I'll have to format my computer sometime soonish and I'll reinstall at that point.. here's hoping this problem goes away Sad

Transcoding will really be awesome though, great to hear it is coming along well. I'd love to replace my Madsonic server altogether.

I'm seeing the same thing, on latest Gotham Beta.. I can stream everything flawlessly through to any computer via cable, but wi-fi or internet is very unstable. Mostly it holds for 5-7 seconds(like 96% of the time), but ive been able to watch up to 1 hour of a film before it cut off. This goes for everything from SD to 1080p mkv's. Kinda makes me think its unstable wi-fi, but why would wi-fi affect internet streaming? thats just cable all the way :/
Going to format my computer now and see if that solves anything, its about time anyways =)
Please let me know if it does, or if you find a solution!
Could you all try if using a reverse proxy helps? There are instructions on the wiki. What it means is you will be requesting traffic from Apache (the web server that runs this application) which will then forward the request to XBMC.
Format complete, setting things up now.. but I cant for the life of me figure out where I configure the reverse proxy thingy? where is this path on windows? "/etc/apache2/sites-available/default"??

Also should I change apache's/xbmc's ports? Theres nothing in the guide suggesting I should, but I see people recommend it here?


EDIT:
Found it \xampp\apache\conf\extra\httpd-vhosts.conf

Code:
##<VirtualHost *:80>
    ##ServerAdmin [email protected]
    ##DocumentRoot "C:/xampp/htdocs/dummy-host2.example.com"
    ##ServerName dummy-host2.example.com
    ##ErrorLog "logs/dummy-host2.example.com-error.log"
    ##CustomLog "logs/dummy-host2.example.com-access.log" common
    AllowEncodedSlashes On

    <Location /xbmc-vfs>
        ProxyPass http://xxxxxxxx.no-ip.biz:8080/vfs
        ProxyPassReverse http://xxxxxxxx.no-ip.biz:8080/vfs
        RequestHeader set Authorization "Basic eGJtYzp4Ym1j"
    </Location>
##</VirtualHost>

Is the above correct? Or should I have some other authorization thingy? And if so how do I generate my own based on my user/pw? Sorry.. never done anything web/server related like this before, and never used linux.. So i'm a complete noob^^
Actually, it _seems_ to be working now.. I was on a f'ed up old version of windows8 that couldnt be upgraded for some reason, but I formated and installed 8.1. Atm I'm streaming a 720p episode over wi-fi, and my gf is streaming a 1080p movie to her place. Neither of those things used to work for more then 7 seconds, tho it sometimes held for up to one hour. So I guess I just have to run a lot of tests to be sure.

It seems to be fixed tho, I hope so =)

Never got the proxy thing to work, the instructions werent very windows-userfriendly.. but if this works now I probably wont bother to make it work anyways.
@Darre: Sorry about the instructions, I've been developing this on Linux so documentation for Windows has always taken a back seat. You seem to be almost there though, the only thing you need to do is remove the ## from the <VirtualHost> lines. The Authorization header is your username and password encoded as Base64, e.g. base64(johnConfusedmith) if that's your user:pass combination. You can find Base64 encoders all over the internet, just Google for it. The example in the wiki uses the default xbmc:xbmc, which is eGJtYzp4Ym1j in Base64.

It would be kind if you could report back whether the thing really works after some testing!
Allright I'll look into it later tonight =)

The problem came back here, cuts off randomly after a short play. Ive discovered tho that having Skype active seems to break it, at least the problem started again when I launched skype on my laptop (the stream even stopped from my server to my gaming PC after a while). Tried rebooting everything including router and switch - the problem persisted, but after I exited skype on the laptop and then started streaming to my laptop and to my gaming PC, both streams have been working fine. As soon as I launched skype there was a lot of artifacts in the movies, so it was at least having some kind of impact..

I suspect that the fact that I use port 80 for apache might have something to do with this.. Guess I will try both changing apache ports, and try to enable the reverse proxy. Any suggestion for good apache/xbmc ports(ranges) are welcome. I think I saw a post here earlier, Ill have a closer look later.

And thanks for beein so helpful, I really appreciate it.. Of course Ill report any solution I find =)
That could very well be related, Skype likes to use port 80 for God knows what. You can easily change the pirt XBMC and/or Apache listens on to see if the problwm goes away.

And oh yeah, there's no such thing as "good port ranges", you use whatever is free and easily rememberable.
It seems Skype was the culprit here actually.. Changed the port of Apache to something else and Skype doesn't seem to affect video-quality anymore, tho I have not tested with a conversation active. Earlier just launching skype created artifacts in the video, and just to be clear I'm on a 25/25, and skype uses like .2, so its not a bandwidth issue. Skype used to distort, and sometimes kill the videostream, and if I tried to resume it with skype running on the computer it would 95% of the time just get killed after 3-7 seconds. It seems having skype running on my laptop actually was able to mess up the stream from my backend to my gaming PC..? Guess changing ports was a good idea at least =)

Dont know where to run this command from tho:

"After saving the file also have to run sudo a2enmod headers proxy_http && sudo service apache2 restart." ?

Remember that sudo from playing with linux on my RasPi, guess its some other command in windows?
Tried just pasting it in the shell from apache dir, but that did nothing.. So for now I can't use the proxy thingy, it seems like ive done things correctly, but it tries to play the files through the port I specified for Apache, instead of the port used by XBMC, and the file wont play. Once I remove the proxy from backend settings it reverts to the xbmc port, and things work again.
I'll have to update the instructions for Windows, the commands for Linux obviously don't apply here. I think I'll also remove some of the explanation regarding what it's about from the README, I'll add a link to this thread instead.

@Darre: what those commands to is tell Apache to load two modules (headers and proxy_http). You can achieve the same effect by finding a configuration file with a bunch of LoadModule lines (you'll have to search, I don't know the path on Windows). If you see a hashtag (#) before the line that says something about headers or proxy_http, remove the hashtags and then restart Apache. That way the modules should be loaded and the reverse proxy thing should work.
LoadModule headers_module modules/mod_headers.so
LoadModule proxy_http_module modules/mod_proxy_http.so

Found these two, located in "xampp\apache\conf\httpd.conf", the proxy one had a # in front of it. Removed the #, and now it seems to work Big Grin Gonna make a skype videocall to stresstest now.

Also to be clear, this was an issue with using port 80, mostly because of Skype I guess.. It worked without reverse proxy as well, but I will keep using it from now on.

Feel free to use any findings I have made to help other windows-noobs in your how-to =)

edit: Watched 3x20min episodes while having a skype videochat active, no problems with quality or episodes cutting off for either of us =)
@Darre great to hear you got it working! I had no idea Skype could complicate things like that.
I found it strange as well, its like it said "port 80 is mine, and I'm gonna sabotage any and all communication on that port, even when I don't use it myself."
Guess you should put up some kind of warning in the windows part that this MAY happen.. and that they should change port 80 to something random. Because this may very well just be a problem in my setup, but I tried 3 laptops outside my house, all with Skype - and it didn't work. 3 computers in my house, and only the one without Skype seemed to work - tho streaming to it was also interrupted after a while if Skype was active on my laptop. Streaming without Skype worked flawlessly in all scenarios, so I changed the port and the problem just disappeared.

Thanks for this, its really great when I go out of town and want to watch stuff.. instead of having to copy some of it to my laptop before I leave, I can now just watch whatever I want - love it Big Grin

If you need any more info or help just say so, and Ill gladly provide logs or paths for windows. Tho I think I've shared most of the problems I ran into here - and the solutions.