SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-25-2013, 09:36 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Utility/Library: Phoenix Media Streamer

Over the weekend I pushed out a new build of the Phoenix APIs (2.3.61) and the biggest feature in that release is the inclusion of a new Media Streaming Server that uses VLC to product Http Live Streams. (User is required to install VLC and set the path to VLC exe)

My purpose of creating this was to have better control over media streaming for my Android App, but this solution can be used by any other Application.

The current Mobile Streamer (created by Jreichen) does produce HLS streams as well, and as such, this is a second alternative that allow for a little more flexibility and delegates the stream creation to VLC (which has built in support to create HLS stream) or you can delegate the creation to another custom script.

For developers looking integrate this solution, you'll want to look at this page.
http://code.google.com/p/sagephoenix...xMediaStreamer

The basic premise of this server to allow more flexibility to the end user to configure different profiles (low, normal, or hd) for WIFI or 3G.

Since different devices have different requiredments, I wanted to expose those profile configurations via the BMT web ui, so that people can experiement with VLC options to get the best results for their devices.

And, to offer the most flexibility to advanced users, you can optionally use a custom script.

If you have questions, please feel free to post it here, and I'll try to answer them.

dependencies
- phoenix-core 2.3.61
- sagex-services 7.1.9.15
- BMT (if you want to use web ui configuration to set vlc path, or tweak vlc profiles)
Reply With Quote
  #2  
Old 02-25-2013, 03:16 PM
Dargason Dargason is offline
Sage Expert
 
Join Date: Oct 2003
Posts: 516
Looks pretty slick! I'm probably going to tinker with this a bit when I get home.

One thing I'm curious about -- VLC has embedded within it an "HTTP interface", that enables remote control of the stream. This is used by a whole bunch of android apps to browse and play media on the server. For example: https://play.google.com/store/apps/d...roid.vlcremote

I haven't tried one of these yet, but it seems they have a lot better streaming capability, allowing the user to skip forward and backward in the stream, because it controls the server side.

I'm not certain I'm understanding this correctly, but it seems like it should be possible for phoenix to start an instance of VLC with HTTP control turned on, and then the client app could control the stream in that fashion.
Reply With Quote
  #3  
Old 02-25-2013, 03:27 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Dargason View Post
Looks pretty slick! I'm probably going to tinker with this a bit when I get home.

One thing I'm curious about -- VLC has embedded within it an "HTTP interface", that enables remote control of the stream. This is used by a whole bunch of android apps to browse and play media on the server. For example: https://play.google.com/store/apps/d...roid.vlcremote

I haven't tried one of these yet, but it seems they have a lot better streaming capability, allowing the user to skip forward and backward in the stream, because it controls the server side.

