Auto optimization starts too soon

I just noticed an issue with auto optimization. I am recording TV shows using NextPVR directly to a folder monitored by Plex, and I have auto-optimization set for some shows so that Plex creates an optimized version when it sees a new episode. The problem is that Plex seems to be spotting the new episode too soon, and starting optimization.

So, NextPVR starts to record a show and creates a new .ts file in the folder, and about 2 minutes later, Plex sees the new .ts file and starts the optimizer; because the optimizer runs much faster than the recording, it gets done a few minutes later and creates a video file that is only a few minutes long.

Is there any way to tell Plex not to start the auto-optimization until the file is done writing, or, possibly, tell it to wait some period of time before starting?

That’s the problem. You should not record directly into this folder. Record into another folder then move the file once it’s done.

No. Plex only checks if the file is open (i.e. still being written to), but once the file is closed, it thinks the file is ready. NextPVR (like most programs) closes the file at certain intervals to prevent total data loss should an error occur.

That’s what I suspected. Unfortunately, moving the file from a different folder at the end of the recording requires a manual step since I haven’t worked out any setting in NextPVR to move the file once the recording is done.

Actually it doesn’t always happen, I guess NextPVR only sometimes closes the file partway through the recording. My current work-around is to just delete the optimization when I see that it is the wrong length, and tell Plex to do it again (a nice option in Optimized versions when it sees that the version was deleted).

If anyone knows a way to auto-move a file either in NextPVR, or using a folder watcher, that you be a good option

There is the ability in NextPVR to run a script after the recording has finished. I need to do this anyway to move files to Plex folders when they are done, to stop Plex from accidentally optimizing video files before recording is finished (see my other thread). In NextPVR, this is a shell (or bat) script which runs when NextPVR is done called PostProcessing.sh (or .bat). What I can do in this shell script is check if there is already a video of the same show with the same date in the target folder, and if there is name this file something different. I’m not really getting show meta-data that way, but I wasn’t anyway, and this allows me to just automate everything, and still allows Plex to try to find show information if it can…when the show is not a repeat, it’s a first-run on that date, Plex can actually work out season and episode, and it shows that info, which is good, and worth preserving.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.