[Obsolete] MPWebStream: Stream TV over the internet (1 Viewer)

Oxan

Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    Please note that MPWebStream is now obsolete and you should consider upgrading to MPExtended or WebMediaPortal.

    Hi all,

    As MPWebServices isn't developed anymore and it's quite hard to setup it (especially on 64-bit) and TV4Home doesn't feature a streaming service yet, I developed one, mainly based on the code from Valk (StreamTv) and Gemx (MPWebServices).

    Installation instructions:
    • Download and install the TV4Home Core Service update 3 from here. For MediaPortal 1.2 beta, use the version I posted here.
    • Download and install MPWebStream, attached to this post.
    • Enable the MPWebStream plugin in the TV Server Configuration and configure at least the username, password and site root there.
    • Restart the TV Server
    • Go to http://<your ip address>:8080/. Log in and you'll find a very basic page with links to streams for all channels, both playing in the VLC browser plugin or direct links for copying into external applications.

    For advanced users:
    MPWebStream is divided in three parts: a webserver (Cassini), a TVServer plugin (for configuration and starting the webserver) and the (ASP.NET) site itself. Disabling each part is possible, but you need at least a webserver (either the built-in one or IIS). Running the site under IIS is quite easy: disable the webserver and change the site root in the configuration and configure IIS. Specify <mediaportal installation dir>\Plugins\MPWebStream\Site as application root. IIS7 may want that the configSections node is commented out in the Web.config file there.
    When using an external webserver the TVServer plugin only does configuration, so that can be disabled too (configuration file is in the same directory as MediaPortal's log directory).
    The webserver runs entirely outside the TVService process, so if it crashes the TV server keeps running (to avoid the problems with MPWebServices). It does even restart itself if possible.
    Specifying transcoders is a bit harder and it's quite hard to find problems when you've done it wrong. I'll add some default configurations in future releases. For ffmpeg you need to use NamedPipe as input and output. {0} and {1} are substitued with respectively the input and output filename (you can't use these for StandardIn and StandardOut).

    For developers:
    I also included a (WCF) service to retrieve URLs for streaming and transcoding. Sadly hosting a WCF only works under IIS or using WAS, so it doesn't work in the default setup with Cassini. The service is available at http://<path>/MediaStream.svc. API documentation is only available as source code here, but it's quite easy. At the moment you need to get the username and password from the user and then pass it to the API.
    You can also integrate streaming and transcoding into your own application. The MPWebStream.MediaTranscoding namespace is meant for this. It features a single class, TranscodingStreamer, which can handle the transcoding and streaming. Send me a message if you need any help.

    Update 1 May 2011
    I've released a new version of MPWebStream. New features include:
    • Default transcoder profiles for H.264 and MPEG4 streaming for 500Kbit/s, 1Mbit/s, 2Mbit/s, 5Mbit/s and 10Mbit/s using ffmpeg.
    • Default transcoder profile for Android streaming, see other thread.
    • More stable transcoding
    • Playlist (M3U) support
    • Support for streaming of recordings
    • Splitted the transcoding and streaming part out into a seperate library that can be integrated in other plugins
    Due to massive changes, you have to uninstall the previous version to install the new version. If you want the new transcoder profiles, also delete the file C:\ProgramData\Team MediaPortal\MediaPortal TV Server\MPWebStream.xml (on Windows 7. for other versions open the logs directory of MediaPortal, and then go one directory up). Note that you'll loose your configuration with this, so you might want to back it up.

    There are still some small problems, mainly with transcoding, that I'm working on. Expect an 1.0.1 release somewhere in May, with some more stability fixes. Please report any issues you encounter here.

    Builds for MediaPortal 1.2.0 aren't tested very throughly as I don't have a developer machine with a TV card in it, but it should work. You need an updated version of the TV4Home Core Service for these builds, which I've posted here.

    Source code can, as always, be found on GitHub.
     

    Attachments

    • MPWebStream-beta.zip
      404 KB
    • MPWebStream-v1.0.0-MP1.2beta.zip
      5.8 MB
    • MPWebStream-v1.0.0-MP1.1.zip
      5.8 MB
    Last edited:

    Mike Lowrey

    Portal Pro
    February 4, 2009
    638
    124
    Berlin
    Home Country
    Germany Germany
    Re: [Beta] MPWebStream: Stream TV over the internet

    Hi,

    thanks for sharing this :) Can you give some information on the stability of the streaming?
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    39
    Austria
    Home Country
    Austria Austria
    Re: [Beta] MPWebStream: Stream TV over the internet

    I'm getting the following exception when starting a stream:

    [FaultException`1: Couldn't start TV stream: UnknownError]
    System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +10257978
    System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +539
    TV4Home.Server.TVEInteractionLibrary.Interfaces.ITVEInteraction.SwitchTVServerToChannelAndGetVirtualCard(String userName, Int32 channelId) +0
    MPWebStream.Site.Streamer.startTranscoding() +402
    MPWebStream.Site.Pages.Stream.ProcessRequest(HttpContext context) +810
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +586
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +177

    For which version of mp (1.1.3, 1.2 Alpha, SVN) is this?

    I'm looking forward to your solution for android streaming...

    :D
     

    Oxan

    Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    Re: [Beta] MPWebStream: Stream TV over the internet

    Hi,

    thanks for sharing this :) Can you give some information on the stability of the streaming?
    I've watched for 3-4 hours the direct stream and it didn't crash or hickup once. With ffmpeg transcoding things aren't that good (audio goes out of sync, occasionally sometimes fails to startup), but it's quite acceptable for me at this stage.

    I'm getting the following exception when starting a stream:

    For which version of mp (1.1.3, 1.2 Alpha, SVN) is this?

    I'm looking forward to your solution for android streaming...

    :D
    I've built it against the libraries from 1.1.3. The error message you get seems to be coming from the TV4Home Core Service which gives that message when starting a timeshift fails. Does timeshifting work with the SetupTv application?

    Android streaming is actually quite simple. I've created an ffmpeg command line that transcodes into an Android-compatible format (that will be H.264 with AAC audio) and then wraps it into an MPEG TS stream. With Android 2.3 that plays natively in a VideoView, with earlier android version you need an external app like RockPlayer. Integration with an app like yours would be nice indeed.
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    39
    Austria
    Home Country
    Austria Austria
    Re: [Beta] MPWebStream: Stream TV over the internet

    I've built it against the libraries from 1.1.3. The error message you get seems to be coming from the TV4Home Core Service which gives that message when starting a timeshift fails. Does timeshifting work with the SetupTv application?
    Ok that explains why it's not working, any plans for a version compatible with svn? Maybe when the beta is out...

    Android streaming is actually quite simple. I've created an ffmpeg command line that transcodes into an Android-compatible format (that will be H.264 with AAC audio) and then wraps it into an MPEG TS stream. With Android 2.3 that plays natively in a VideoView, with earlier android version you need an external app like RockPlayer. Integration with an app like yours would be nice indeed.
    Sure thing, once this is stable enough I'll make sure to integrate it in the app... ;)
     

    valtam

    Portal Pro
    March 27, 2010
    94
    6
    Home Country
    New Zealand New Zealand
    Re: [Beta] MPWebStream: Stream TV over the internet

    Doesn't work here, after I login I get:

    Code:
    Server Error in '/' Application.
    
    Runtime Error
    
    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 
    
    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
    
    
    <!-- Web.Config Configuration File -->
    
    <configuration>
        <system.web>
            <customErrors mode="Off"/>
        </system.web>
    </configuration>
    
    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
    
    
    <!-- Web.Config Configuration File -->
    
    <configuration>
        <system.web>
            <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
        </system.web>
    </configuration>
     

    Oxan

    Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    Re: [Beta] MPWebStream: Stream TV over the internet

    Could you try it again, but from the computer where the Tv server is installed? Then you'll get a more detailed error message with which I can help you :)
     

    valtam

    Portal Pro
    March 27, 2010
    94
    6
    Home Country
    New Zealand New Zealand
    Re: [Beta] MPWebStream: Stream TV over the internet

    Fixed by updating to TV4Home.Server.CoreService.Setup_update3.zip
     

    Oxan

    Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    Re: [Beta] MPWebStream: Stream TV over the internet

    Ok that explains why it's not working, any plans for a version compatible with svn? Maybe when the beta is out...
    I'll see what I can do, if it's just changing the DLL's and recompiling it should be possible. Is there a SVN-compatible TV4Home out already?

    Fixed by updating to TV4Home.Server.CoreService.Setup_update3.zip
    That's great.
     

    Airshark

    MP Donator
  • Premium Supporter
  • February 23, 2007
    378
    23
    Baden- Württemberg
    Home Country
    Germany Germany
    AW: [Beta] MPWebStream: Stream TV over the internet

    Thanks, working great, but some of the VLC Buttons are not going (Fullscreen, Deinterlacing).
    Is it possible to take this into the Webinterface of TV4Home, so if you click on a channel, you can choose if you want to stream, or record it :)
    Would be very nice ;)
     

    Users who are viewing this thread

    Top Bottom