Video Streaming in HME

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

  1. moyekj

    moyekj Well-Known Member

    12,178
    827
    Jan 23, 2006
    Mission...

    Advertisements

    Right now in my prototype version it looks for files of certain extensions I defined in the same folder where you start the server. It also includes any folders and you can descend into folders as deep as you like to search for more.
    In the future I plan to setup a little config file where you can pre-define 1 or more directories and the entry screen would be the list of pre-defined directories.
    Once I clean up and test my Java prototype a little more I can make it available to others to try out if anyone is interested (assuming I can figure out an easy way to release as a single jar file).
     
  2. AbMagFab

    AbMagFab What happened, TiVo?

    3,638
    0
    Feb 5, 2001
    Put me on the list for testing...
     
  3. Allanon

    Allanon Active Member

    923
    160
    Nov 2, 2005
    Here is a video player that has a scrolling file selector. To use just unzip in to 'c:/' for windows and set the HME server's basepath to 'c:/'. The default video folder is '/videos/' but you can change it by modifying VIDEO_PATH. You can also modify the background and selection bar by editing or changing the bg.jpg and select.jpg file. You can change the colors of text by changing TEXT_COLOR and SELECT_TEXT_COLOR.

    I still need to add a display bar but that is on the todo list. Just use UP and DOWN to scroll through the video filenames and press SELECT to play the file. You can PAUSE, STOP, FAST FORWARD, and REWIND. Use LEFT to get back to the video filename menu.

    Also, please excuse the messy programming, I'm new to Python so it is probably a mess and can be done a lot cleaner.
     

    Attached Files:

  4. turnipsun

    turnipsun New Member

    27
    0
    Jan 14, 2006
    Santa Clarita
    Allanon, I just sent you a PM.. please contact me.

    Thanks,
    Chris
     
  5. fyodor

    fyodor Active Member

    835
    122
    Sep 19, 2006

    Advertisements

    What does this mean, exactly? If you want to start in the middle, you have to wait for it to buffer half the movie?

    Thanks much!
    F
     
  6. jbcooley

    jbcooley New Member

    55
    0
    May 13, 2007
    You could probably build an application that served only half the file*. But it's not part of the protocol.

    *I don't think cutting the file in half actually works, but some other transformation that performed a similar function could work.
     
  7. moyekj

    moyekj Well-Known Member

    12,178
    827
    Jan 23, 2006
    Mission...
    That's right, I haven't found a way to jump beyond the buffer yet, though I haven't looked very hard. I saw briefly something in HME about an ILookAheadBuffer class but not sure what that is about but I doubt it's what we want.

    P.S. I made excellent progress today with my Java app (added status bar and have all trick play functions working) and will try to release 1st version maybe tomorrow.
     
  8. fyodor

    fyodor Active Member

    835
    122
    Sep 19, 2006
    Neat program-I noticed that you included other file types .divx, wmv, etc, in the recognized formats. Is the hardware capable of playing these formats? I couldn't get anything other than mpg files to play.

    Thanks
    F




     
  9. Allanon

    Allanon Active Member

    923
    160
    Nov 2, 2005
    I wasn't sure exactly what formats would play so I just included a lot of video extensions so I could try them all. I got MP4 and MP3 to work and I tried a h.264 MOV file but it didn't play. I really haven't tested other file formats.
     
  10. wmcbrine

    wmcbrine Well-Known Mumbler

    11,747
    830
    Aug 2, 2003
    It will probably work; it's just the ".mov" extension the TiVo doesn't like. Try renaming it to end in ".mp4", or add the parameter 'video/mp4' after the URL in the Stream() call.
     
  11. moyekj

    moyekj Well-Known Member

    12,178
    827
    Jan 23, 2006
    Mission...
    OK, here's the 1st release of my Java based application. For lack of a better place to host I created a new Google project. I plan to post the Java source code there as well once this matures a little more and I have more chance to clean up comments and formatting. The zip file below contains everything packaged as a single Java jar file and there's also convenience run_win.bat and run_unix.sh scripts for starting the program included.
    Download:
    http://tivostream.googlecode.com/files/tivostream_v0p1.zip

    Instructions:
    http://tivostream.googlecode.com/files/README.txt

    I've tried this both on Windows XP SP2 and a Linux RHE 4 machine (running a fairly recent Java 1.6).
    All feedback welcome. I'll probably start a thread in the main Tivo Forums HME area on this.
     
  12. Allanon

    Allanon Active Member

    923
    160
    Nov 2, 2005
    Do you think this video streaming could be made to work with streaming video off the Internet such as NASA TV? I know Galleon is able to stream Shoutcast radio, would streaming Internet video possibly work the same way? Or possibly make it work with a video stream from VLC which can convert the streaming Internet video to the correct format before streaming it to the Tivo.
     
  13. wmcbrine

    wmcbrine Well-Known Mumbler

    11,747
    830
    Aug 2, 2003
    NASA was one of the first things I wanted to try, but it's a bit difficult to get a real URL for a stream -- and once I did, I couldn't even get MPlayer to dump it to a file I could test with. So I put that aside... I've been able to play directly from Revision3.com, but I'm not sure if that counts as "streaming", since this was from the "download" links. :)

    Edit: OK, I've got NASA streaming, with VLC. Unfortunately I can't get VLC to grab the MP4 stream, which the TiVo might be able to handle directly, so I'm reencoding the WMV stream to MPEG-2. Now to see if I can fix the problems I'm having with the sound being out of sync and dropping out...

    Edit 2: OK, got that sorted. I'll see about packaging up my solution properly; meanwhile, here's how to emulate it:

    1. Grab http://www.nasa.gov/55644main_NASATV_Windows.asx

    2. Start VLC -- my command line is:
    Code:
    vlc *.asx --sout "#transcode{vcodec=mp2v,acodec=a52}:standard{access=http,dst=192.168.1.12:8080,mux=ps}" --packetizer-mpegvideo-sync-iframe --sout-transcode-audio-sync
    (192.168.1.12 is my computer's LAN address.) Probably you can just pass the URL directly to VLC instead of the .asx file.

    3. Change the Stream initializer line in my vidtest app to:
    Code:
            self.stream = hme.Stream(self, 'http://192.168.1.12:8080/',
                                     'video/mpeg')
    I should probably add my latest version of vidtest -- the only change is that it switches the display from minutes:seconds to hours:minutes once the duration goes over an hour. It's also already got the URL shown above.

    Edit 3: The sound still goes out of sync occasionally. You can fix it by pausing, waiting until the video actually stops, and then unpausing.

    Edit 4: Using mpga instead of a52 as the audio codec seems to help.

    Edit 5: Some better-quality streams:

    http://playlist.yahoo.com/makeplaylist.dll?id=1368162
    http://playlist.yahoo.com/makeplaylist.dll?id=1368570
    http://playlist.yahoo.com/makeplaylist.dll?id=1368163
     

    Attached Files:

  14. Allanon

    Allanon Active Member

    923
    160
    Nov 2, 2005
    Using your instructions I was able to get NASA TV streaming. I used MP1V and MPGA mainly because VLC crashed for some reason when using MP2V but I didn't see any out of sync audio when using those settings.
     
  15. moyekj

    moyekj Well-Known Member

    12,178
    827
    Jan 23, 2006
    Mission...
  16. bradleys

    bradleys It'll be fine....

    4,157
    245
    Oct 31, 2007
    This is really great...

    A couple of items on my dream list!

    1. I would love to see this work for .tivo files. Takes my video server from an archive location and turns the whole unit into a true Media center! Very cool.

    2. Play Netflix content. Harder, I understand but very cool.

    With these two apps, my TIVO would imediately become significantly more powerful. The ability to stream is wonderful... I cannot wait to get back to work on Monday and poo poo my co-workers windows media center environment!
     
  17. wmcbrine

    wmcbrine Well-Known Mumbler

    11,747
    830
    Aug 2, 2003
    Posted here now. It handles starting and stopping VLC as needed.
     
  18. fyodor

    fyodor Active Member

    835
    122
    Sep 19, 2006
    Neat. Can this be configured to stream locally stored files in non-compatible formats?


     
  19. wmcbrine

    wmcbrine Well-Known Mumbler

    11,747
    830
    Aug 2, 2003
    Well, it could, but there's no file selector yet. If you had one particular file you wanted to stream, you could just make a module like so:

    STREAM_URL = yourfilename
    NEEDS_VLC = True

    from hmevid import *
     
  20. fyodor

    fyodor Active Member

    835
    122
    Sep 19, 2006
    Gotcha-it's nothing in particular.I just imagine that it would be useful to be able to play other nonsupported file formats. I found that some of my old SageTV recordings (MPG) don't play back correctly, so it would be useful to have VLC transcode it to a compliant format.

     

Share This Page

spam firewall

Advertisements