Page 1 of 1

Serviio on iOS: so close!

PostPosted: Mon Jun 23, 2014 6:38 pm
by mdb139
Hi,

I've been a Serviio user for several years, and have been quite happy with it -- using it primarily to stream my personal library of music and videos to various TVs throughout the house (via primarily Sony equipment).

I've recently been trying to get Serviio to play nicely with my iOS devices. I purchased Serviio PRO when it first came out, and never really had much use for the "Media Browser" app, and frankly am not crazy about using it for local playback. I'm hoping instead to be able to use AirPlayer (or another similar app).

So, I set up a profile in profiles.xml which should pick up the HTTP User-Agent of the AirPlayer app and basically transcode everything to an AppleHTTP stream. I'm not worried about audio right now as my entire library already plays natively on iOS.

  Code:
   <Profile id="airplayer_mobile" name="AirPlayer (Mobile)" extendsProfileId="1">
      <Detection>
         <HttpHeaders>
            <User-Agent>.*AppleCoreMedia.*</User-Agent>
         </HttpHeaders>
      </Detection>
      <Transcoding>
         <Video targetContainer="applehttp" targetVCodec="h264" targetACodec="aac" forceStereo="true" maxVBitrate="500" maxHeight="480">
            <Matches container="*" />
         </Video>
      </Transcoding>
   </Profile>


I tested the above from my local network, and after manually assigning the right profile to my device, it worked just fine in AirPlayer using the native (QuickTime) player. So far so good. (It's kind of annoying that I have to manually assign the correct profile, but I understand that is probably b/c AirPlayer is not identifying itself correctly at the appropriate time).

So, my next step was to expose Serviio through my firewall, which I basically got up and running using the following format:

http://<external IP>:8895/deviceDescription/<UUID from serviio.log>

I added this server to AirPlayer, and it connects over 3G - I can browse my entire library. Serviio sees the device, and I'm able to assign it the correct profile in the Serviio console. I'm able to play from my music library, but video does not play for some reason. Looking at the Serviio log, it looks like the connection gets reset for some reason:
  Code:
2014-06-23 12:40:37,817 DEBUG [ResourceTransportRequestHandler] HTTP/1.1 200 OK, headers = [[Content-Type: application/vnd.apple.mpegurl,Content-Length: 128,Date: Mon, 23 Jun 2014 16:40:37 GMT,Server: Windows 7, UPnP/1.0 DLNADOC/1.50, Serviio/1.4.1.2,Cache-control: no-cache,transferMode.dlna.org: Streaming,realTimeInfo.dlna.org: DLNA.ORG_TLAG=*]]
2014-06-23 12:40:52,749 DEBUG [WebServer] I/O error: Connection reset

The only thing I did on my firewall was open 8895 -- do I need to open another port for the AppleHTTP stream? Any other suggestions?

Thanks,
Matt

Re: Serviio on iOS: so close!

PostPosted: Tue Jun 24, 2014 9:31 am
by zip
The connection close is normally caused by the client closing it, so the player doesn't like something about the stream. you could check the m3u playlist (in the transcoding folder) to see what IP it uses for the playlist items and if that is available through the firewall.

Re: Serviio on iOS: so close!

PostPosted: Wed Jun 25, 2014 4:59 am
by mdb139
Hi Zip,

Does Serviio ever return relative URLs in the response to /serviceControl request messages? Here's why I'm asking...

I wrote a simple proxy that I intend to use between my iOS devices (using AirPlayer) and Serviio -- AirPlayer allows me to manually add a server via IP and to specify a login, and I pick up the login and pass it to Serviio with the requests in the User-Agent to force the device to correctly identify itself. (And by adding the server multiple times with different logins, I can request a specific profile to control quality -- so I have one profile for LAN and one for WAN).

Anyway...

This was a quick-and-dirty project that I worked on this evening, and I SWEAR that it was working -- I was watching URLs as they passed through the proxy, and happily watching video and listening to music. Then all of a sudden, none of my media would play. So I started inspecting the SOAP messages and I noticed that the URLs to the media are (now) all absolute, which means the player is bypassing the proxy. That's fine -- I can modify my proxy to change the URLs to relative ones if I must, but I'm wondering what would trigger the difference.

Any insight you can provide would be greatly appreciated. I hope to clean this up and share it with others that might find it useful for similar applications.

Thanks!

Re: Serviio on iOS: so close!

PostPosted: Thu Jun 26, 2014 12:25 am
by zip
Looking at the code, they should be relative. You can check it by using, for example, Device Spy app from the Intel UPNP tools package (link in my signature)