Jump to content

Help with integrating Mythtv and Emby


jamiemb

Recommended Posts

jamiemb

Hello,

 

First a little background.  I currently have a mythtv backend which I use to record OTA broadcasts. Co-located on this server I use Plex to distribute the media on the server along with media saved on a Thecus nas via nfs shares to roku boxes and a Samsung smart hub tv.  

 

As anyone who has experience with mythtv knows, the naming convention they use for recordings are not recognized by the various media servers available.

 

To combat this I use a script, https://github.com/MythTV/mythtv/blob/master/mythtv/contrib/user_jobs/mythlink.pl, to create symlinks with names in a format that Plex or XBMC for that matter can read and understand.  These symlinks are created using a userjob in mythtv and placed into their own directory /show_names.  The symlinks created in this directory use the Title/Season XX/Title - SxxExx - Subtitle.mpg format.

 

I just point Plex to the /show_names directory and it does the rest.  While using Emby, it does not see the media files.  It does see the folders and therefore it pulls metadata for all the shows listed in this directory but it cannot access and play the media.

 

I am not sure if this is a limitation of Emby or a permissions issue.  The permissions for the symlinks themselves are rwxr-xr-x.  The permisssions for the actual .mpg files within the actual recording directories are -rw-r--r--.  Under both the ownership is mythtv:mythtv. As these permissions are generated automatically by mythtv the only easy way to grant more open permissions would be to run a cron job or similar to change permissions at given times or system event within mythtv to change permissions when a particular event triggers it.  

 

I have added the mediabrowser user to the mythtv group.  Do I need more than read permissions to play files?  Can I have the mythtv user be the user that mediabrowser runs under?  Can Emby resolve and follow symlinks?

 

All metadata is being saved to it's own directory in which mediabrowser has full read write and execute permissions.

 

Ideally, I would like Emby to run under the mythtv user so I can still limit permissions and not mess with the directories in which mythtv uses.

 

Thanks for any help.

 

Jamie

Link to comment
Share on other sites

jamiemb

As an update, I pulled an episode recorded from mythtv that is available on both myth and plex but was not showing in emby.  I changed permissions on both the symlink and the original myth recording to 777 and rescanned the library.  Still not available.

 

Any suggestions?

 

Thanks,

Jamie

Link to comment
Share on other sites

Can you do a test using a folder without a sym link just for the purpose of narrowing down where the issue is? Thanks.

Link to comment
Share on other sites

jamiemb

I copied a mythtv recording from my recording drives and placed into the show_names directory. In this case it was a recording of the latest episode of Revenge.  I placed it into the Revenge/Season 04/ folder within /show_names.

 

The recording as mythtv names them is 1091_2015032302010.mpg.  As this was the recording I was messing with permissions on I changed permissions back to the original permissions as mythtv assigns them, -rw-r--r--.  

 

I was in the process of then renaming this copy to the actual Season Episode but Emby had already found the recording under the mythtv name.  I then changed it to normal Emby naming conventions and it shows in my latest episodes under the TV library.  

 

I am at a hotel getting ready to go to work and my home internet is not very good but was able to start the episode.  I will test playback on this episode more thoroughly when I get home and have LAN access.

 

Failing any problems with that, it seems as if Emby has trouble following the symlink.

 

Thank you for your help.

 

Jamie

Link to comment
Share on other sites

thefirstofthe300

I am thinking the problem is related to the symlink as this is not the first issue I have seen where a user was trying to create a folder structure using symlinks and Emby couldn't see anything.

Link to comment
Share on other sites

jamiemb

I am thinking the problem is related to the symlink as this is not the first issue I have seen where a user was trying to create a folder structure using symlinks and Emby couldn't see anything.

 

I am inclined to agree.  The copy of the Revenge episode I renamed I was able to play no problem.  There seems to be two things hanging emby up.  First, my recording drives have no directory structure, just a bunch of *.mpg recordings along with *.jpg files all created by mythtv using their naming convention - chanid_yearutuctime.mpg or in english something like 1091_20150324020000.mpg.  Second, it is not able to play media that is accessed via a symlink.

 

I created a TV Library item and named it test and added one of my recording drives directly to it and emby could not recognize anything.  On the other hand, when I earlier copied the episode of Revenge to the show_names directory emby immediately recognized it even though I had yet to change the name from mythtv's generated name yet.  I think this had to do with emby reading and understanding the directory names leading to the recording whereas on the recording drive itself there was nothing for emby to recognize.  Permissions are the same in both directories and for all files within.

 

Thanks to both Luke and DaBungalow for taking the time to help, I appreciate it.

 

Jamie

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...