wnielson / Plex-Remote-Transcoder

A distributed transcoding backend for Plex
MIT License
644 stars 58 forks source link

Photo transcoder #5

Open liviynz opened 8 years ago

liviynz commented 8 years ago

I've been playing with your Python code for a few weeks and quite impressed with what you've done. It took me a few weeks as I wanted to get the main slave to be a fedora 22 system, ironed out a lot of issues but still couldn't get it to function right so I decided to go with Ubuntu virtuals and it works! Now it's been live for 3 days and overall I'm pretty happy although I have noticed one curious thing which is since moving to that setup there has been no photo transcoding done for thumbnails of new videos. My suspicion is that it's due to the load being passed off to one of the slaves and yet the location the transcoder needs to write to is a read only nfs share. My understanding is that the area is inside the /var/lib/plexmediaserver/....../cache/Phototranscoder directory (excuse the non exact path but I'm writing this on my phone, I can provide exact location as an update if needed). I'm looking to test this theory but I want to find a time that my system is quiet, take plex offline to do a full backup and then change the nfs shares to rw. I just wanted to let you know in case you had any insight into this. I have a few other suggestions/observations but I'll not clog this issue up with those. Cheers

liviynz commented 8 years ago

Update, so I tested with /var/lib/plexmediaserver as a read/write mount on the slaves and the photo transcoding started working again....so probably need to work out the best way to have this rather than the whole mount being rw

wnielson commented 8 years ago

Did you try making just /var/lib/plexmediaserver/....../cache rw?

liviynz commented 8 years ago

Yup...oh so many times and different ways...it doesn't like a nfs mount sitting on a nfs mount when the parent is ro and you want the child to be rw. I tried the nfs options that are supposed to allow it but it appears there's s bug...of course there is! lol. There's another possible way but it's a bit of a kludge... you make /opt/plex the rw share and then have /opt/plex/tmp for your standard transcoding, have /opt/plex/cache as your Phototranscoder area and symlink from blah blah original directory to that mount which is exported rw.

liviynz commented 8 years ago

It seems the sync function fails and it's related to this same issue as it's in a similar location, here's an example location for sync

/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sync+/4033693/da/70356.mp4.temp

liviynz commented 8 years ago

can you assign this to me please @wnielson

wnielson commented 8 years ago

So can we simplify this process (and solve the issue) by simply adding a command that creates the correct symlinks?

wnielson commented 8 years ago

I took a stab at this today. I moved the following directories to /opt/plex/tmp

mv "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media" /opt/plex/tmp/
mv "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache" /opt/plex/tmp/

and then symlinked them

ln -s /opt/plex/tmp/Cache "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/Cache"
ln -s /opt/plex/tmp/Media "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/Media"

Both the photo encoding and sync features are now working properly.

wnielson commented 8 years ago

I changed the the NFS export from

/var/lib/plexmediaserver 192.168.0.3(ro,sync,no_subtree_check)

to rw

/var/lib/plexmediaserver 192.168.0.3(rw,sync,no_subtree_check)

and thumbnails are generated as expected. Can you verify that this works for you?