I have a dedicated Plex Media Server 1.8.1.4139 running Windows 2012 server connected to 1Gbps ethernet, and I recently bought an HDHomeRun EXTEND 2-tuner device for OTA free live broadcasts connected to a roof antenna also connected to the same 1Gbps network. Plex DVR has identified the HDHomeRun device, found 52 channels, it can scan the channels, find programs, populate the guide with all shows found, and I can schedule them for recording. However, from day one I have not been able to record any shows. Needless to say, I can watch the live feed if I choose to from any computer using the HDHomeRun software.
The problem is, when it is time to record the shows, Plex acts as if it is recording the shows, through the web interface, I can see the HDHomeRun tuner is tuned to the correct channel at the correct time, Plex says it is recording the show in the web interface, I can see the network traffic coming into the server streaming about 8mbps depending on the channel or show, I can see with my network analyzer that the plextranscoder.exe is actively processing the incoming stream, but at the end, there is no trace of the video file recorded in the server, can’t find it anywhere, not even the folder it is supposed to create to store the episodes. Although sometimes, it will create the folder with the name of the show, but the folder remains empty. For most shows it doesn’t create the folder at all.
Here are my transcoder settings. Any assistance will be appreciated:
I’m not sure folder permissions are the problem. If it was a permissions problem, I would think it could never create a folder or video file. However, when I first installed the HDHomeRun, a few weeks ago, one episode of a show that airs every day was successfully recorded placed in the correct location in the hard drive, and it was a .ts file. However, that only happened once and has never happened again since then. And even as the file existed in the drive, Plex never added it to the library even after multiple scans. I ended up deleting the file. I’ve been trying to record that same show with no success.
This Plex server has been running for years and I previously had an HDHomeRun Prime when I had cable subscription and I never had an issue with the DVR since it came out. It would always put the recordings in the TV Shows library and was always automatically found and added to the library. The only thing is I have recently removed the HDHomeRun Prime and added the HDHomeRun EXTEND. That seems to be the only difference.
Recordings are saved to an external 1TB USB drive that is permanently attached to the server. The drive is formatted with the exFAT file system. So, with the exFAT file system, there are no permissions to configure or an owner for files or folders. Those are NTFS options. I always try to record directly to the destination library, and I let Plex do all the work automatically. I don’t move the shows after being recorded. So TV Shows go directly to the TV Shows library and stay there, which is in the folder “H:\TV Shows” and that’s where Plex is pointed to scan that library.
I was also checking the Plex log files but I couldn’t find anything interesting that would point me somewhere. But at the same time, there are tons of log files. Any specific log file I should look for?
Just a quick update: I removed the DVR from Plex and re-added it. I then manually started recording a show already in progress. This show made it just fine until the end, and it was saved in the right location and properly scanned and added to the Plex library, so that is available for playback. I am now waiting to see if the scheduled shows I had will record and save.
Ok… I think I found the problem: Plex is deleting episodes immediately after recording is finished. I found this in the PMS log.
Aug 26, 2017 13:00:08.110 [5624] DEBUG - Garbage Collector: Deleting expired unwatched content for Dr. Chris: Pet Vet (policy: 5)
Why on Earth is Plex thinking the episode is expired when it was just finished recorded and it is the only episode existing in the library for that show? Is this a software bug? And what is “policy: 5”?
Here are all the DVR settings for that particular show:
Just a thought but policy 5 maybe keep 5 episodes and somehow it think you have that many already?
Maybe try to change that to all recordings instead of 5? and see…
Some of the other shows I have scheduled already have the setting to keep all episodes, but I have to test and see if that makes any difference. Either way, this seems like an old bug. I searched this forum and people have reported this problem since version 1.4 back in March. When I had the HDHomeRun Prime, this bug did not affect the operation of the DVR because I had some shows keep the last 7 days and it would always work correctly.
The keep 5 episodes would be what the Policy 5 is. Plex is doing exactly what you asked for. This is why I don’t set an keep or delete policies. I’ll decide what shows/episodes to keep not rely on Plex to determine which to keep. FYI, when your change it in the DVR settings you will more than likely also have to go the the library, edit the show and change it there as well. Garbage Collection from what I understand uses the settings for the show in the library. Which is why you see it running immediately after the show is added to the library after the recording ends.
Update: I tested that idea and changed it to “All Recordings” but still the recording did not appear in the library. So after digging in the logs I found there was a second problem:
"Aug 26, 2017 18:00:04.335 [10684] ERROR - Failed to delete session directory (boost::filesystem::remove: The process cannot access the file because it is being used by another process: “G:\Plex\Plex Media Server\Cache\Transcode\Sessions\plex-transcode-804b1f90-ede7-4e5c-a59c-255af28c7bcc\media-01760.ts”)"
Aug 26, 2017 18:00:04.711 [10728] ERROR - Couldn’t rename file H:\TV Shows.grab\d76d4eaf6c700d0b4752184d23918415d41a0e88\PIX11 News at 5 (2016) - 2017-08-26 00 00 00 - Episode 08-26.ts to H:\TV Shows\PIX11 News at 5 (2016)\Season 2017\PIX11 News at 5 (2016) - 2017-08-26 00 00 00 - Episode 08-26.ts: The process cannot access the file because it is being used by another process
I thought the most likely culprit is my automatic backup program trying to backup the recorded file and therefore locks the file until it finishes backing it up, which is why Plex can’t move it out of the .grab folder and into the library or delete the cached session data. Going through my backup logs, I saw that the backup application was actively backing up the files at the same time Plex wanted to move/delete them.
Potential solution: Exclude those folders from my backup so they don’t get locked.
I will test once again to see if this solution works. I don’t have a need for cached/temporary files in my backup. I just find it odd that this was never a problem when I had been recording shows with the HDHomeRun Prime for so long. But I guess there must have been a change made by Plex around the same time I changed HDHomeRun boxes because previously the recorded files were MP4 and now they are .TS files. I thought that recording from a different source (OTA antenna instead of Cable TV) was the reason for the change, but reading somewhere else, I learned that it was Plex that changed the recording format.
I will update once I confirm, but I am 99% sure this will be the solution.
Updating my previous post, I can confirm the problem is resolved, at least for me. Here are the two issues I encountered and hopefully this will help others:
1- After excluding those crucial temp folders from my automatic backup application, Plex is now able to move the recordings from cache to the library.
2- After changing the setting to keep “All episodes” instead of “5 episodes” the recorded video is no longer getting deleted. I consider this one to be a bug in Plex and and the workaround is to set it to keep all episodes, otherwise, it deletes all episodes rather than doing what it is supposed to do.