VLC Source Filter for TV Server (1 Viewer)

Yura80

Portal Member
May 6, 2008
14
28
Home Country
United States of America United States of America
Hi,

I'm developing an experimental directshow streaming source filter for TV Server. It's basically a wrapper for LibVLC and it can use it's powerful capture, muxing and transcoding capabilities to deliver almost any content to MediaPortal TV Server.

This is an early proof-of-concept version that needs debugging and optimization, but I already have some good results with it.

Usage is similar to the original MPTVSource filter. When adding channels, enter any URL supported by VLC, followed by transcoding or muxing options, similar to VLC command line.
When adding channels manually, set Network ID = 0, Transport ID = 0, Service ID = 1, PMT PID = 66.

Some examples:
- "standard" udp/rtp IPTV (similar to the original filter):
rtp://@239.1.1.1:5004

- wmv/asf stream capture with transcoding to MPEG2:
mms://some-server.tv:8000/file.asf :mms-caching=500 :sout=#transcode{vcodec=mp2v,fps=25,vb=5000,scale=1,acodec=mpga,ab=192,channels=2,samplerate=44100}

- streaming a local H.264 or MPEG2 video file:
"C:\My Videos\some_video.mkv" :sout-mux=ts

- streaming a wmv file (transcoding required):
"C:\My Videos\some_video.wmv" :sout=#transcode{vcodec=mp2v,fps=30,vb=5000,scale=1,acodec=mpga,ab=192,channels=2,samplerate=44100}

- usb webcam or another directshow capture device:
dshow:// :dshow-vdev="Integrated Webcam #2" :dshow-adev= :dshow-caching=200 :sout=#transcode{vcodec=mp2v,fps=30,vb=2000,scale=1,acodec=mpga,ab=128,channels=2,samplerate=44100}

- capture MPEG2 TS stream via firewire from Motorola DCT-XXXX/QIP-XXXX digital cable box:
dshow:// :dshow-vdev="Motorola AV/C Tuner Device" :dshow-adev= :dshow-caching=200

- executing external program for channel switching:
dshow:// :dshow-vdev="Motorola AV/C Tuner Device" :dshow-adev= :dshow-caching=200 :exec="C:\Program Files\Timmmoore\MCE 2005 STB Controller\channelw.exe" :exec-opt="-f 2 0620"

Installation:
Option 1:
Replace original MPIPTVSource filter.
- install a recent version of VLC Media Player
- extract 'mpvlcsource_rp.zip' to VLC install directory (\Program Files\VideoLAN\VLC)
- run 'reg.bat', or manually unregister MPIPTVSource.ax, register MPVLCSource.ax and restart TVServer.
Option 2:
Install as a second virtual DVB IP card and keep the original filter. Requires patched SetupTv.exe and TvLibrary.dll (version 1.2.1 only!)
- install a recent version of VLC Media Player
- stop TV Server
- backup SetupTv.exe and TVLibrary.dll files it the TV Server directory (\Program Files\Team MediaPortal\MediaPortal TV Server)
- extract 'tvserver_patch.zip' to TV Server directory, replacing existing files
- extract 'mpvlcsource.zip' to VLC install directory (\Program Files\VideoLAN\VLC)
- run 'reg.bat', or manually register MPVLCSource.ax and restart TVServer.


Update history:
2011-11-25:
- improved stability
- added .ini file
- added :no-remux option (enabled by default)
- two installation options

Source:
Filter: https://github.com/yura80/mpvlcsource
TV Server patch: https://github.com/yura80/MediaPortal-1/commit/c6bec3b787355035b671fa89b3d481725fa7580c

Any feedback is appreciated.
Please don't forget to attach your logs from TVServer log directory (particularly MPVLCSource-*.Log)
 

Attachments

  • mpvlcsource.zip
    21.5 KB
  • mpvlcsource_rp.zip
    21.6 KB
  • tvserver_patch.zip
    700.5 KB

georgius