I'm not certain I'm understanding this correctly, but it seems like it should be possible for phoenix to start an instance of VLC with HTTP control turned on, and then the client app could control the stream in that fashion.
Yeah, that's Phase 2. I'll be looking at that as well, which is why when you call the api to create a new stream, you get back a "controlInfo" segment with a "mediaUrl" reference. Later, I'll be adding a "controlUrl" segment to that, so if a vlc http control url is returned, I'll try to add support for "controlling" the stream from within the app, etc. My understanding, is that this is not supported using the hls stream, but I may have to add RTP streams support as well. (In my testing RTP streams didn't perform as well as hls streams)
Reply With Quote
  #4  
Old 02-25-2013, 03:35 PM
sacrament055 sacrament055 is offline
Sage Aficionado
 
Join Date: Jul 2007
Posts: 474
sounds like a great idea. Is this working already? I looked at the google code stuff to see how to set it up but I can't get the expected reply so I wondered if I've done something wrong or it's just not ready.

Thanks
Reply With Quote
  #5  
Old 02-25-2013, 03:50 PM
Dargason Dargason is offline
Sage Expert
 
Join Date: Oct 2003
Posts: 516
It was working fine for me after installing the updates last night -- at least it responds to me when I send the streaming command to the server. I can also see the configuration stuff in BMT.
Reply With Quote
  #6  
Old 02-25-2013, 04:38 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by sacrament055 View Post
sounds like a great idea. Is this working already? I looked at the google code stuff to see how to set it up but I can't get the expected reply so I wondered if I've done something wrong or it's just not ready.

Thanks
I'd have to see your exact url query in order to see what is wrong. Keep in mind that at this point, it just starts the vlc process and sends back the mediaUrl on which to start viewing. I haven't actually released the Android app which utilizes this... but I will either tonight or later in the week.
Reply With Quote
  #7  
Old 02-25-2013, 04:41 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Dargason View Post
It was working fine for me after installing the updates last night -- at least it responds to me when I send the streaming command to the server. I can also see the configuration stuff in BMT.
After you create a new streaming process, you can shut it down by sending a stop command.

Code:
http://192.168.1.12:8080/sagex/streaming/control/c123?cmd=stop
Otherwise, I'll keep on creating the streaming files (for that mediafile) until shut it down (btw, c123 in this example is my fake client id)
Reply With Quote
  #8  
Old 02-25-2013, 06:37 PM
Dargason Dargason is offline
Sage Expert
 
Join Date: Oct 2003
Posts: 516
I'm running into a java error:

"java.lang.NoClassDefFoundError: java/lang/ProcessBuilder$Redirect\r\n\tat sagex.phoenix.remote.streaming.VLCHLSMediaProcess.start(VLCHLSMediaProcess.java:76) .... "

The command I'm sending is:

"http://fake.dns.name:8080/sagex/streaming/request/s321?mediafile=10904670"

How would you like bugs to be reported?

I doubt it's related but I had to change the "Command" field in BMT to:

C:\Program Files\VLC\vlc.exe

because I'm running windows. I entered it without quotes, assuming your code wouldn't mind the spaces in the path.

Last edited by Dargason; 02-25-2013 at 06:40 PM.
Reply With Quote
  #9  
Old 02-25-2013, 09:05 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Dargason View Post
I'm running into a java error:

"java.lang.NoClassDefFoundError: java/lang/ProcessBuilder$Redirect\r\n\tat sagex.phoenix.remote.streaming.VLCHLSMediaProcess.start(VLCHLSMediaProcess.java:76) .... "

The command I'm sending is:

"http://fake.dns.name:8080/sagex/streaming/request/s321?mediafile=10904670"

How would you like bugs to be reported?

I doubt it's related but I had to change the "Command" field in BMT to:

C:\Program Files\VLC\vlc.exe

because I'm running windows. I entered it without quotes, assuming your code wouldn't mind the spaces in the path.
That is complaining because I'm using a Java 7 API. I can rewrite without using that Java 7 api (Redirect) but that's going to take a bit time
Reply With Quote
  #10  
Old 02-25-2013, 09:21 PM
Dargason Dargason is offline
Sage Expert
 
Join Date: Oct 2003
Posts: 516
There's not really any reason for me not to upgrade to Java 7, is there?

I'm already running it on my main PC, but I never bothered to mess with my server because it's been really stable lately.
Reply With Quote
  #11  
Old 02-25-2013, 09:42 PM
sacrament055 sacrament055 is offline
Sage Aficionado
 
Join Date: Jul 2007
Posts: 474
that was actually the same error message I had. Thanks for the explanation

I've stuck with java 6 update 24 because it works reliably for me with JVM heap at 1280
Reply With Quote
  #12  
Old 02-26-2013, 06:00 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I've been running 7 for years... I didn't realize anyone would still be running 6 It'll be faster for you to upgrade to 7... than for me to fix the code to run in 6

But, if you want to wait, I'll try to change the code to run in Java 6 either this weekend or next. For now, I'm focussed on some other other areas (mainly the App), so fixing code that already works is not a huge priority for me

On a side note... Much you like you... I really don't touch my server, since it all works. But after making utility (testing it on my dev server) I updated to the latest phoenix on my server, only to discover that I don't have the right version of VLC installed (requires 2.x+). I'm running ubuntu 10.04 (which is not longer supported -- nor is there a software repository) and as such, I can't even do an upgrade to 12.10... I need to do a clean install of the OS (12.10 most likely), just for me to use the utility that I wrote As of now, I'm not even able to use this... and I'm not sure when I'm going to tackle doing a clean install, so I can.

Last edited by stuckless; 02-26-2013 at 06:07 AM.
Reply With Quote
  #13  
Old 02-26-2013, 06:09 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Dargason View Post
How would you like bugs to be reported?

YOu can submit bugs to the Phoenix issues.
Reply With Quote
  #14  
Old 02-26-2013, 07:19 AM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
Quote:
Originally Posted by stuckless View Post
I've been running 7 for years... I didn't realize anyone would still be running 6
If you have been running java 6, you keep getting updates for it while never being offered to move to java 7...
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad
Reply With Quote
  #15  
Old 02-26-2013, 11:23 AM
Dargason Dargason is offline
Sage Expert
 
Join Date: Oct 2003
Posts: 516
I updated to Java 7, and now I get the expected reply from the streamer, and when I check my server, I can see an instance of VLC running. The only problem I have is that when I open a VLC client and paste in the "mediaURL", VLC tells me that it can't detect the format of the input stream.

I'm pretty sure I'm doing something wrong here, but it'll have to wait until these evening before I have time to play with it more.
Reply With Quote
  #16  
Old 02-26-2013, 12:12 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Dargason View Post
I updated to Java 7, and now I get the expected reply from the streamer, and when I check my server, I can see an instance of VLC running. The only problem I have is that when I open a VLC client and paste in the "mediaURL", VLC tells me that it can't detect the format of the input stream.

I'm pretty sure I'm doing something wrong here, but it'll have to wait until these evening before I have time to play with it more.
That is interesting... I haven't actually tried to play the files using vlc... In my Android App, I just delegate the mediaUrl to MX player or Android's player, and they both play the file.

In your case, does the m3u8 file contain any streams? Also, on the server, have your tried playing the first .ts file from the command line to see if it's a valid file?

I might have to add response headers in the http server but I didn't think I needed to do that. I'll do some testing with this as well... and while I didn't get a chance to do an update to the Android app last night, I'll try to get it out tonight, since you'll be able to use that for testing.

Also when you call the create stream, be sure to pass the network=wifi&profile=normal so that you force the server to use a network and profile when creating the streams. I'm not sure what happens if you don't pass a network and profile.
Reply With Quote
  #17  
Old 02-26-2013, 12:53 PM
Dargason Dargason is offline
Sage Expert
 
Join Date: Oct 2003
Posts: 516
Quote:
Originally Posted by stuckless View Post
That is interesting... I haven't actually tried to play the files using vlc... In my Android App, I just delegate the mediaUrl to MX player or Android's player, and they both play the file.
I haven't tried my phone/tablet. I'm at work and don't have any wifi, so my first thought was to use VLC on my desktop. I'll try when I get home.

Quote:
Originally Posted by stuckless View Post
In your case, does the m3u8 file contain any streams? Also, on the server, have your tried playing the first .ts file from the command line to see if it's a valid file?
It's one of the files I've been playing with, so I'm pretty sure it works. Also, when I looked on the server to be sure vlc was launched, I could see it was chugging away on something. Can I just open the m3u8 file with a text editor and see what's in it?

Quote:
Originally Posted by stuckless View Post
I might have to add response headers in the http server but I didn't think I needed to do that. I'll do some testing with this as well... and while I didn't get a chance to do an update to the Android app last night, I'll try to get it out tonight, since you'll be able to use that for testing.

Also when you call the create stream, be sure to pass the network=wifi&profile=normal so that you force the server to use a network and profile when creating the streams. I'm not sure what happens if you don't pass a network and profile.
I used the low/Wifi profile, but that should work, too.

It's also possible that there's some interference from the firewall here at work, though streaming using nielm's webserver seems to work ok.
Reply With Quote
  #18  
Old 02-26-2013, 01:09 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Yeah, the .m3u8 file is just a text file (mp3 playlist file actually), so you can you view it in a text editor... the file changes as each new segment is transcoded.

Also try using the "normal" profile. I still need to tweak the low profile, since I did have some issues with it, with the framerate/bitrate being so low that the encoder seems to take too long (not sure why). The normal profile always seems to work.

Sean.
Reply With Quote
  #19  
Old 02-26-2013, 01:17 PM
Dargason Dargason is offline
Sage Expert
 
Join Date: Oct 2003
Posts: 516
Just tried it with wifi/normal. Same result with VNC, but it worked fine using MXP Player on my phone.
Reply With Quote
  #20  
Old 02-26-2013, 06:32 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
FYI: Android App Updated...

Just an FYI, I've updated my Android App to take advantage of the VLC streaming.

For this to work, in the App, VLC must be fully working and you must be running 2.3.61 of SageTV. If vlc isn't setup then when you go to "Watch on Device" you will not see the Profile Options and you'll just be the raw stream. If you get the Profile Options menu, you can then select between low, normal, hd, and No-Transcode, where No-Transcode will not use VLC, but rather it will stream the raw stream to the device as it was doing previously.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Utility: Phoenix Tools - Phoenix Renamer stuckless SageTV v7 Customizations 116 04-27-2017 10:42 AM
HAVA Titanium HD TV Streamer with Wi-Fi as a (CHEAP) Video (HD!!!) Source? GKenny Hardware Support 13 05-10-2009 02:19 PM
video streamer chrysek SageTV Software 3 01-22-2006 09:26 PM
media library sms SageTV Beta Test Software 1 02-29-2004 12:20 PM
media library crashes -LD SageTV Software 8 09-03-2003 06:42 PM


All times are GMT -6. The time now is 07:00 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.