Results 1 to 7 of 7

Thread: NextPVR Recordings and MCEBuddy (Script)

  1. #1
    Join Date
    Oct 2016
    Location
    United States
    Posts
    2

    NextPVR Recordings and MCEBuddy (Script)

    Notice: If you use MCEBuddy to convert your shows and watch the converted shows through Plex this post will not be worth the read. If you wish to watch converted shows that MCEBuddy converted in the recordings directory of NextPVR or a front end like Kodi as if they was just recorded from live TV without commercials you may be interested in my post.

    I have been using WMC for the past 5 years and finally I had some major issues with my TV guide, so it forced me to do some searching on another solution. I always thought my channels were DRM protected, but I was able to discover that was only movie channels like HBO and Stars. After getting everything setup with my HDHomerun Prime I wanted to have the ability to remove commercials from my shows and convert them to a different format for storage savings. To do this I found MCEBuddy did a good job of accomplishing this task, but if I wanted to use MCEBuddy I would have to use Plex or KodiPlexConnect with Kodi to see my converted shows and categorize them. I wanted to keep my recorded shows listed under recordings, so I decided to do some testing on converting the files and getting them to still operate under NextPVR. I use the Kodi front end, so that with NextPVR and the shows look nice under the recording directly with certain skins. I was able to figure out a solution to make this happen using MCEBuddy and a custom script (PowerShell) that I wrote.

    How This Works
    Using NextPVR with or without Kodi it will record your shows and put them into the recorded shows directory. NextPVR will record the show as a .ts format. You can use MCEBuddy to convert the show to MP4 High Quality and replace the original recorded show with the converted. As long as you keep the name the same NextPVR will play the converted show as normal with the commercials now removed. The script I wrote monitors the conversion directory and once the show is finished being converted by MCEBuddy this script will move the show into the original recording directory. You can run it on startup with a scheduled task and it will loop and monitor the directory for changes. I put more setup instructions in the script and what needs setup inside MCEBuddy. I recommend putting MCEBuddy and this script on the same machine and have plenty of CPU power for processing.

    Extra Features
    I built in under the variables the option to enable monitoring within the console and setup the ability to send email alerts if a show isn't moved. If you don't enter anything into the email area the script will run either way.


    The script is attached to this post. It is a PowerShell script and nothing else is included in the zip. The instructions are in the PowerShell script to set it up to run on startup. I don't post scripts that much, but I do have some other scripts I have posted on SpiceWorks for PowerShell if you wanted to look my username up to trust the zip file.
    Attached Files Attached Files
    Last edited by KV-Tools; 2016-10-07 at 08:06 PM. Reason: Updated Script. Please use the latest v1.1 if you downloaded v1.0.

  2. #2
    Join Date
    Jul 2016
    Location
    USA
    Posts
    101
    Thanks for the script. I have a question. My directory structure is like: MCEBuddy.UserCLI.exe
    D:\npvr_recordings
    D:\npvr_recordings\sports
    D:\npvr_recordings\modern sitcoms
    D:\npvr_recordings\classic tv

    etc.

    If I point the script to D:\npvr_recordings will it return the files back to the folders it got them from?

    Currently I use MCEBuddy like this: In my npvr scripts directory I have the PostProcessing.bat script us setup to call this command:

    call "C:\Program Files\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=addfile --action=%1

    I have a TS to MP4 profile setup and no monitoring directories.

    It add's the file just recorded, converts them and puts it back in the folder it got it from. I have it setup to move the original*.ts files to d:\MCEBuddyarchive until I can check the quality and delete.

    Since NPVR will see the episode rename, I don't do anything else.
    ~Paul

    Setup: NextPVR, Serviio, WinTV-quadHD and WinTV-HVR-955Q. Custom Roku channel developer. Feeding Tube Advocate. About me or http://chambers.pw.

    If you haven't broken it at least once, you're not doing it right.

  3. #3
    Join Date
    Oct 2016
    Location
    United States
    Posts
    2
    Yeah, if you point it to the root directory "D:\npvr_recordings" it will move the recording right back into the folder it was pulled from as long as the sub-folder has a similar name as the recorded file. For example, "D:\npvr_recordings\The Spy". The recording name is something like "The.Spy.S11E10.ts". This script would monitor the directory for a new file and would convert and move the file into the original directory. I wasn't aware that MCEBuddy allowed post batch scripts to run after the show was converted. Guess I should have looked a little deeper. Sounds like your accomplishing the same task.

  4. #4
    Join Date
    Jul 2016
    Location
    USA
    Posts
    101
    Quote Originally Posted by KV-Tools View Post
    I wasn't aware that MCEBuddy allowed post batch scripts to run after the show was converted. Guess I should have looked a little deeper. Sounds like your accomplishing the same task.
    I had to dig around to find it. A user of MCEBuddy has to have the donation (Premium Access) version to get the MCEBuddy.UserCLI.exe program. The free version doesn't include it.

    Thanks for getting back to me.
    ~Paul

    Setup: NextPVR, Serviio, WinTV-quadHD and WinTV-HVR-955Q. Custom Roku channel developer. Feeding Tube Advocate. About me or http://chambers.pw.

    If you haven't broken it at least once, you're not doing it right.

  5. #5
    Join Date
    Jul 2011
    Location
    VA US
    Posts
    185
    I do something similar but with the file renaming option which allows you to select destination folders too. In my normal convert profile I have the following setup for "custom file renaming.

    %ismovie%<\Movies\%showname% (%airyear%),%issport%<\Sports\%showname%.%episoden ame%.%recordyear%-%recordmonth%-%recordday%,\Recorded_TV\%showname%\%showname%.S%s eason%##E%episode%##.%episodename%>>

    It looks a bit confusing but here's the breakdown with my directory structure which looks like this:
    D:\Movies\
    D:\Sports\
    D:\Recorded_TV\


    %ismovie%<\Movies\%showname% (%airyear%),

    If the recording is a movie it converts and puts the file in a folder named "movies"

    %issport%<\Sports\%showname%.%episodename%.%record year%-%recordmonth%-%recordday%

    If the recording is a sporting event it converts and sends the file to the "sports" folder

    ,\Recorded_TV\%showname%\%showname%.S%season%##E%e pisode%##.%episodename%>>

    If the recording is a TV show then it converts it and puts it in the folder for the show and names it showname.SXX.EXX.episodename which is the same format as Npvr saves the file as so it dumps it right back into the folder it came from. If you want to get fancy you could also do a script to delete the .ts but like Paul I like to check the quality before I delete the .ts.
    NPVR 3.7.7/Win7ProX64/Intel Core i7-4790 Haswell Quad-Core 3.6GHz /HDHRPrime X2/Schedules Direct

  6. #6
    Join Date
    Jul 2016
    Location
    USA
    Posts
    101
    I ditched the scripts all together this week, since I posted, and setup directories to be auto monitored by MCEBuddy.

    I will caution that if someone sets up MCEBuddy to monitor their recording directories, they need to set it up to wait 3 hours or so before it pulls something out of a directory for converting. If not it will try to take it as soon as the recording starts and the TS gets put in the folder and then fail.

    I have all my directories setup in NPVR per show so when I record, except for Quick Record, which goes into a generic "DVR" folder, MCEBuddy takes them from their directory, converts it then ships it back.

    I too have MCEBuddy make sure everything is named in the tradition of NPVR like Snagglewest: Show.SxxExx.EpisodeName

    My backup TS's are then put in a universal holding folder outside my Serviio libraries, (so Serviio doesn't try to put it in the library) and I check the quality, then delete when space is needed.

    In my MCEBuddy setup only the tvdir and Movies directories are setup to convert. DVR is used for "can't watch the rest of this show", etc and news is time dated. I manually add files from my sports directory. 4 hour games are large and time/resource consuming so I only keep what I want.

    I have, for example, my directories setup as below. (I have more than listed.) NPVR creates the Series/show/movie Folder name under the category directory we assign to each recording.

    d:\tvdir
    d:\tvdir\Classic TV
    d:\tvdir\Classic TV\HoneyMooners
    d:\tvdir\Classic TV\Series folder
    d:\tvdir\Classic TV\Series folder

    d:\tvdir\Modern Sitcoms
    d:\tvdir\Modern Sitcoms\The Big Bang Theory
    d:\tvdir\Modern Sitcoms\Series folder

    d:\tvdirClassic Sitcoms
    d:\tvdirClassic SitcomsM*A*S*H
    d:\tvdirClassic SitcomsSeries folder

    d:\tvdir\Crime
    d:\tvdir\Crime\Law & Order
    d:\tvdir\Crime\CSI
    d:\tvdir\Drama
    d:\tvdir\Drama\This Is Us

    e:\Movies
    e:\Movies\Comedy
    e:\Movies\Comedy\Meatballs (year)
    e:\Movies\Drama
    e:\Movies\Drama\The Witness (year)
    E:\Movies\Romance
    E:\Movies\Romance\My Best Friend's Wedding (year)

    c:\DVR

    e:\News
    e:\News\Local12
    e:\News\News Series folder
    e:\News\60 Minutes

    (external 5tb drive)
    g:\Sports\
    g:\Sports\Football
    g:\Sports\Football\Bengals

    g:\Sports\Grandson\
    g:\Sports\Grandson\Grandson's football IP Stream
    g:\Sports\Grandson\--Grandson's baseball IP Stream

    g:\Sports\Baseball
    g:\Sports\Baseball\Reds
    ~Paul

    Setup: NextPVR, Serviio, WinTV-quadHD and WinTV-HVR-955Q. Custom Roku channel developer. Feeding Tube Advocate. About me or http://chambers.pw.

    If you haven't broken it at least once, you're not doing it right.

  7. #7
    Join Date
    Jul 2011
    Location
    VA US
    Posts
    185
    Quote Originally Posted by p37307 View Post
    I will caution that if someone sets up MCEBuddy to monitor their recording directories, they need to set it up to wait 3 hours or so before it pulls something out of a directory for converting. If not it will try to take it as soon as the recording starts and the TS gets put in the folder and then fail.
    If that's the case something is amiss. MCEBuddy shouldn't start to convert the file until the recording is completed and the file is closed. In the "monitor locations" settings you can set a minimum age under expert settings if you wish though. The default is 1 minute.
    NPVR 3.7.7/Win7ProX64/Intel Core i7-4790 Haswell Quad-Core 3.6GHz /HDHRPrime X2/Schedules Direct

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •