If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Linux-VDR Channel -> first alpha for testing

iPhonedationiPhonedation Posts: 152Members, Plex Pass, TunerTester Plex Pass
edited January 2014 in Channel Plugin Development

Hi all,

 

 

I really fell in love with Plex over the Christmas with all the time I had to play around with it. See, in my setup my beloved VDR (www.tvdr.de, www.yavdr.org) is the heart of our TV/Movie Stuff and yes - there are streaming solutions for my bunch of iOS devices, but these are only focusing on the VDR Part.

 

What I like about PLEX is, that it really is a hub to manage all kinds of stuff.

 

So, the VDR Scanner stuff allows to add my recordings to the Medialist in PLEX, means I could stream a recording to my iPad while lying in Bed or being on the road - great. Now I started to look into how I could get a channel created that allows to stream live TV.

 

And, based on the Dreambox Plugin and the chatter in the "play .ts file" thread here I created this:

 

http://gitlab.iphonedation.com/alex/plex-vdr-live-tv-plugin/tree/master

 

You *must* have a VDR instance running with the streamdev-server-plugin (as of 0.6.1, I am using a git version from 20131129 via yaVDR ppas) and also allow streaming.

 

Please - if you are a VDR user give this a try. I know that it is far from "good" yet, but it does deliver a stream to my iOS devices and PHT.

 

Feedback/Improvements/Additions are more than welcome!

 

Cheers,

Alex

«1