Retired Team Member
  • Premium Supporter
  • October 31, 2010
    1,376
    654
    Bratislava
    Home Country
    Slovakia Slovakia
    Just small comment: transcoding on the fly (which is needed for various formats because tv server accepts only MPEG-TS) is not good idea.
     

    Yura80

    Portal Member
    May 6, 2008
    14
    28
    Home Country
    United States of America United States of America
    Just small comment: transcoding on the fly (which is needed for various formats because tv server accepts only MPEG-TS) is not good idea.
    Well, maybe, but what is the alternative?
    It works quite well for several web streams I tried, consuming less that 30% of CPU (2.2 GHz dual core). And the same thing (encoding to mpeg2) was always done in TV Server for analog cards.
    If a video is h.264 or mpeg2, but in different container (mkv, mpeg-ps, flv, etc.), no transcoding is necessary. Just remuxing to TS.
     

    Yura80

    Portal Member
    May 6, 2008
    14
    28
    Home Country
    United States of America United States of America
    Yes, you're right, for most formats there is no other alternative :( I was before same decision when I was implementing RTSP protocol to DVB-IP MediaPortal IPTV Source Filter.
    Why are you developing this filter for MP? Do you have some streams in unsupported format and you want to add it to TV?
    There were two objectives:
    1) Add support for mms/wmv and rtmp/flv streams. There are many free online tv broadcasts in these formats. I know it could be done with Online Videos plugin, but it's not cool: there is no timeshifting, EPG, etc.
    2) Implement capture from non-BDA DirectShow capture devices, such as North American cable set-top-boxes with firewire port. There were many requests for adding this to the TV Server.

    This filter is not intended to eventually replace the IPTV Source Filter you are working on. It's just an optional extension for those who may want the functionality it provides.
     

    georgius

    Retired Team Member
  • Premium Supporter
  • October 31, 2010
    1,376
    654
    Bratislava
    Home Country
    Slovakia Slovakia
    There were two objectives:
    1) Add support for mms/wmv and rtmp/flv streams. There are many free online tv broadcasts in these formats. I know it could be done with Online Videos plugin, but it's not cool: there is no timeshifting, EPG, etc.
    Yes, you're right. There is OnlineVideos plugin for this purpose, but it doens't have TV features like EPG, recording, etc.

    2) Implement capture from non-BDA DirectShow capture devices, such as North American cable set-top-boxes with firewire port. There were many requests for adding this to the TV Server.
    In current state there is no other solution as you proposed.

    So, I wish you luck with your filter :)
     

    chielmi

    Portal Member
    September 30, 2009
    14
    0
    Home Country
    Netherlands Netherlands
    I chose option 1 to install this VLC source filter.
    I extracted the files in the zip-archive. Had to change the third line in the batch-file from:
    regsvr32 mpvlcsource.ax
    to
    regsvr32 "C:\Program Files\VideoLAN\VLC\mpvlcsource.ax"
    because I got an error the mpvlcsource.ax file could not be found.

    Now when I try to add a webstream like:

    channel: 600
    URL: mms://pctv.chello.com/NL1
    Network ID: 0
    Transport ID: 0
    Service ID: 1
    PMT PID: 66
    Provider: pctv.chello.com

    Map it to the Mediaportal iptv source filter I get an error when I try to preview the stream
    Preview failed: no PMT found

    What am I doing wrong? :(
     

    Yura80

    Portal Member
    May 6, 2008
    14
    28
    Home Country
    United States of America United States of America
    Map it to the Mediaportal iptv source filter I get an error when I try to preview the stream
    Preview failed: no PMT found

    What am I doing wrong? :(

    Transcoding is required for mms streams.
    Your URL should look like this:
    Code:
    mms://pctv.chello.com/NL1 :sout=#transcode{vcodec=mp2v,fps=25,vb=5000,scale=1,acodec=mpga,ab=192,channels=2,samplerate=44100}
     

    chielmi

    Portal Member
    September 30, 2009
    14
    0
    Home Country
    Netherlands Netherlands
    Something else seems to be wrong. I can only play these streams with Windows media player, VLC doesn't seem to work. So I guess it's not MediaPortal related but a problem with VLC / codecs.
    I will check it out later this week.
     

    Users who are viewing this thread

    Top Bottom