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!

[REL] MythTV plug-in

1235720

Comments

  • schaumburg01schaumburg01 Posts: 136Members, Plex Pass Plex Pass

    @gmcallow

    I've just noticed syncing errors myself - I normally only use sync'ing on holidays, so the errors might have been there for a while.

    I just googled the error message, and came across https://forums.plex.tv/topic/101405-there-is-no-uuid-available-for-this-library-section/, which reports the same error on Mac servers, but with a Windows server working fine (mine's a Linux server, and I haven't diagnosed the error yet.

    I'll try syncing with my experimental Windows server, and see if that works any better.

  • schaumburg01schaumburg01 Posts: 136Members, Plex Pass Plex Pass

    @gmcallow

    I've tested, and the "no UUID" error you reported doesn't happen when using the Android client - only iOS (so far). Annoying, since my iPad is my favourite device for offline viewing..:-(

    I've posted a question on this forum, and I'm hoping a solution will be found.

  • rage_311rage_311 Posts: 5Members, Plex Pass Plex Pass

    Thanks for the great plug-in!

    I just installed it on my FreeBSD 9.2 server without a hitch, and it works flawlessly with both the web and Android clients.

    If you're interested in adding it to the docs, the directory for the Plex plug-ins on FreeBSD 9.X (probably the same for other versions), it's:

    /usr/local/plexdata/Plex Media Server/Plug-ins/

    Here was my entire install process:

    $ wget --no-check-certificate https://github.com/tschaumburg/MythRecordings.bundle/archive/0.2.tar.gz
    $ tar xzvf 0.2.tar.gz
    # mv MythRecordings.bundle-0.2 "/usr/local/plexdata/Plex Media Server/Plug-ins/MythRecordings.bundle"
    # chown -R plex:plex "/usr/local/plexdata/Plex Media Server/Plug-ins/MythRecordings.bundle"
    # service plexmediaserver restart
  • pthetaptheta Posts: 5Members, Plex Pass Plex Pass
    edited March 2014
    schaumburg wrote on March 13 2014, 8:50 AM: »

    @ptheta,

    If you look in MythRecordings.bundle/Contents/Code/__init__.py, line 195, you'll see

    	return VideoClipObject(
                    title = header,
                    summary = str(warning) + str(descr),
                    originally_available_at = airdate,
                    thumb = thumb,
    		duration = int(duration),
    		key = Callback(RecordingInfo, chanId=chanId, startTime=recordingStart),
    		rating_key= str(int(airdate.strftime('%Y%m%d%H%M'))),
    		items = [
    			MediaObject(
    				parts = [
    					PartObject(key=testURL, duration=int(duration))
    				],
    				duration = int(duration),
    				container = 'mp2ts',
    				#video_codec = VideoCodec.H264,
    				#audio_channels = 2,
    				optimized_for_streaming = True
    			)
    		]
    

    If there's a fix for your issue, it's probably in there (maybe increasing audio_channels will let both audio channels through, so the client has something to choose between? To test, just remove the # in front of audio_channels).

    As an alternative (or while you wait), have you considered letting MythTV auto-transcode your recordings in a way that removes the unwanted audio channel? Obviously not elegant, I admit, but if it works...

    :-)

    I had a look at this tonight and changing the audio_channels didn't do it.  I had a hunt around for the PLex API and I found that settingis actually for describing stereo vs. 5.1 so definitely not the right thing.  

    Having streamed one of the problem videos and watched the plex log file I don't believe that Plex is making a choice of audio stream.  Certainly I saw no evidence of that.  I'm now thinking that it is the HLS support in MythTV that is making that choice.  Assuming that is the case I think your transcode to strip the stream out is the most likely solution here.  Either that or learn a lot more about MythTV internals.  My cursory glance didn't find any HLS configuration settings but in truth I only had a very quick look.

    Regards,

     Paul.

  • gmcallowgmcallow Posts: 24Members, Plex Pass Plex Pass

    @schaumburg

    Many thanks for looking at this.  I'm in a similar position - was about to do some travelling, so came back to see if I could get sync'ing working with Plex and Myth!

    Just to add a bit more info - I don't think the UUID issue is specific to your plugin. Checking with some other channels, I get the same error on iOS with the Apple Movie Trailers channel.  Syncing with Library is fine - just channels are a problem.

    It seems that iOS 7.1 has brought on a few problem with the iOS Plex client. A new version was available for download this morning which apparently fixes a few of these issues, but doesn't appear to fix the UUID sync problem.  I can see your other thread in Channel Development, so will post this info there.

    Thanks!

  • romanodogromanodog Posts: 23Members, Plex Pass Plex Pass
    edited April 2014

    EDIT: Well apparently the API is available in 0.25 and later, so this isn't going to work for earlier versions of mythtv.  I'm going to upgrade!  Disregard the post below.

    I'm having a little trouble getting this plugin to work.  I can get to the main menu of the plugin but I get an error "The media server responded with an error" when I try to display any recordings from the four options on that menu.  I looked at the mythbackend log file as it was loading and i'm getting the following error:

    2014-04-05 14:05:56.865 MythSocket(7f838c3740b0:40): Protocol error: 'GET /Dvr' is not a valid size prefix. 156 bytes pending.
    2014-04-05 14:06:16.880 MainServer, Warning: Unknown socket closing MythSocket(0x7f838c3740b0)

    Just wondering if anyone has any ideas on how I can get this working.  Maybe I don't have something set up correctly on my backend.  I'm running mythtv 0.24

    I should also maybe mention that I have this working fine in the XBMC mythtv plugin. 

    Thanks in advance for any help!

  • cdallumcdallum Posts: 1Members, Plex Pass Plex Pass

    As with others posting in this thread, I first want to thank you for creating such a useful Plex app.  Watching recorded and live TV are the only two reasons I have an XBMC box in addition to my Roku 3.  I understand live TV isn't yet available, so other than adding my vote for that capability, I'll move on to my question.

    My MythTV backend is currently using an older HDHomeRun dual tuner box with unencrypted (US) channels.  As is well known, the output is MPEG-2 and requires transcoding to play on the Roku.  I'm able to do so but with some stuttering.  I could play around with various settings and/or hardware upgrades.  As a more permanent solution, I see SiliconDust has a newer product named the HDHomeRun Plus.  It transcodes the incoming stream directly to H.264 output, so the MythTV backend would no longer have to transcode the video.  Does anyone have this new tuner, and if so, does it work as well with MythTV as the standard dual tuner?

  • greatfront7greatfront7 Posts: 1Members, Plex Pass Plex Pass

    I'm in the same boat with a rock solid 0.24 backend that I am scared to death to upgrade to a newer version of my wife's reaction when the upgrade goes horribly wrong.

    Is there any possibility (or suggested hacks) for adding pre 0.25 integration for this plug-in?  I've been testing mythlink.pl and mythicalLibrarian scripts but haven't had any success with adding my myth recordings successfully to Plex.  

    romanodog wrote on April 5 2014, 6:16 PM: »

    EDIT: Well apparently the API is available in 0.25 and later, so this isn't going to work for earlier versions of mythtv.  I'm going to upgrade!  Disregard the post below.

    I'm having a little trouble getting this plugin to work.  I can get to the main menu of the plugin but I get an error "The media server responded with an error" when I try to display any recordings from the four options on that menu.  I looked at the mythbackend log file as it was loading and i'm getting the following error:

    2014-04-05 14:05:56.865 MythSocket(7f838c3740b0:40): Protocol error: 'GET /Dvr' is not a valid size prefix. 156 bytes pending.
    2014-04-05 14:06:16.880 MainServer, Warning: Unknown socket closing MythSocket(0x7f838c3740b0)

    Just wondering if anyone has any ideas on how I can get this working.  Maybe I don't have something set up correctly on my backend.  I'm running mythtv 0.24

    I should also maybe mention that I have this working fine in the XBMC mythtv plugin. 

    Thanks in advance for any help!

  • tgourleytgourley Posts: 9Members, Plex Pass Plex Pass
    edited April 2014

    Hi All,
    I've been unable to get sync working for my andriod tablet. (4.2.1 w/32 GB SD card, plexapp is set to use 16 GB)
    I have a mythbuntu 0.27 backend, mythroku installed (mpgs are already transcoded to mp4 on the backend) and plex on windows xp 32 bit (latest and greatest version w/plex pass sub)
    I can sync recordings and they show up on the device but none of them play when offline (which is the whole point of syncing)
    I get an error that says:

    An error occurred while attempting to navigate to the selected item. It appears that the associated server is no longer accessible.

    I've looked at the logs and I'm guessing "the server" being referred to is actually the tablet - it is returning an error:

    D/Plex (14581): Fetching http://127.0.0.1:32400/sync/xx-0ad8-486e-978a-xx/yyy/channels/dk.schaumburg-it.plexapp.mythrecordings/key//video/mythrecordings/GetRecordingInfo?chanId=2641&startTime=2014-04-18T23%3A00%3A00Z
    D/Plex (14581): [pms] /127.0.0.1:58567 - GET /sync/xx-0ad8-486e-978a-xx/yyy/channels/dk.schaumburg-it.plexapp.mythrecordings/key//video/mythrecordings/GetRecordingInfo?chanId=2641&startTime=2014-04-18T23%3A00%3A00Z
    E/Plex (14581): Error parsing XML from file:///sync/xx-0ad8-486e-978a-xx/yyy/channels/dk.schaumburg-it.plexapp.mythrecordings/key//video/mythrecordings/GetRecordingInfo?chanId=2641&startTime=2014-04-18T23%3A00%3A00Z: Unexpected end of document
    E/Plex (14581): Error fetching http://127.0.0.1:32400/sync/xx-0ad8-486e-978a-xx/yyy/channels/dk.schaumburg-it.plexapp.mythrecordings/key//video/mythrecordings/GetRecordingInfo?chanId=2641&startTime=2014-04-18T23%3A00%3A00Z:
    E/Plex (14581): Failure: 500 Internal Server Error
    D/Plex (14581): [Download Item] Retry failed. 

    If I look at the mp4 files they are intact and will play using other players.
    It looks like the url is referring to xml files which do exist as gz files but only contain 20 bytes as far as I can tell, I can never see contents of them using various viewers.
    (and I do get an xml parse error from firefox, so it does look like a real "unexpected end of file")

    Here is a snip of the server log of one of the syncs. There are several errors, could any of these be the root issue?

    Apr 21, 2014 21:21:20:793 [1492] INFO - Sync: analyzed 1 sync list(s) with 2 sync items(s)
    Apr 21, 2014 21:21:21:621 [1372] INFO - [Transcoder] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'http://192.168.1.116:6544/Content/GetRecording?ChanId=2052&StartTime=2014-04-14T01:30:00Z':
    Apr 21, 2014 21:21:21:621 [2896] INFO - [Transcoder]     Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 704x474 [SAR 10:11 DAR 320:237], 1128 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
    Apr 21, 2014 21:21:21:621 [2996] INFO - [Transcoder]     Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s
    Apr 21, 2014 21:21:21:621 [2200] INFO - [Transcoder]     Stream #0:2(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s
    Apr 21, 2014 21:21:21:653 [5596] INFO - [Transcoder] Output #0, mp4, to 'C:\Documents and Settings\tim\Local Settings\Application Data\Plex Media Server\Cache\Transcode\Sync\1718622\1966920\799d80a535670e572d81.mp4.temp':
    Apr 21, 2014 21:21:21:653 [2284] INFO - [Transcoder]     Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x474 [SAR 1:1 DAR 320:237], q=-1--1, 30k tbn, 29.97 tbc
    Apr 21, 2014 21:21:21:653 [4788] INFO - [Transcoder]     Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 217 kb/s
    Apr 21, 2014 21:21:22:371 [1492] INFO - Sync: analyzed 1 sync list(s) with 2 sync items(s)
    Apr 21, 2014 21:21:22:762 [3540] ERROR - PlexClient::downloadContainer: expected MediaContainer element, found html
    Apr 21, 2014 21:21:22:762 [3540] ERROR - PlexContainer::GetStreamMetadata - unable to get directory /library/metadata/201404140130
    Apr 21, 2014 21:21:22:762 [3540] ERROR - Sync: unable to get stream metadata
    Apr 21, 2014 21:21:22:778 [4528] ERROR - PlexClient::downloadContainer: expected MediaContainer element, found html
    Apr 21, 2014 21:21:22:778 [4528] ERROR - PlexContainer::GetStreamMetadata - unable to get directory /library/metadata/201404212330
    Apr 21, 2014 21:21:22:778 [4528] ERROR - Sync: unable to get stream metadata
    Apr 21, 2014 21:22:04:918 [1880] ERROR - handle_stream_read error 2 End of file
    Apr 21, 2014 21:23:57:793 [2376] INFO - Sync: analyzed 1 sync list(s) with 2 sync items(s)
    Apr 21, 2014 21:23:58:106 [2284] ERROR - PlexClient::downloadContainer: expected MediaContainer element, found html
    Apr 21, 2014 21:23:58:106 [2284] ERROR - PlexContainer::GetStreamMetadata - unable to get directory /library/metadata/201404212330
    Apr 21, 2014 21:23:58:106 [2284] ERROR - Sync: unable to get stream metadata
    Apr 21, 2014 21:23:58:106 [1372] ERROR - PlexClient::downloadContainer: expected MediaContainer element, found html
    Apr 21, 2014 21:23:58:106 [1372] ERROR - PlexContainer::GetStreamMetadata - unable to get directory /library/metadata/201404140130
    Apr 21, 2014 21:23:58:106 [1372] ERROR - Sync: unable to get stream metadata
    Apr 21, 2014 21:26:05:528 [5348] INFO - Sample aspect ratio is 1:1
    Apr 21, 2014 21:26:05:528 [5348] INFO - Matched video stream: FFmpeg index 0 (id 1) -> MediaInfo stream index 0 (id 1)
    Apr 21, 2014 21:26:05:528 [5348] INFO -  * MediaInfo: format=AVC, bitrate=1614514
    Apr 21, 2014 21:26:05:528 [5348] INFO -  * FFmpeg: codec=h264, bitrate=1614515
    Apr 21, 2014 21:26:05:528 [5348] INFO - Matched audio stream: FFmpeg index 1 (id 2) -> MediaInfo stream index 0 (id 2)
    Apr 21, 2014 21:26:05:528 [5348] INFO -  * MediaInfo: format=AAC, language=, bitrate=199746, channels=2
    Apr 21, 2014 21:26:05:528 [5348] INFO -  * FFmpeg: codec=aac, language=, bitrate=199746, channels=2
    Apr 21, 2014 21:26:07:996 [5348] INFO - Sync: analyzed 1 sync list(s) with 2 sync items(s)
    Apr 21, 2014 21:26:09:043 [4788] ERROR - PlexClient::downloadContainer: expected MediaContainer element, found html
    Apr 21, 2014 21:26:09:043 [4788] ERROR - PlexContainer::GetStreamMetadata - unable to get directory /library/metadata/201404212330
    Apr 21, 2014 21:26:09:043 [4788] ERROR - Sync: unable to get stream metadata
    Apr 21, 2014 21:26:09:043 [2284] ERROR - PlexClient::downloadContainer: expected MediaContainer element, found html
    Apr 21, 2014 21:26:09:043 [2284] ERROR - PlexContainer::GetStreamMetadata - unable to get directory /library/metadata/201404140130
    Apr 21, 2014 21:26:09:043 [2284] ERROR - Sync: unable to get stream metadata
    
    

    I'll also add that the forced plex transcode is painful since all my recordings are already suitable for use directly, but that is a secondary issue since they are currently unplayable once sync'd at the moment.

    Any help on the sync issue would be greatly appreciated!

  • djwhytedjwhyte Posts: 18Members, Plex Pass Plex Pass
    tgourley wrote on April 21 2014, 3:12 AM: »

    I've been unable to get sync working for my andriod tablet. 

    Just to confirm, all my attempts to sync have yielded the same results.

  • schaumburg01schaumburg01 Posts: 136Members, Plex Pass Plex Pass
     
    Have any of you been able to sync contents from other channels (e.g. Apple Movie Trailers, or some other channel in widespread use)?
     
    When I tried a few weeks back (on both Android and iOS), channel sync didn't work for any channels - but that may have changed (I'm assuming the developer just focused on libraries first).
     
    If you can't get sync to work for Apple Trailers, you can help by reporting this to the Plex developers - so it's not just me nagging them.
     
    If you CAN get sync to work for other channels, let me know, and I'll try to figure out what I'm doing wrong.
  • tgourleytgourley Posts: 9Members, Plex Pass Plex Pass
    edited April 2014
    schaumburg wrote on April 22 2014, 1:17 PM: »
     
    Have any of you been able to sync contents from other channels ..

    I just tried an apple trailer, the sync and playback worked fine.

    I admit this is much smaller than the content from my mythtv box so I'll look for some larger things as well and let you know.

    (I have tried some other large-ish personal videos and they also sync and playback fine)

    I am curious about this:

                MediaObject(
                    parts = [
                        PartObject(key=testURL, duration=int(duration))
                    ],
                    duration = int(duration),
                    container = 'mp2ts',
                    #video_codec = VideoCodec.H264,
                    #audio_channels = 2,
                    optimized_for_streaming = True
                )
    

    My recordings are transcoded as mp4's, not the usual mythtv mp2's, should I be specifying a different container?

    (or something else here?)

    Thanks for the response.

    Tim

  • tgourleytgourley Posts: 9Members, Plex Pass Plex Pass
    edited April 2014

    I did try to change the MediaObject that seemed apropriate but had no success.

    The metadata still seems to sync as an empty file.

    #container = 'mp2ts',
    #video_codec = VideoCodec.H264,
    #audio_channels = 2,
    # ##
    protocols = [
    Protocol.RTMP
    #Protocol.HTTPMP4Video
    #Protocol.HTTPMP4Streaming
    ],
    container = Container.MP4,
    video_codec = VideoCodec.H264,
    audio_codec = AudioCodec.AAC,
    audio_channels = 2,
    # ##

    Either this has nothing to do with the real issue, or I am not seeing my change (due to caching or something... I did restart the server in between changes)

    Any help would be appreciated.

    Tim

  • schaumburg01schaumburg01 Posts: 136Members, Plex Pass Plex Pass

    @tgourley

    I hope to have some time to look at this over the weekend (not that I expect to be any better at it than you - but two pairs of eyes...). Here's how far I've got so far:

    Generally, I don't think the problem is with the recordings themselves. After all, they play back fine, and the actual sync phase (transcoding + transferring) doesn't seem to cause any errors - the client just seems to mislay the recording when trying to play it back. My hunch says it's something to do with the structure of ObjectContainers etc.

    To get to the bottom of this, I have tried looking at the XML (from http://your-plex-server:32400 and below), which I believe is the actual protocol between Plex server and clients - and likely used by the sync engine.

    I found that the VideoClip object (represented by the Video element in the XML) has a circular reference to itself via the "key" attribute. That may confuse the sync engine. I plan to try to change that.

    If that doesn't work, I'll throw in the towel and submit a bug report.

    Thomas

    PS: I just found out that you can get the client to email you client-side logs (bottom of the settings) - that might be useful too.

  • djwhytedjwhyte Posts: 18Members, Plex Pass Plex Pass
    djwhyte wrote on April 22 2014, 3:22 AM: »

    Just to confirm, all my attempts to sync have yielded the same results.

    It looks like today's release of Plex for Android had a bug fix to help with sync'd programs that wouldn't play.  I am unfortunately away from my tablet, but maybe this has resolved the issue?  Anyone able to confirm?

  • cofulesecofulese Posts: 3Members, Plex Pass Plex Pass
    Hi there

    Firstly, thank you for the amazing plugin :-)

    I was just wondering if there's a way of filtering out the deleted recordings from MythTV? Maybe using recgroup as a root level folder?

    Cheers
  • tgourleytgourley Posts: 9Members, Plex Pass Plex Pass
    djwhyte wrote on May 1 2014, 7:42 AM: »

    It looks like today's release of Plex for Android had a bug fix to help with sync'd programs that wouldn't play.  I am unfortunately away from my tablet, but maybe this has resolved the issue?  Anyone able to confirm?

    Nope, still not working for me. :(

  • annikajayukannikajayuk Posts: 8Members
    ptheta wrote on March 28 2014, 9:11 PM: »

    Having streamed one of the problem videos and watched the plex log file I don't believe that Plex is making a choice of audio stream.  Certainly I saw no evidence of that.  I'm now thinking that it is the HLS support in MythTV that is making that choice.


    The /Content/GetRecording method that the Plex channel uses isn't part of MythTV's HLS support—all it does is return the file on disk to the client. It's Plex that's making the bad decision. On our Now TV boxes both the main audio and the audio description are played, and with the Roku client there's no way to change that during playback.
     
    I've been trying to find a way to hint, ahead of time, at the existence of multiple audio streams, but nothing seems to make a difference to this problem or the everything playing through the amp in 5.1 problem (which isn't so much of a problem for us, because we use MythFrontend in the lounge—this is only going to be used for the bedroom set).
     
    Sam
  • annikajayukannikajayuk Posts: 8Members
    edcoughlan wrote on May 1 2014, 10:28 PM: »

    I was just wondering if there's a way of filtering out the deleted recordings from MythTV? Maybe using recgroup as a root level folder?

    GrahamH68 wrote on December 3 2013, 1:41 AM: »

    Works great!   One small niggle at this point; is it possible to filter out deleted recordings?


    Find line 76 (for 0.2—anyone using master ought to be able to find it on their own :P) of MythRecordings.bundle/ Contents/Code/ __init__.py, which should read:
    	for recording in recordings:
    After that line, insert the following two lines:
    		if recording.find('Recording/RecGroup').text == 'Deleted':
    			continue
    Because this is Python, the indent level is important. Line 77 of the edited file needs two tabs, line 78 needs three tabs.

    Sam
  • annikajayukannikajayuk Posts: 8Members
    Thanks for the channel! A really easy way to get a really cheap frontend going in the bedroom.

    I notice that /Content/GetRecording on the master backend will respond with an HTTP redirect to the original recording backend, even if the master backend override is in effect. It might be worth adding a preference that if enabled instead uses /Content/GetFile, which is unaffected by things like recording hosts. To use GetFile, you'd have code like this:
    fileName = recording.find('FileName').text
    storageGroup = recording.find('Recording/StorageGroup').text
    testURL = PVR_URL + 'Content/GetFile?StorageGroup=%s&FileName=%s' % (storageGroup,fileName,)
    Sam
Sign In or Register to comment.