Plex DVR - MCEBuddy script not converting recordings

Hi All

I have recently moved to using mapped network drives instead of locally attached storage. For playback, recording etc. it all works just as it did with direct attached storage but I’m having difficulty with the post-processing script for DVR.

I used the famous MCEBuddy script from Reddit and modified it to include the UNC path rather than the mapped drive letter. I am now getting log files created for conversions with an error at the bottom:

ERROR> 2017-10-02T23:10:11 MCEBuddy.Engine.ConversionJob → Pre remuxing Source file has been renamed or deleted by custom command →

Followed by the path to the .ts file (in the .grab folder). The .ts file is copied to the library folder without conversion or commercial skipping.

Does anyone know why this might be happening? My script is as follows:

@echo off
set tmpv=%1
set tmpv=%tmpv:~4%
set tmpunc="\192.168.0.5\video%tmpv%
echo %tmpunc%

C:\Progra~1\MCEBuddy2x\MCEBuddy.UserCLI.exe --command=engine --action=start
timeout /t 2 /nobreak > NUL
C:\Progra~1\MCEBuddy2x\MCEBuddy.UserCLI.exe --command=addfile --action=%tmpunc%
timeout /t 10 /nobreak > NUL
:loop
for /f “delims=” %%o in (‘C:\Progra~1\MCEBuddy2x\MCEBuddy.UserCLI.exe --command=jobstatus --action=%1 --quiet’) do set status=%%o
if %status% == “not present” (
Exit
) else (
timeout /t 2 /nobreak > NUL
goto loop
)

From what I can tell you are taking the filename parameter passed into the script and storing in tmpv:
set tmpv=%1

removing the drive “C:”
set tmpv=%tmpv:~4%

building a new location on your network storage
set tmpunc="\192.168.0.5\video%tmpv%

and trying to add the ts file for processing by mcebuddy
C:\Progra~1\MCEBuddy2x\MCEBuddy.UserCLI.exe --command=addfile --action=%tmpunc%

So if the file was recorded to local storage “C:\xxxxxxxxxxxxxxxxxxx” at what point was the file moved to the external storage: “\192.168.0.5\video%tmpv%”

If the file is recorded on local storage mcebuddy is telling you that the file is not where you said it was since it is not currently on the network storage.

My suggestion would be to go back to the original script and let mcebuddy process on local storage. Then when the script is done above the Exit under the if statement add a line that executes a new script that will move the file from your local storage. I would have 2 lines perhaps in the new script:

pause 5
robocopy /MOVE /S “C:\Recorded TV” \192.168.0.5\video

Thanks for your reply.

The script removes the drive letter because Plex sees the library as a mapped drive while the script cannot see the drive mapping. Data-wise “E:\video” and “\192.168.0.5\video” are one and the same but the script can’t see E:\ where Plex can.

I was using MCEBuddy 2.4.6 and have now upgraded to 2.4.8, hoping to fix this issue.

Is this the best way to go about it? Is anyone else using postprocessing scripts on network storage? Is there a way to have Plex perform all of the recording locally and copy it to the network share once it’s done?

I think your UNC path is wrong. I believe it needs to start with double slash. Ie \192.168.0.5\video.

Yes, as with your example, the forum has removed the first slash. There are two slashes in my script.

Couple of other points.

@mavrrick is correct there should be two slashes before the server: \\server\share. Edit: Forum definitely won’t allow the two slashes. Will display two if you add a third.

I seem to recall some other issues with recordings on the forum when using external storage. Drives don’t spin up fast enough and Plex aborts recordings. So if you start to have issues with failed recordings your external storage could be the issue.

I personally would always want to record to local storage and then move the files to their final destination after recording/post processing. I actually have a similar process setup that moves recordings from one storage location to another using the robocopy command I included in my original post. Although I am not moving to external storage I use it to move files from recording location to my Dropbox account folder that is linked to the same library. Allows me to have recordings of shows we watch frequently accessible using Plex Cloud when away from home.

@johnm_ColaSC Thanks for this.

You say you use local storage. How is that set up? Do you use postprocessing scripts? I’m keen to retain the Gracenote data from Plex, do your recordings keep this data?

So to update, I have managed to get Comskip/MCEBuddy to work when called by Plex Post-Processing script.

What I end up with now is a .ts file in the destination folder and a .mp4 in the .grab folder.

It looks like Plex is moving the .ts file before the script has completed since nothing else produces .ts files.

I have entries in the Plex logs where the script is called and then exits later in the log. After that there is a line:

DVR:Grabber: Moving E:\PVRtemp.grab\1155cba239131e9d2ef9a310822dfc40d74512b1\Inspector Morse (1989) - S01E01 - The Dead of Jericho.ts to E:\PVRtemp\Inspector Morse (1989)\Season 01\Inspector Morse (1989) - S01E01 - The Dead of Jericho.ts

Why is Plex still looking at the .ts file? The log entry is before the MCEBuddy log states that the conversion has completed.

EDIT: Further to this, It looks like the script has not been successful since I installed an update on 12/6/2017

What does your script look like? It sounds like your script might be ending before mcebuddy is done processing the file which allows Plex to continue with it’s processing of moving the file out of the .grab folder. Might also need to see what your mcebuddy conversion task looks like.

Nevermind was looking at another thread dealing with mcebuddy. Your script is at the top.

Change this:
for /f “delims=” %%o in (‘C:\Progra~1\MCEBuddy2x\MCEBuddy.UserCLI.exe --command=jobstatus --action=%1 --quiet’) do set status=%%o

to this:
for /f “delims=” %%o in (‘C:\Progra~1\MCEBuddy2x\MCEBuddy.UserCLI.exe --command=jobstatus --action=%tmpunc% --quiet’) do set status=%%o

Of course! Because the job %1 isn’t running so of course Plex thinks it’s complete.

Trying this now, thanks!

The script thinks it’s complete so go to exit leaving mcebuddy running still processing the file, when script ends Plex continues it’s processing and moves the file.

Many thanks my friend, this works perfectly. Your “Plex Ninja” notation is well earned!