Video Streaming in HME

Discussion in 'Developers Corner' started by wmcbrine, Aug 1, 2008.

  1. moyekj

    moyekj Well-Known Member

    12,162
    812
    Jan 23, 2006
    Mission...
    I tried adding Content-Range, X-TiVo-Content-Range and X-TiVo-Accurate-Duration headers but they didn't seem to have any effect at all unfortunately.
    I think the only hope is for someone to setup the network sniffing on Netflix and/or YouTube and see if there are any special headers being sent...
     
  2. Allanon

    Allanon Active Member

    911
    153
    Nov 2, 2005
    I'm no expert at packet sniffing but I did find these packets that were sent from Google to the Tivo when playing a YouTube video:


    mOfhE^2U
    Pk:v
    K^HTTP/1.1 302 Found
    Location: http://td.vp.video.l.google.com/vid...zkrJNjHGVAHpaF2MoGD9LlbsOl3qUImVMV6ramM&rdc=1
    Expires: Sat, 10 Jan 2009 10:49:12 GMT
    Cache-Control: public,max-age=900
    Date: Sat, 10 Jan 2009 10:34:12 GMT
    Server: gvs 1.0
    Content-Length: 0
    Content-Type: text/html
    Connection: Close




    mOfhEV/rH
    Ptqk
    BFKHTTP/1.1 206 Partial Content
    Content-Type: video/mp4
    Content-Disposition: attachment; filename=video.mp4
    Last-Modified: Sat, 10 Jan 2009 09:27:00 GMT
    Content-Range: bytes 0-16005445/16005446
    Content-Length: 16005446
    Expires: Sat, 10 Jan 2009 11:34:13 GMT
    Cache-Control: public,max-age=3600
    Date: Sat, 10 Jan 2009 10:34:13 GMT
    Server: gvs 1.0
    Connection: Close

    ftypmp42isomavc1mp42moovlmvhdOOX@iodsO)trak\tkhdOP@qmdia mdhdOPDUBhdlrsoun(C) 2007 Google Inc. v08.13.2007.minfsmhd$dinfdrefurl stbl[stsdKmp4aD'esds@pstts"p(stscstsz"p=D+ufkwhVigoco`kqj`e[ZOHDJGF2G9*,00'--G.:.#)(5)$3(



    When playing the same video from my computer to the Tivo using TivoStream, I found only this packet:


    mOE[m@@]R
    xf
    VGET /videostream/video.mp4 HTTP/1.1
    Host: 192.168.0.22:7288
    Range: bytes=0-
    User-Agent: TvHttpClient
    tsn: ############
    Connection: close
     
  3. moyekj

    moyekj Well-Known Member

    12,162
    812
    Jan 23, 2006
    Mission...
    Allanon, thanks for the packet dumps. I added Content-Range & Content-Length headers but it didn't seem to make a difference. With my additions the request sent from PC-Tivo using tivostream becomes (using wireshark on my pc which doesn't require a hub since server is my pc):
    Code:
    HTTP/1.1 200 Media follows
    Server: HttpServer
    Content-Type: video/mpeg
    Content-Range: bytes 0-1999999999/2000000000
    Content-Length: 2000000000
    Content-length: 0
    
    These had no effect however. What is interesting is the "Content-length" header seems to be automatically added somewhere. When I add my own header (with lower case l for length) it appears before the 0 length header added automatically. I don't know if that has any effect anyway.

    Since YouTube behaves same as our current implementation perhaps Netflix sniffing will be more valuable. Problem is for that I would need to set up my Hub which I'm now getting more inclined to do...
     
  4. moyekj

    moyekj Well-Known Member

    12,162
    812
    Jan 23, 2006
    Mission...
    OK, here's some dumps from Tivo/Netflix communications:
    Code:
    Tivo->Netflix
    --------------
    GET /s/d5/551/899495551.wmv?e=1231651648&h=9b149de2dbb08f15e422952f38ab723d HTTP/1.1
    Host: netflix-551.vo.llnwd.net:80
    Range: bytes=0-
    User-Agent: TvHttpClient
    tsn: xxxx
    Connection: close
    
    Netflix->Tivo
    -------------
    1!E@;4DOEkPw<\L)g-D
    &HTTP/1.1 206 Partial Content
    Server: Apache
    Accept-Ranges: bytes
    Content-Type: video/x-ms-wmv
    Content-Range: bytes 0-1192634322/1192634323
    Content-Length: 1192634323
    Date: Sat, 10 Jan 2009 21:27:30 GMT
    Last-Modified: Thu, 13 Nov 2008 10:46:31 GMT
    Connection: close
    
    Then a few seconds later:
    Code:
    Tivo->Netflix
    -------------
    !1E/@@kDOFPL(x"&
    [GET /s/d5/551/899495551.wmv?e=1231651648&h=9b149de2dbb08f15e422952f38ab723d HTTP/1.1
    Host: netflix-551.vo.llnwd.net:80
    Range: bytes=1192594763-
    User-Agent: TvHttpClient
    tsn: xxxx
    Connection: close
    
    Netflix->Tivo
    -------------
    1!ETs@;0IDOFkP"L(P
    [HTTP/1.1 206 Partial Content
    Server: Apache
    Accept-Ranges: bytes
    Content-Type: video/x-ms-wmv
    Content-Range: bytes 1192594763-1192634322/1192634323
    Content-Length: 39560
    Age: 1
    Date: Sat, 10 Jan 2009 21:27:31 GMT
    Last-Modified: Thu, 13 Nov 2008 10:46:31 GMT
    Connection: close
    
    Then a few seconds later, because when using Hub it slows everything down, there was a re-negotiation of stream quality and so I got:
    Code:
    Tivo-Netflix
    ------------
    !1Ep@@kDOEPK`N|
    21GET /s/d5/551/899495551.wmv?e=1231651648&h=9b149de2dbb08f15e422952f38ab723d HTTP/1.1
    Host: netflix-551.vo.llnwd.net:80
    Range: bytes=6763-1192594762
    User-Agent: TvHttpClient
    tsn: xxxx
    Connection: close
    
    Netflix->Tivo
    -------------
    1!E~@;ekDOEkPNK<H
    12HTTP/1.1 206 Partial Content
    Server: Apache
    Accept-Ranges: bytes
    Content-Type: video/x-ms-wmv
    Content-Range: bytes 6763-1192594762/1192634323
    Content-Length: 1192588000
    Age: 5
    Date: Sat, 10 Jan 2009 21:27:35 GMT
    Last-Modified: Thu, 13 Nov 2008 10:46:31 GMT
    Connection: close
    
    I will add the "Accept-Ranges: bytes" header to see if that has any effect.
     
  5. Allanon

    Allanon Active Member

    911
    153
    Nov 2, 2005
    Does that mean Tivo can play WMV files?

    Also what is the Cache-Control used for?
     
  6. wmcbrine

    wmcbrine Well-Known Mumbler

    11,704
    813
    Aug 2, 2003
    It can play a very restricted subset of WMV files -- just enough to support Netflix. moyekj has the details in his tivostreamer thread:

     
  7. moyekj

    moyekj Well-Known Member

    12,162
    812
    Jan 23, 2006
    Mission...
    Since 11.0x software yes, but a very limited subset, see tivostream documentation for details on what exactly works.
     
  8. moyekj

    moyekj Well-Known Member

    12,162
    812
    Jan 23, 2006
    Mission...
    Adding "Accept-Ranges: bytes" header did not seem to change any behavior and I don't see anything else related to buffer sizes in the Netflix/Tivo packet dump so I'm stumped...

    I'm starting to suspect now that when tivo sees "video/x-ms-wmv" as video type the buffer length restriction of 1.1GB is lifted (maybe the headers on byte range etc. are considered for wmv but not other types). I shall have test that theory by generating a working wmv file > 1.1GB.
     
  9. wmcbrine

    wmcbrine Well-Known Mumbler

    11,704
    813
    Aug 2, 2003
    Dude, how many times do I have to say this -- it's special parameters to the stream creation request in HME (which we haven't seen yet, due in part to the fact that it's encrypted, and of course undocumented). Not HTTP headers, and not MIME types. I'll put any amount of money on that you like.
     
  10. moyekj

    moyekj Well-Known Member

    12,162
    812
    Jan 23, 2006
    Mission...
    You're likely most certainly right and you have a lot more insight into HME than most. I'm just attacking this from an angle we do have control over to eliminate the remote possibility that it may be something simple. If nothing else I'm helping to prove that you are right by not having any success.
    One final input that seals it that this is the wrong path to go down: Streaming a .wmv file > 1GB with all headers similar to Tivo/Netfilx also stops streaming around 1.1 GB mark.

    If there is anything in network sniffing that you feel may be of value to investigate please indicate.
     
  11. mulscully

    mulscully Member

    347
    17
    May 31, 2003
    Malvern, Pa
    has anyone tried to get this to play HULU files? Beside the obsticle of knowing the stream url.. Maybe use the embed url.. But even if that works getting a list of the available streams and their embed urls would be the next problem..

    just thinking outload....

    Or even get stickam.com to work.. hmmmm...
     
  12. Allanon

    Allanon Active Member

    911
    153
    Nov 2, 2005
    HULU videos are FLV files so you can use one of the programs out their that can download the FLV file from HULU and then use wmcbrine's HME/VLC Video Streamer program to play the FLV file on the Tivo since VLC can transcode FLV files.
     
  13. mulscully

    mulscully Member

    347
    17
    May 31, 2003
    Malvern, Pa
    right I guess that, but I am looking for the convience of browsing HULU from the couch and selecting the video.. I see that Boxee does it so was just wondering how we might get this app to work...
     

Share This Page