[New Plugin] WebServices + Transcoded streaming + Web Interface for TvServer and MP (1 Viewer)

Status
Not open for further replies.

gemx

Retired Team Member
  • Premium Supporter
  • October 31, 2006
    1,972
    539
    Home Country
    Germany Germany
    Hi,

    i just finished work on my "secret project".

    What this packet includes:

    * WebServices which expose TvServer functions and database entries and expose MP Media Databases
    - these WebServices are simple Soap WebServices and are even GET/POST enabled (wsdl included in next post)

    * A TvServer plugin which hosts the WebApplication and the webservices - No need for IIS or anything else :D

    * A complete Web Interface for MP and TvService (see screenshots) with ability to stream all media over http and to have transcoding profiles defined to transcode the stream on the fly while streaming to save bandwidth :D

    I am very well aware that the Web Interface looks quite ugly but it was just to show how to work with the web services :)

    I hope some other developers will continue and beautify the Web Interface - for me it was more a proof of concept for the web interfaces

    With the web interfaces it should now be quite easy to interface MP and TvServer from nearly every programming/scripting language and nearly every platform OS. It just has to have web service support ;)

    PREREQUISITES:

    - .NET Framework 3.5
    - MediaPortal + TvServer 1.1 BETA + latest SVN snapshot

    INSTALLATION:

    - Just run the msi :)


    SOME NOTES:

    Since the "movie","music" and "picture" functions use the MP databases, you have to have MP and TvServer installed on the same PC.

    The buttons for all MP functions such as Movies,Music etc are only visible if the corrosponsding database is found, otherwise they are hidden. If you e.g. don't have movingpictures but tvseries and mp installed on the pc then just the moving pictures button is hidden

    Version history
    04.10.2009 Alpha 2 Released
    Changes:
    - live-tv works
    - fixed some exceptions
    - thumbnail size for pictues is now configurable
    - external player path is now configurable
    - added [TvServer RTSP] streaming profile for recordings (just uses TvServer's built-in RTSP streaming server)

    04.10.2009 Alpha 3 Released
    Changes:
    - Fixed Radio showing Tv channels

    06.10.2009 Alpha 4 released
    Changes:
    - should now also work on x64
    - added support for VLC Browser plugin
    - fixed bug were you couldn't set the port higher than 100

    07.10.2009 Alpha 5 released
    Changes:
    - fixed transcoding
    - added mencoder to htdocs/bin

    08.10.2009 Beta 1 released
    Changes:
    - Fixed transcoding again
    - Streaming of live-tv now works even with transcoding :)
    - added login page
    - added support for TvSeries and MovingPictures
    - updated screenshots[/b]
    If live-tv transcoding doesn't work for you with both provided profiles please try to change the inputmethod to "NamedPipe"
    It's seems that inputMethod=NamedPipe works best with live-tv and inputMethod=Filename works best with any other kind of media but you can just play around with these two settings


    09.10.2009 Beta 2 released
    Changes:
    - Fixed TvSeries
    - Is now a TvServer Plugin :)
    - added rss feeds
    - url for streaming is now configurable
    - mp db paths are configurable
    - Fixed "rec" button in channel epg does nothing

    09.10.2009 Beta 3 released
    Changes:
    - Fixed TvSeries again
    - Fixed config for transcoding being doubled by saving
    - Modified web.config so that the exceptions are shown on remote sites and not only on the server

    13.10.2009 Beta 4 released
    Changes:
    - Improved handling of schedules
    - Added search options for Recordings,Movies,Music, TvSeries,MovingPictures
    - Added m3u playlist support for Music
    - Added logoff button
    - Fixed some minor glitches

    31.12.2009 Beta 5 released
    Changes:
    - MSI Installer
    - Access to streamer.aspx is now using the admin password (encrypted in the querystring)
    - Support for channel logos
    - Configurable database/logo/thumb paths
    - Helpfile for configuration
    - logging for the streamer class (..\htodcs\logs)
    - ATTENTION: Just uploaded an update to the previous BETA 5. Please use this

    02.01.2010 RC 1 released
    Changes:
    - many Bugfixes
    - added a movie scraper url setting. Every movie name (recordings, tv) becomes a link to e.g. imdb
    Already known bugs in RC 1
    - m3u url is enclosed in " which prevents VLC from playing it (done. fixed RC-2)
    - if a db is not found or empty an exception is raised (done. fixed in RC-2)
    - webpage with VLC plugin seems to be broken (done. fixed in RC-2)
    - add an anchor in epg view to jump to current date/time
    (done. fixed in RC-2)
    - implement epg search page - search for a show and link shows in miniepg to this search page (done. fixed in RC-2)
    - the built target is probably mixed up again -> doesn't work on X64? (investigating...)

    04.01.2010 RC 2 released

    Bugfixes:
    - m3u url was enclosed in " which prevents VLC from playing it
    - exception thrown if picture db was empty
    - webpage with VLC plugin was broken. Thanks mischa

    Changes/new feature:
    - added an epg search page
    - implemented epg search page and search for a show and link shows in miniepg to this search page

    Already known bugs and feature requests:
    - playback of recordings is not working anymore (done. Fixed in RC-3)
    - leftover css tag in default.aspx (done. Fixed in RC-3)
    - Log writer didn't append new lines to logfile (done. Fixed in RC-3)
    - add some new streaming profiles (done. Implemented in RC-3)
    - add system infos (cpu/men usage, disk usage...) to tvserver status page (done. Implemented in RC-3)
    - Only load logos when the files actually exists to preserve bandwidth (work in progress...)
    - Logos containing special characters such as + and & don't show (work in progress...)

    05.01.2010 RC 3 released (screenshots updated)

    Bugfixes:

    - playback of recordings is not working anymore (Thanks mischa)
    - leftover css tag in default.aspx (Thanks mischa)
    - Log writer didn't append new lines to logfile (Thanks mischa)
    - Only load logos when the files actually exists to preserve bandwidth
    - Logos containing special characters such as + and & don't show

    Changes/new feature:
    - added some new streaming profiles (Thanks mischa)
    - added system infos (cpu/men usage, disk usage...) to tvserver status page

    Already known bugs and feature requests:
    + TvServerStatus page crashes with RAM > 2 GB - Thanks Vasko - (done. fixed in next rev.)
    + some users get channels with channel id=0 ? (done. fixed in next rev.)
    + if a recording path for a card is empty, tvserverstatus page throws an exception - Thanks vasko - (done. fixed in next rev.)
    + some improvements for the streaming profiles - Thanks vasko - (done. fixed in next rev.)
    - Stopping timeshifting in tvserver status page is not working (investigating...)
    - Include mencoder in setup (work in progress)
    - banners for tv series (investigating...)
    - make seeking possible (investigating...)



    Many thanks to VALK. I used some code from his StreamTV Plugin and also to Mischa who found and fixed some bugs :D
     

    Attachments

    • schedules.jpg
      schedules.jpg
      53.3 KB
    • EditSchedule.jpg
      EditSchedule.jpg
      20.9 KB
    • Pictures.jpg
      Pictures.jpg
      83.3 KB
    • ChannelEPG.jpg
      ChannelEPG.jpg
      70.1 KB
    • PluginConfig_3.jpg
      PluginConfig_3.jpg
      45.4 KB
    • PluginConfig_4.jpg
      PluginConfig_4.jpg
      38.9 KB
    • Movies.jpg
      Movies.jpg
      80.9 KB
    • MovingPictures.jpg
      MovingPictures.jpg
      37.5 KB
    • Music.jpg
      Music.jpg
      55.5 KB
    • Recordings.jpg
      Recordings.jpg
      104.5 KB
    • TvSeries.jpg
      TvSeries.jpg
      117.4 KB
    • tv.jpg
      tv.jpg
      56.1 KB
    • tvserverstatus.jpg
      tvserverstatus.jpg
      39.2 KB
    • EPGSearch.jpg
      EPGSearch.jpg
      92.6 KB
    • pluginconfig_1.jpg
      pluginconfig_1.jpg
      38.6 KB
    • pluginconfig_2.jpg
      pluginconfig_2.jpg
      41.3 KB
    • MPWebServices_RC3.rar
      30.6 KB

    nicx

    Portal Pro
    February 1, 2006
    387
    12
    Stuttgart
    Home Country
    Germany Germany
    and again the killer feature live-tv streaming is missing in this plugin :(

    anyway, i will test your plugin and give you some thoughts ;)

    nicx...
     

    gemx

    Retired Team Member
  • Premium Supporter
  • October 31, 2006
    1,972
    539
    Home Country
    Germany Germany
    Errm, it does live-tv streaming.

    It streams:

    - live-tv
    - DVB-Radio
    - movies
    - music files
     

    nicx

    Portal Pro
    February 1, 2006
    387
    12
    Stuttgart
    Home Country
    Germany Germany
    oh ok than i have to revert my statement and shut up ;)

    i will test it immediately... i hope finally i can use my iphone with your plugin, i am waiting now for months for such a solutin.

    nicx...

    hm just tested it on my windows home server (dedicated tv-server installed) with no luck. the service is starting and the default home page is running, but if i click on "tv" i get following error (line 140 is red):


    Ausnahmedetails: System.Net.Sockets.SocketException: Der angegebene Host ist unbekannt

    Quellfehler:

    Zeile 138: if (!ConnectToDatabase())
    Zeile 139: return ret;
    Zeile 140: IList<ChannelGroup> groups=ChannelGroup.ListAll();

    Quelldatei: c:\Dokumente und Einstellungen\Administrator\Desktop\MediaPortal WebServices\htdocs\App_Code\TvServiceWebServices.asmx.cs Zeile: 140

    Stapelüberwachung:


    [SocketException (0x2af9): Der angegebene Host ist unbekannt]
    System.Net.Dns.GetAddrInfo(String name) +414
    System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) +97
    System.Net.Dns.GetHostEntry(String hostNameOrAddress) +174
    MySql.Data.Common.StreamCreator.GetHostEntry(String hostname) +98
    MySql.Data.Common.StreamCreator.GetStream(UInt32 timeOut) +345
    MySql.Data.MySqlClient.NativeDriver.Open() +219

    [MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.]
    MySql.Data.MySqlClient.NativeDriver.Open() +305
    MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() +89
    MySql.Data.MySqlClient.MySqlPool.GetConnection() +160
    MySql.Data.MySqlClient.MySqlConnection.Open() +212
    Gentle.Provider.MySQL.MySQLProvider.GetConnection() +63

    [GentleException: The database backend (provider MySQL) could not be reached.
    Check the connection string: Password=MediaPortal;Persist Security Info=True;User ID=sa;Initial Catalog=MpTvDb;Data Source=server\SQLEXPRESS;Connection Timeout=300;]
    Gentle.Common.Check.FailWith(Severity severity, Error error, Exception e, String msg) +89
    Gentle.Common.Check.Fail(Exception e, Error error, Object[] args) +42
    Gentle.Provider.MySQL.MySQLAnalyzer.Analyze(String tableName) +515
    Gentle.Framework.GentleAnalyzer.UpdateObjectMap(ObjectMap map) +155
    Gentle.Framework.ObjectFactory.ConstructMap(PersistenceBroker broker, Type type) +1519
    Gentle.Framework.ObjectFactory.GetMap(PersistenceBroker broker, Type type) +114
    Gentle.Framework.SqlBuilder..ctor(IGentleProvider provider, StatementType stmtType, Type type, LogicalOperator logicalOperator) +204
    Gentle.Framework.SqlBuilder..ctor(StatementType stmtType, Type type) +13
    TvDatabase.ChannelGroup.ListAll() in C:\KwasiDrive\Devel\Visual Studio 2005\Projects\Team MediaPortal\TvEngine3\TVLibrary\TVDatabase\ChannelGroup.cs:104
    MediaPortal.TvServer.WebServices.ServiceInterface.GetTvChannelGroups() in c:\Dokumente und Einstellungen\Administrator\Desktop\MediaPortal WebServices\htdocs\App_Code\TvServiceWebServices.asmx.cs:140
    Default.RefreshTv() in c:\Dokumente und Einstellungen\Administrator\Desktop\MediaPortal WebServices\htdocs\Default.aspx.cs:93
    Default.btnTv_Click(Object sender, EventArgs e) in c:\Dokumente und Einstellungen\Administrator\Desktop\MediaPortal WebServices\htdocs\Default.aspx.cs:53
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +78
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +101
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2863
     

    gemx

    Retired Team Member
  • Premium Supporter
  • October 31, 2006
    1,972
    539
    Home Country
    Germany Germany
    You have to change the default provider in the gentle.config file.

    You seem to be running a MS SQL Server but the default provider is MySQL.
     

    nicx

    Portal Pro
    February 1, 2006
    387
    12
    Stuttgart
    Home Country
    Germany Germany
    if i look into my gentle.config i can see that the sqlserver is selected, no mysql server. is ther another gentle.config file elsewhere?

    my mp environment is working well, so if there really is an error in this file it should not work, too. am i right? ;)

    nicx...
     

    gemx

    Retired Team Member
  • Premium Supporter
  • October 31, 2006
    1,972
    539
    Home Country
    Germany Germany
    There is a gentle.config inside "htdocs" folder ;)
     

    nicx

    Portal Pro
    February 1, 2006
    387
    12
    Stuttgart
    Home Country
    Germany Germany
    ah ok, another gentle.config file :) after changing the default provider its working now.

    but how can i stream? if i klick on a channel ther is only a startstreaming.bat with no effect ;)


    edit: just found out the batch file starts vlc, but with wrong path. where can i edit the path of the batch?
     

    gemx

    Retired Team Member
  • Premium Supporter
  • October 31, 2006
    1,972
    539
    Home Country
    Germany Germany
    Yep, that's definately something for the next version :)

    Have to make this configurable :oops:

    You can change it in htdocs\Default.aspx.cs Line 21

    Code:
    string str = "\"c:\\program files\\videolan\\vlc\\vlc.exe\" \"" + baseUrl + "/Streamer.aspx?" + queryString + "\"";
     

    nicx

    Portal Pro
    February 1, 2006
    387
    12
    Stuttgart
    Home Country
    Germany Germany
    ok, changed this too and vlc is starting, but nothing happens. no video starts, no error, nothing :)

    i can even not see any tv card timeshifting...
     
    Status
    Not open for further replies.

    Users who are viewing this thread

    Top Bottom