Comments

  • buescherbuescher Posts: 49Members, Plex Pass Plex Pass
    edited January 2014

    hm,

    cloned it to ~plex/Application Support/Plex Media Server/Plug-ins, restartet PMS and first, pms crashed. Stopped and started it again, now, pms is working as before, but i cannot see any reference to vdr.

    Where should it appear? in Library or Channels?

    renamed the folder to ....bundle and restarted PMS again, voila, now there is a vdr under channels.

    sadly, settings does not work. I tried to enter my vdr-serveraddress manually in the json, but still the plugin only shows "channel not available" ...

  • buescherbuescher Posts: 49Members, Plex Pass Plex Pass
    edited January 2014
    2014-01-03 18:23:01,403 (7fec60ff9700) :  DEBUG (runtime:717) - Handling request GET /video/vdr
    2014-01-03 18:23:01,405 (7fec60ff9700) :  DEBUG (runtime:814) - Found route matching /video/vdr
    2014-01-03 18:23:01,406 (7fec60ff9700) :  DEBUG (networking:172) - Requesting 'http://192.168.42.4:3000/groups.rss'
    2014-01-03 18:23:01,417 (7fec60ff9700) :  ERROR (networking:219) - Error opening URL 'http://192.168.42.4:3000/groups.rss'
    2014-01-03 18:23:01,418 (7fec60ff9700) :  INFO (__init__:31) - VDR Plugin: Couldn't connect to VDR.
    2014-01-03 18:23:01,418 (7fec60ff9700) :  DEBUG (runtime:106) - Sending packed state data (104 bytes)
    2014-01-03 18:23:01,418 (7fec60ff9700) :  DEBUG (runtime:915) - Response: [404] NoneType, 0 bytes
    
    

    maybe, its the thing with this rss stuff?

    I'm running yavdr, and streamdev is enabled (tried http://192.168.42.4:3000/S19.2E-1-1019-10301.ts) and got "Das Erste HD")

    btw, i'm running vdr-plugin-streamdev-server 0.6.0.git20121

  • iPhonedationiPhonedation Posts: 152Members, Plex Pass, TunerTester Plex Pass
    edited January 2014

    Did you check

    /var/lib/vdr/plugins/streamdev-server/streamdevhosts.conf

    it must allow access from the Plex IP or subnet

    ​You should be able to call the URL from the plex machine, try with lynx if you can open it from the shell.

  • buescherbuescher Posts: 49Members, Plex Pass Plex Pass
    edited January 2014

    all ist setup correctly:

    content of streamdevhosts.conf

    127.0.0.1             # always accept localhost
    192.168.42.0/24     # any host on the local net
    

    i did a 

    wget http://192.168.42.4:3000/groups.rss
    

    from the vdr-server itself:

    --2014-01-03 21:07:35--  http://192.168.42.4:3000/groups.rss
    Verbindungsaufbau zu 192.168.42.4:3000... verbunden.
    HTTP-Anforderung gesendet, warte auf Antwort... 400 Bad Request
    2014-01-03 21:07:35 FEHLER 400: Bad Request.

    Serverlog from vdr says:

    Jan  3 21:10:10 vdr-dach vdr: [1062] Streamdev: Accepted new client (HTTP) 192.168.42.3:51257
    Jan  3 21:10:10 vdr-dach vdr: [1062] streamdev-server: closing HTTP connection to 192.168.42.3:51257
    

    where does the rss-stuff come from ?

    edit: i just saw http://www.vdr-portal.de/board1-news/board2-vdr-news/121232-announce-streamdev-0-6-1/ here, that the rss-stuff is only available in streamdev 0.6.1 ..

    are you running vdr as yavdr-distri? where did the streamdev 0.6.1 come from?

  • iPhonedationiPhonedation Posts: 152Members, Plex Pass, TunerTester Plex Pass

    Could you add 'curl' to your server and  see what

    'curl http://192.168.42.4:3000/groups.rss' does return ?

    If this does not return the XLM RSS structure of the streamdevserver-plugin, I dunno ... Then I will set up a virtual machine to simulate the fact, that your plex is not localhost to vdr.

    Thanks,

    Alex

  • buescherbuescher Posts: 49Members, Plex Pass Plex Pass
    iPhonedation wrote on January 3 2014, 8:10 PM: »

    Could you add 'curl' to your server and  see what

    'curl http://192.168.42.4:3000/groups.rss' does return ?

    If this does not return the XLM RSS structure of the streamdevserver-plugin, I dunno ... Then I will set up a virtual machine to simulate the fact, that your plex is not localhost to vdr.

    Thanks,

    Alex

    from the vdr itself:

    curl -v http://192.168.42.4:3000/groups.rss
    * About to connect() to 192.168.42.4 port 3000 (#0)
    *   Trying 192.168.42.4... connected
    > GET /groups.rss HTTP/1.1
    > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
    > Host: 192.168.42.4:3000
    > Accept: */*
    >
    * HTTP 1.0, assume close after body
    < HTTP/1.0 400 Bad Request
    <
    * Closing connection #0
    
    

    same for 127.0.0.1

    btw - i edited my post above - did you notice?

  • iPhonedationiPhonedation Posts: 152Members, Plex Pass, TunerTester Plex Pass

    argh, I did not notice :-)

    I am using yavdr 0.5, pretty new. Did you update? also a dist-upgrade ? Maybe this is the reason why... 

    run

    apt-get update

    apt-get -s dist-upgrade 

    and see how much it will touch.

    mine's like this:

    ii  vdr-plugin-streamdev-server                0.6.1.git20131129-0yavdr0~precise           VDR Plugin to stream Live-TV to other VDR's - server part

  • buescherbuescher Posts: 49Members, Plex Pass Plex Pass
    edited January 2014

    runs like a charm.

    now watching livetv via plex on my SGS2 :-)

    only thing that does not work properly: acessing the live-tv channels via dlna from my smarttv (Panasonic). It stutters and does not play smooth.

    I know, its senseless watching tv on a tv via dlna and streamdev from a remove-VDR and not via dvb-s2, i just wanted to test :-)

    next step is dynamic epc-info via svdrp ?  :D

    ps: dist-upgrade was the missing step.

  • iPhonedationiPhonedation Posts: 152Members, Plex Pass, TunerTester Plex Pass

    So, this is good to read! 

    Next step is probably to kick out streamdev for everything but the stream and then use restfulapi for all the rest, incl. EPG and images... I'll try over the weekend if that makes sense. 

    The fact it stutters on your SGS2 and that a user in the vdrportal told me it does not work at all on windows RT devices makes me think that the mpeg2ts container I use is probably an issue. 

    Let's see if I can find a way to set this more dynamic, like client dependent. No clue yet.

    Thanks for the feedback :-) although I have no clue of that python stuff it means a lot of fun to have that ability.

    Cheers,

    Alex

  • buescherbuescher Posts: 49Members, Plex Pass Plex Pass

    you misunderstood me. on my sgs2 it plays *very* fine. It stutters on my smartTV :-)

  • neo3000neo3000 Posts: 2Members

    Hi guys,

    I am the guy who is having problems using the channel with Windows RT. Windows RT is not able to decode MPEG2 natively, so the stream must be transcoded.

    Today, I played around quite a bit and came to the following findings:

    • Plex/Web nicely performs the transcoding from MPEG2 to H264 - however I found no way to convince the Windows RT client to do it. It just tries to remux the stream, but as the video codec is kept, it will not play. Obviously other channels (e.g. DreamBox) suffer from the same issues.
    • I tried to do the transcoding from VDR side using externremux. This only works, if externremux is modified to use ffmpeg instead of the default mencoder. I can supply my externremux file if that is interesting. So the stream plays, but unfortunately, the transcoding does only stop, when I close the Plex client on Windows RT. I played around a bit by using "IndirectResponse" inside the plugin, but that made things worse as multiple requests were started in parallel resulting in multiple ffmpeg transcoding processes. And again, transcoding never stops :-(

    So it might be all an issue of the (quite new) Plex client for Windows RT ... 

    However, I am open to any ideas :-)

    Greetings,

    Neo3000

  • greeeny101greeeny101 Posts: 308Members, Plex Pass Plex Pass
    Hi guys. Check out the latest version of the dreambox channel. It plays live streams to most things these days. it's on my github . Have you tried setting the container manually. Ie to mp4 instead of mpegts . We've found that setting mp3 for the audio codec instead of aac helps a lot . <br /><br />Sent from my HTC One using Tapatalk<br /><br />
  • iPhonedationiPhonedation Posts: 152Members, Plex Pass, TunerTester Plex Pass

    Hey green,

    thanks for the hint - I used the basic version as a starting point but I have not yet taken a look at your enhanced stuff. Will do so certainly!

    Cheers

    Alex

  • neo3000neo3000 Posts: 2Members

    @greeny101: I tried to set the container to mp4 and audio codec to mp3. However it does not change a thing. The 

    I had a look at your dreambox channel code but I could not find a real difference on how the stream sent to the device. 

    The current solution to use the VDR internal transcoding is quite ok, but you have to close the full Plex Client to really stop the stream and the transcoding :-(

    Not very zap friendly and a low women-acceptance factor :-(

    I get more and more convinced that the real issue with Windows RT is part of the client ...

    Greetings,

    Neo3000

  • gioqwgioqw Posts: 1Members, Plex Pass Plex Pass

    Hi,

    I really like this VDR channel approach, I was almost beginning to develop it myself but during my search on how to write a plugin for Plex I stumbled across this thread.

    As others already said, it runs like a charm on my Android phone, iPad and via Plex/Web but the Plex client on a Samsung Smart TV doesn't play it with the error "File not found".

    But I still have some problems with my new VDR installation on an Arch box.

    Greetings,

    gio

  • iPhonedationiPhonedation Posts: 152Members, Plex Pass, TunerTester Plex Pass

    Hi, thanks for the feedback!

    I am currently trying to use the restfulapi-plugin in order to access real XML with a better structure than streamdev, but i am struggling with XPATH  ;-) 

    So, more will come soon I hope. After that works, we can look into how streaming can be optimized. Meanwhile, check out the code and play with it yourself if you like, I am happy to incorporate work by others - this is still so basic ;-)

    Cheers

    Alex

  • iPhonedationiPhonedation Posts: 152Members, Plex Pass, TunerTester Plex Pass

    Hey, 

    I pushed an update to my git repo yesterday. Please play with this.

    It uses vdr-plugin-restfulapi as a *MUST* and hence requires this. Only update if you have that installed and running. It should work seamlessly like before, but also show channelslogos if you configured the restfulapi parameters for your vdr accordingly.

    I will base my further work on this, so EPG and more details are likely to come soon. Ater that I will look into transcoding, streamtypes, etc and how this is all handled

    Cheers

    Alex

  • buescherbuescher Posts: 49Members, Plex Pass Plex Pass
    2014-01-09 22:30:37,436 (7f7a9d7fa700) :  DEBUG (preferences:256) - Loaded preferences from DefaultPrefs.json
    2014-01-09 22:30:37,437 (7f7a9d7fa700) :  DEBUG (preferences:178) - Loaded the user preferences for com.plexapp.plugins.vdr
    2014-01-09 22:30:37,439 (7f7a9d7fa700) :  CRITICAL (runtime:880) - Exception (most recent call last):
      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 840, in handle_request
        result = f(**d)
      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/handlers/base.py", line 119, in call
        result = self.func(*args, **kwargs)
      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/plex-vdr-live-tv-plugin.bundle/Contents/Code/__init__.py", line 44, in MainMenu
        xml = LISTGROUPS_URL % (Prefs['host'], Prefs['restapi'])
      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 111, in <lambda>
        _getitem_           = lambda x, y: x.__getitem__(y),
      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/runtimekit.py", line 506, in __getitem__
        return self._sandbox.preferences.get()[name]
      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/preferences.py", line 330, in __getitem__
        raise KeyError("No preference named '%s' found." % name)
    KeyError: "No preference named 'restapi' found."
    
    2014-01-09 22:30:37,441 (7f7a9d7fa700) :  DEBUG (runtime:106) - Sending packed state data (104 bytes)
    2014-01-09 22:30:37,442 (7f7a9d7fa700) :  DEBUG (runtime:915) - Response: [500] 1683 bytes
    
    

    ??

    do i need the vdr-plugin-restfulapi installed on the machine where plex is running?

  • iPhonedationiPhonedation Posts: 152Members, Plex Pass, TunerTester Plex Pass
    edited January 2014

    Ah ... damn, that was missing a entry in the DefaultPrefs.json ... check the repo again or add this:

        {
            "id": "restapi",
            "type": "text",
            "label": "Restfulapi Port",
            "default": "8002"
        },
    

    I am really sorry. 

    The restful-api plugin is a must on the vdr machine.

  • buescherbuescher Posts: 49Members, Plex Pass Plex Pass

    Rock'n'Roll :-)

    works like a charme. ..

«1
Sign In or Register to comment.