Post Processing script for news using MCEB on Windows.

This is a Windows based script that uses Windows programs and Microsoft networking. If you are not on Windows, this is likely not for you.

Main functions of script:

  • Correct filename of recording, name format and date/time are standardized
  • Communicate with one or more MCEB engines for job and engine status management
  • Allocate new encoding jobs to best suited encoder (based on job size vs encoder speed, engine availability and queue length)
  • Easy removal or addition of MCEB engines
  • Distribute MCEB processing over many computers on the same Windows network

Written in VB Script, it uses VBScript.RegExp for show info extraction from the existing filename. The method of assigning a job is simple. For each MCEB engine (separate computers), a folder needs to be created and shared over the network from the DVR computer. Each remote PC has MCEB configured to monitor its own folder via Windows network. The final Plex library folder is also shared for all the MCEB engines to dump completed shows to.

V1 is now up and running in beta. The plan is to make sure it rolls out solid and then several more features will be added to improve its handling of recordings including non-news content.

I was thinking about adding a web interface (ASP) to configure, oversee or give the ability to modify job assignments to the engines. The downside is this will require a more difficult setup because this involves IIS. Just the same if I decided to use MySQL for a storage engine. I’m trying to keep it simple. We will see what is to come. For now, lets run some recordings!!!

Feel free to comment. This is the development stage and I would love to hear other people’s ideas.

It blasted through today’s multi-airing episode of News 12 Long Island (2014). All processes complete and each have an accurate time of airing as part of the filename. I suppose that means it’s time to load up the DVR with a long list of mixed news shows and see what it does… or doesn’t…

Current script stats:

  • ~350 lines of code
  • full logging enabled
  • 1 DVR x3 source
  • 2 MCEB engines, 1 is local
  • Initiating the VBscript via .bat file called by Plex. Apparently there are script limitations.
  • Rather frequently, an MCEB engine will not report status correctly via CLI, local and remote. I dunno yet… I’m thinking CPU load vs query/command timeout.
  • Still currently hardcoded for news. Single library output for all DVR recordings. Likely WILL operate using a text file with all news show names to filter news from tv and movies.

The outcome of News 12 Long Island (2014). All episodes made it to plex correctly. As expected, since they all have the same episode numbers with no thetvdb info and no attached metadata, they are seemingly the same episode with no distinguishment between each other than the thumbnail image or playing them.

I am looking into cooperating with theTVDB to add the news shows from my area to have a minimum of basic artwork, episode numbers and a general show description. This way Plex should be able to pick up the correct show info in the end from a place I can or somewhat control for quality. It’s more work upfront but once done everyone can benefit from it. B) I’ll know more in a few days.

If you want comments you’ll need to post the script so people can try it.

@cayars In order to post the script it needs to be written to a point, or else it’s just functions and no flow. Very soon. Thank you for your interest. :slight_smile:

Do you have any suggestions for the best folder structure and filename format for news? Some shows are conventional and have only 1 airing, but local news can have 10 to 20 airings in a day and plex turns green when chewing on it. I have been trying different nomenclatures but resulting in only 2 polar opposite outcomes, both no good.

I first started creating folders for the separate news items I am recording but have switched to just dumping news files into the root directory for the news library. I only record the 6:00 local news and CBS Evening news at 6:30 so don’t have a lot of news items that are in the folder, plus they are deleted after watching so nothing is hanging around in the folder.

Since I am storing 2-4 weeks worth I need a better way. At the moment I am exploring any option.

Just about to post the first version. Last minute decisions…

  • Using windows logs for script logging.
  • Not to delete source folder if not empty or destination file failed duplication (Mostly for manually instances)
  • Converted some functions to regex based.

Everything should be ready for the weekend!

The following pastebins have been removed. See the next post.

pastebin.com/aJ2P4Z0z
Version 1 in pastebin, good for 30 days.
Just save it as PlexPPS.vbs

To launch it you will need a batch file:
pastebin.com/tFKAk6NS
Save that to a plex.bat and edit to your needs.

This is the same vb script but without comments.
pastebin.com/RJcRSR0P

Files can be manually processed by dropping the video icon onto the script icon.

Here is a pastebin that I will update several time a week with the current script.
pastebin.com/UUJKy1j7
Last updated: 6/14/17

Windows Logging (Event Viewer) with filter.

The script was changed to handle any file type. Also, I think I am going to make the script accept folders for manual processing. Recursive folders minus any .grab folder. Makes handling backlog easy and I have an entire day of news to run.

The script has been updated.

  • Complete fix for handling any file type.
  • Can do manual batch mode (drag & drop), single file or recursive folders as well as PPS
  • Changed logging routine
  • Restructure of code to support the new features.

Lots of changes. Restructures and features. Moved settings into separate config files. Moved settings from variables to dictionaries. Soon to be completed, an install subroutine to create/edit the config files on first run or to update existing configurations without editing the config files directly.

Setup wizard is done. Creates base config files and full walk-through to build the main app config. Updated encoder favoring based from cpu speed. A few other general improvements. See pasebin link above.

I managed to squash a few pesky bugs that came about from all the changes made. Full testing isn’t complete but it’s running news at the moment seemingly without error. TV Shows and Movies have not been tested yet. Moved the encoder list to a dictionary opposed to variable, sorted out some of the logging and created a few more variables to use for any custom changes. To run the setup wizard, call the script without including a media file or if the settings file is not present.

There is a lot more to do. Maybe if I hurry it will be ready for when the DVR comes out of beta!