This project has moved. For the latest updates, please go here.

Conversion Load Distribution

Apr 23, 2014 at 2:04 AM
Edited Apr 23, 2014 at 2:10 AM
Hi All
I'm going to apologize up front because setting up home theater PC's, video conversions and codecs are super new to me. What I'm about to ask are probably really noob questions.

We've recorded plenty with Media Center and I was alarmed to learn we had something like nearly 2.5TB of video. After some quick investigation, I found that a single hour-long show could be anything from 3-8GB; movies easily 13GB+. I was floored.

I searched for some help, read awesome things about MCEBuddy and am giving it a shot. I too am battling the subtitles / caption issue and am trying to find that sweet spot, but I'll get to it later. For now, all I want to do is convert these into some other container format that will support captions (e.g.: MKV, even though I don't believe Media Center supports it.) without losing quality (e.g.: going from 1080 to 720).

I have a few machines at the house:
  • home theater PC (ML150G6, Windows 8, E5504, GT 610)
  • desktop 1 (XPS 720, Windows 7, Q6700 & dual GTX 560Ti 448)
  • desktop 2 (Optiplex 960, Q9400, generic card but might pull one of the GTX 560's)
  • laptop (Windows 7, Athlon X2 QL-65, ATI Radeon 3100)
These machines aren't used at all between like 10PM-8AM and it would be awesome to have them converting overnight. I only have about 450 files to get through, but I was hoping to get through them sooner rather than later! (It seems to take a very long time to convert just one hour-long show. Is this normal?)

With all this equipment, is there some way to:
(A) distribute the load? For instance, could the HTPC be the 'server' that the other clients connect to retrieve conversion jobs? ("Why didn't I just install it on all three machines?" you might be asking. My fear is that if I install it on all three machines and point it to the share where all the recorded media is, each machine will convert the same video multiple times because they're not 'talking' to each other; machine A isn't aware of what machines B & C are doing and so on. )

(B) I don't have super fantastic video cards, but I was wondering: is there any advantage in leveraging, or is it even possible to leverage, video cards for converting from WTV to MKV? I mean, will it significantly reduce the length of time it takes to convert without sacrificing quality? (At the moment, I'm not doing any commercial skipping, but when I get there, does this have any affect?)

I don't know what you want to see, so I uploaded a handful of files (logs, config etc) to my SkyDrive here: http://1drv.ms/1f1FAS8
Hopefully this is helpful.


Thanks for your time & expertise!



Note:
Re Subtitles / Captions : I've read some threads on this, but its just about dedicating time to test the configuration. Because it seems to take ages to convert, its too time consuming to try it 3-4 times in a day.
https://mcebuddy2x.codeplex.com/discussions/536085
https://mcebuddy2x.codeplex.com/discussions/540742

Re GPU Acceleration : I read this thread, but couldn't find the 'hardware acceleration' check box.
https://mcebuddy2x.codeplex.com/discussions/530808
Coordinator
Apr 23, 2014 at 3:09 AM
Edited Apr 25, 2014 at 12:09 AM
Nice work tracking down the threads.

See this thread on distributed engines:
https://mcebuddy2x.codeplex.com/discussions/446529

So solve your issues for distributing the load by setting up MCEBuddy on different machines and pointing them all to a single network directory -> split the files into different directories and point each engine to a different directory (split them roughly equally)
OR
If you point all the same directory make sure you put filters in the conversion tasks for each machine (e.g. 1st machine processing all files starting with a-f, 2nd from g-l etc or filters based on showname/networks/channels etc). The idea to is to avoid 2 machines processing the same file through the use of filters.
You can use schedulers and priority to control the CPU utilization.

Regarding the hardware encoding, that option is only available with the Early Access versions (2.3.15 and later). I use a Intel graphics card with quicksync drivers and I get super fast conversions (10x faster than my Dual Core CPU) and very decent quality (again, I can use high quality and increase the quality slider for more quality and still get significantly fast).

You can control quality by using the Max Resolution and Quality Slider. If you source video WTV files have H.264 video, I would suggest use the MKV Unprocessed profile (which will reduce the file size by 30% or so based on how many commercials you have). If you don't have commercials or dont' want to remove commercials, turn off commercial removal and it'll be 30% faster or so.
If your source has mpeg2 video and if you want to reduce the Size and still maintain quality, then use the MKV Normal or MKV High Qualilty (very slow without hardware encoding) profiles. These will significant reduce the file size, make sure you set the max resolution slider all the way to the right and adjust the quality slide based on a trial or so. Note increasing the quality will increase conversion time, usually default is good.
Looks like your videos have mpeg2 video
2014-04-22T00:11:54 MCEBuddy.AppWrapper.FFmpegMediaInfo --> Video codec = mpeg2video
So you will significantly benefit from the MKV or MP4 profiles. Both are very good, difference being MKV uses AC3 audio and MP4 uses AAC audio. Make sure you enable Multi Channel audio in the conversion tasks if you source has multi channel audio.

Subtitles you're on teh right track. there are more improvements in 2.3.15 which make syncing much better. Try it out, but yes you'll still have to do some fine tuning.
Marked as answer by rboy1 on 4/22/2014 at 8:10 PM
Apr 24, 2014 at 11:43 PM
Edited Apr 24, 2014 at 11:54 PM
Thanks for the reply!

Just a few things I think I'm being dense about
  1. I read about the significant reduction in encoding times and I'm blown away. I'm already using the MK4 High Quality profile and its something like 4 hours now, so anything's better than that. Do you know if there's a benefit to having an SLI (or CrossFire) configuration? If not, I'll drop the other 560Ti into the Optiplex 960 to speed things up.
  2. "...make sure you set the max resolution slider all the way to the right and adjust the quality slide based on a trail or so." I don't believe I totally understand that last part "based on a trail or so." Is that typo for trial? :) I already set the max width to the max (7680) but left the quality at the default. I'm OK setting it to 100% but if its not necessary beyond a certain point or the quality difference is negligible I won't bother. (But I DO like high quality 'HD' video!)
  3. I sent some funds your way. I appreciate your responsiveness - I've seen your name all over the place in the forums. And not only that, this is an incredibly useful utility. So many thanks for everything.
Coordinator
Apr 25, 2014 at 12:10 AM
Right it's Trial. I updated the comment. Keep it at default MCEBuddy compensates automatically for changing input and output resolutions and cropping etc. so usually the quality will remain constant as you change your options. Inrease the slider only if you're not happy with the default quality, note that increasing this will increase conversion time (like wise with max resolution, higher mean more conversion time)
Apr 25, 2014 at 11:25 AM
I'm using 2.3.15 now and I'm confused about what I'm seeing.
MachineA (E5504 10GB GT610) - took 4h10m
MachineB (Q6700 Dual GTX 560Ti) - took 6h12m

The configs are nearly identical except for the Quality I believe. The Quality setting on MachineA was set to 100% while on MachineB it was set to the default.

I'm not seeing much of a difference but maybe I expectations are too high? Or I've done something with the config that results in equally lengthy conversion times?
Coordinator
Apr 25, 2014 at 1:09 PM
Will need to compare the conversion logs to see the differences. Have you changed the priority on the system?

Apr 26, 2014 at 2:26 PM
Edited Apr 26, 2014 at 2:27 PM
Thanks for the reply.
I've copied the logs up here http://1drv.ms/1fydhW1 into separate folders: one for machinea and one for machineb.
The priority on both systems was the default.
I copied the same video into each monitor folder for each system. This way they would convert the same video giving me some timing results. (I actually expected the GTX560 system to finish sooner or around the same time thinking the video cards would help but it took 50% longer)
Since they both have nearly identical MCEBuddy configurations, except for quality, I'll try to do a side by side comparison of the logs. But to be honest, I don't know what I'm looking for. :)
Coordinator
Apr 26, 2014 at 2:32 PM
Easiest way to start is look at the performance metrics published at the end of each conversion to see where it's taking more time (remuxing, conversion, commercial detection etc). Then one looks to see why there is a difference (e.g. the priority on the machine, the number of CPU's made available to MCEBuddy etc)


Coordinator
Apr 26, 2014 at 2:56 PM
Okay so here this should help explain the differences. Right off the bat, see the difference between Machine A and Machine B (performance metrics)

Machine A
--> <Start At> <Duration (hh:mm:ss)> <Activity>
--> <04/24/2014 22:00:10> <00:01:57> <Remuxing recording>
--> <04/24/2014 22:02:10> <00:00:37> <Extracting closed captions>
--> <04/24/2014 22:02:47> <00:00:06> <Analyzing video information>
--> <04/24/2014 22:03:01> <04:06:28> <Converting>
--> <04/25/2014 02:10:19> <00:00:17> <Moving converted file to destination>
Machine B
--> <Start At> <Duration (hh:mm:ss)> <Activity>
--> <04/24/2014 22:01:33> <00:04:45> <Remuxing recording>
--> <04/24/2014 22:06:20> <00:01:37> <Extracting closed captions>
--> <04/24/2014 22:07:58> <00:00:21> <Analyzing video information>
--> <04/24/2014 22:08:26> <06:02:54> <Converting>
--> <04/25/2014 04:11:51> <00:01:44> <Moving converted file to destination>
Issues to understand:
  • As you can see Machine B is taking more time to Remux and more time to Move the converted file and more time to extract closed captions (indicating slower disk performance).
  • Also machine B is taking 50% more conversion time.
To analyze this go upto the conversion tasks:
Machine A
2014-04-24T22:03:08 MCEBuddy.AppWrapper.Handbrake --> Process arguments -i "C:\Program Files\MCEBuddy2x\working0\Seinfeld_WDCWDT_2013_02_12_17_58_00.ts" --denoise="weak" --loose-anamorphic --verbose=2 -T -f mp4 -4 --start-at duration:3 -e x264 -b 9600 -x me=hex:trellis=2:subq=8:partitions=all:8x8dct:ref=5:rc-lookahead=50:keyint=25:keyint-min=20:bframes=3:weight-b:level-idc=40:b-pyramid=normal:direct-pred=auto:mixed-refs:deblock=-1,-1:nofast-pskip:nodct-decimate:b-adapt=2:threads=auto --deinterlace --decomb -E ffac3 -R auto -B 384 -D 2.5 -6 stereo -o "C:\Program Files\MCEBuddy2x\working0\Seinfeld_WDCWDT_2013_02_12_17_58_00-converted.mp4" -2
Machine B
2014-04-24T22:08:31 MCEBuddy.AppWrapper.Handbrake --> Process arguments -i "C:\Program Files\MCEBuddy2x\working0\Seinfeld_WDCWDT_2013_02_12_17_58_00.ts" --denoise="weak" --loose-anamorphic --verbose=2 -T -f mp4 -4 --start-at duration:3 -e x264 -b 4800 -x me=hex:trellis=2:subq=8:partitions=all:8x8dct:ref=5:rc-lookahead=50:keyint=25:keyint-min=20:bframes=3:weight-b:level-idc=40:b-pyramid=normal:direct-pred=auto:mixed-refs:deblock=-1,-1:nofast-pskip:nodct-decimate:b-adapt=2:threads=auto --deinterlace --decomb -E ffac3 -R auto -B 384 -D 2.5 -6 auto -o "C:\Program Files\MCEBuddy2x\working0\Seinfeld_WDCWDT_2013_02_12_17_58_00-converted.mp4" -2
First of all both are using 2-pass conversion (which itself takes double the time) of a 1-pass with minor improvement in quality, this really helps when the source video is not good shape to begin with. Generally just increasing the bitrate is enough to preserve quality with 1-pass.

As you can see the differences, Machine B has a lower bitrate (which is good interms of speed), machine B is using 5.1 channel audio (which is slower) while Machine A is using stereo audio

Also, if you look at the handbrake output on CPU:
Machine A
2014-04-24T22:03:08 MCEBuddy.AppWrapper.Handbrake --> [22:03:08] CPU: Intel(R) Xeon(R) CPU E5504 @ 2.00GHz
2014-04-24T22:03:08 MCEBuddy.AppWrapper.Handbrake --> [22:03:08] - logical processor count: 4
Machine B
2014-04-24T22:08:32 MCEBuddy.AppWrapper.Handbrake --> [22:08:32] CPU: Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz
2014-04-24T22:08:32 MCEBuddy.AppWrapper.Handbrake --> [22:08:32] - logical processor count: 2
As you can see Machine has atleast 50% less CPU power upfront compared to Machine A, which explains why Machine B is taking 50% more time to convert.

Other differences you can see the settings:
  • Machine B is set to Sleep on Battery.
  • Machine A is working off a local Drive (I) where as Machine B is working off a network drive (\htpc\Video) for reading and writing which explains the slower disk access
Apr 26, 2014 at 8:17 PM
Thanks for helping me understand more about what's going on in the log! I think I'm beginning to see the errors of my ways.

FIRST
I'm using the 'MKV High Quality' profile (I just edited the existing 'Convert to MP4' task) which states "High profile, high quality 2 pass MKV (H.264/AC3). Primarily for HD videos, takes the most time and produces the best results."
I should have just used the 'MKV Unprocessed' profile: "Very fast but limited functionality. Use this profile if you want to copy the original audio and video tracks, remove the commercials and convert the file format to MKV (e.g. WTV to MKV) without any additional processing (deinterlacing, resizing, volume, cropping etc). The original video can be in any format, MPEG1, MPEG2 or MPEG4/H.264, it will be retained unaltered."

Whoops!

With that mistake fixed, conversions (with sub titles/captions) are ultra quick but but we're only getting like 100MB of savings.

SECOND
It shoudn't have been via UNC path but via iSCSI instead. I'll fix that on my end as all the videos are hosted on a Synology NAS.


I'll play around with the settings to find a good balance between quality and size, and write something to distribute the workload around between the MCEBuddy 'servers'.

Thanks again!
Oct 21, 2016 at 4:47 PM
I recently opened a feature request related to this topic -

Add LockFile to Source File During Processing
Scheduled Conversion - Finish active conversion before pausing

Essentially I would like MCEBuddy engines to be aware if another engine is already processing the file and properly deal with some small bugs / limitations that currently exist when distributing the conversions.
Oct 25, 2016 at 4:30 PM
Edited Oct 26, 2016 at 6:37 AM
I created a BAT file script to help coordinate distributed MCEBuddy conversions across my two machines: HTPC and HTPC-Bedroom (Bedroom)

I run the following script every 5 minutes on both machines via task manager. No schedule is set (start stop) in MCEBuddy - the script handles the starting and stopping of MCEBuddy Conversions.

Essentially the script does the following:
  • Checks to see if Media Center or Kodi is running locally. If so, stop running MCEBuddy on the local machine
  • If Media Center or Kodi are NOT running locally on HTPC, run MCEBuddy conversions on HTPC and stop conversions on Bedroom if MCEBuddy is converting files.
  • If Media Center or Kodi are NOT Running locally on Bedroom and MCEBuddy is not already running conversions on HTPC, start MCEBuddy conversions on Bedroom
In summary, if Kodi or Media Center are running the script assumes that the machine is being used and to not run conversions on that machine. The script will then try to run conversions first on HTPC and then Bedroom - ensuring that MCEBuddy conversions are not running on both machines.

You will need to change the following in the script below:
  • 192.168.1.50 is the IP of my HTPC
  • 192.168.1.60 is the IP of my Bedroom
  • The two IF "%SERVER%" lines need to be changed to the respective hostnames of the two machines
  • Please also ensure that C:\temp\ is writable, if not please change the paths below.
@echo off&setlocal
SETLOCAL EnableExtensions

REM ***************************************
REM ***************************************
REM ***************************************
REM START VARIABLES

del /Q /F C:\Temp\MCEBuddyControlLastRun.txt
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)
echo %mydate%_%mytime% > C:\Temp\MCEBuddyControlLastRun.txt

set SERVER=%computername%
set EXE1=Kodi.exe
set EXE2=ehshell.exe
set LOGFILE=C:\Temp\mcestatus.log
SET statusFileHTPC=C:\Temp\HTPC.mcestatus
SET statusFileBEDROOM=C:\Temp\BEDROOM.mcestatus

REM END VARIABLES
REM ***************************************
REM ***************************************
REM ***************************************
REM echo %SERVER%

IF "%SERVER%"=="HTPC-PC" GOTO HTPC
IF "%SERVER%"=="HTPC-BEDROOM" GOTO BEDROOM

:HTPC
echo Initalizing variables for HTPC  > %LOGFILE%
set IP="192.168.1.50"
set CHECK=Z:\Recorded TV\HTPC.mcerunning
REM echo %IP%
REM pause
GOTO STEP1

:BEDROOM
echo Initalizing variables for Bedroom  > %LOGFILE%
set IP="192.168.1.60"
set CHECK=Z:\Recorded TV\HTPC.mcerunning
REM echo %IP%
REM pause
GOTO STEP1

:STEP1
REM echo "STEP 1"
REM pause

REM CHECK if BEDROOM is up
ping -n 1 192.168.1.50 > NUL
IF ERRORLEVEL 0 (echo HTPC is up, continue >> %LOGFILE%) ELSE (goto END)

REM CHECK MCEBuddy Run Status
"C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=query --action=enginestate --server=192.168.1.50 --port=23332 --quiet > %statusFileHTPC%
"C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=query --action=enginestate --server=192.168.1.60 --port=23332 --quiet > %statusFileBEDROOM%

SET /P statusHTPC= < %statusFileHTPC%
SET /P statusBEDROOM= < %statusFileBEDROOM%

del /Q /F %statusFileHTPC%
del /Q /F %statusFileBEDROOM%


REM echo %statusHTPC%
REM echo %statusBEDROOM%
REM if %statusHTPC% == started (echo "HTPC STARTED")
REM if %statusHTPC% == stopped (echo "HTPC STOPPED")
REM if %statusBEDROOM% == started (echo "BEDROOM STARTED")
REM if %statusBEDROOM% == stopped (echo "BEDROOM STOPPED")
REM pause
GOTO STEP2


:STEP2
REM echo "STEP 2"
REM pause
REM CHECK IF KODI or MediaCenter is Running

FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE1%"') DO IF %%x == %EXE1% goto ProcessFound
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE2%"') DO IF %%x == %EXE2% goto ProcessFound

goto ProcessNotFound

:ProcessFound
echo Kodi or MediaCenter is Running  >> %LOGFILE%
REM pause
REM echo %EXE% is running
"C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=127.0.0.1 --port=23332 --quiet
"C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=127.0.0.1 --port=23332 --quiet
goto END

:ProcessNotFound
echo Kodi or MediaCenter NOT Running  >> %LOGFILE%
REM pause
REM echo %EXE% is not running
IF "%SERVER%"=="HTPC-PC" GOTO CHECKHTPC
IF "%SERVER%"=="HTPC-BEDROOM" GOTO CHECKBEDROOM
goto END

:CHECKHTPC
echo Running MCEBuddy Check for HTPC  >> %LOGFILE%
REM pause
SetLocal EnableDelayedExpansion
if %statusHTPC% == started (
    echo MCEBuddy: HTPC Running  >> %LOGFILE%
    echo MCEBuddy Already Running on HTPC  >> %LOGFILE%
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.50 --port=23332 --quiet
    REM pause
)
EndLocal
SetLocal EnableDelayedExpansion
if %statusHTPC% == stopped (
    echo MCEBuddy: HTPC Stopped  >> %LOGFILE%
    echo Starting MCEBuddy on HTPC  >> %LOGFILE%
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.50 --port=23332 --quiet
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=start --server=192.168.1.50 --port=23332 --quiet
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=start --server=192.168.1.50 --port=23332 --quiet
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.50 --port=23332 --quiet
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.50 --port=23332 --quiet
    REM schtasks /Run /TN "\HTPC\UnlockScreen"
    REM pause
)
EndLocal
REM Stop Bedroom if started
if %statusBEDROOM% == started ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
if %statusBEDROOM% == started ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
goto END

:CHECKBEDROOM
echo Running MCEBuddy Check for BEDROOM  >> %LOGFILE%
REM pause
SetLocal EnableDelayedExpansion
if %statusHTPC% == started (
    echo MCEBuddy: HTPC Running  >> %LOGFILE%
    echo MCEBuddy Already Running on HTPC  >> %LOGFILE%
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.50 --port=23332 --quiet
    if %statusBEDROOM% == started ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
    if %statusBEDROOM% == started ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
    REM pause
)
EndLocal
SetLocal EnableDelayedExpansion
if %statusHTPC% == stopped (
    if %statusBEDROOM% == started (
        echo MCEBuddy: Bedroom Running  >> %LOGFILE%
        echo MCEBuddy Already Running on Bedroom  >> %LOGFILE%
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
        REM pause
    ) else (
        echo MCEBuddy: Bedroom Stopped  >> %LOGFILE%
        echo Starting MCEBuddy on Bedroom >> %LOGFILE%
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=start --server=192.168.1.60 --port=23332 --quiet
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=start --server=192.168.1.60 --port=23332 --quiet
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
        REM schtasks /Run /TN "\HTPC\UnlockScreen"
        REM pause
    )
)
EndLocal
goto END

:END
:: Exit code 0
Ver > nul
REM pause
EXIT
Marked as answer by rboy1 on 10/25/2016 at 6:44 PM
Oct 26, 2016 at 6:00 AM
Edited Oct 26, 2016 at 6:44 AM
rboy1, I have been able to distribute my MCEBuddy engines using the above script. The next stage would be to allow for simultaneous conversions across both machines, without cross-over between conversion engines. Unfortunately, the MCEBuddy.UserCLI.exe client only allows for the deletion of jobs by number (not name) and querying of specific job status only with the full path - it would be hard to coordinate jobs between engines without writing a full client from the MCEBuddy source code.

Instead, I propose we split the file scanning / job scheduling from the conversion engine. This will allow for a server process to run - which monitors directories for files and coordinates jobs between connected engines. The MCEBuddy services (engines) will then be a client to the server.

Given MCEBuddy has both file scanning, scheduling and conversion all in one service, how difficult would it be to modify this functionality? I would be willing to donate.



As an alternative, if you could add functionality to the MCEBuddy.UserCLI.exe to output a CSV (echo to console is fine) with the queue order, filename, location, status, time left in conversion (if converting), it would also help me with my goals of simultaneous MCEBuddy engines on a single directory of WTV files.

Thank you for all of your support!
Coordinator
Nov 15, 2016 at 8:47 PM
Great work!!

Nov 15, 2016 at 9:10 PM
rboy1 wrote:
Great work!!
thanks.

Any plans to have a coordinated MCEBuddy engine and "clients" or "conversion" nodes that run on both machines?
Nov 28, 2016 at 6:16 PM
Updated script for the newest version of MCEBuddy:
@echo off&setlocal
SETLOCAL EnableExtensions

REM ***************************************
REM ***************************************
REM ***************************************
REM START VARIABLES

del /Q /F C:\Temp\MCEBuddyControlLastRun.txt
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)
echo %mydate%_%mytime% > C:\Temp\MCEBuddyControlLastRun.txt

set SERVER=%computername%
set EXE1=Kodi.exe
set EXE2=ehshell.exe
set LOGFILE=C:\Temp\mcestatus.log
SET statusFileHTPC=C:\Temp\HTPC.mcestatus
SET statusFileBEDROOM=C:\Temp\BEDROOM.mcestatus

REM END VARIABLES
REM ***************************************
REM ***************************************
REM ***************************************
REM echo %SERVER%

IF "%SERVER%"=="HTPC-PC" GOTO HTPC
IF "%SERVER%"=="HTPC-BEDROOM" GOTO BEDROOM

:HTPC
echo Initalizing variables for HTPC  > %LOGFILE%
set IP="192.168.1.50"
REM set CHECK=Z:\Recorded TV\HTPC.mcerunning
REM echo %IP%
REM pause
GOTO STEP1

:BEDROOM
echo Initalizing variables for Bedroom  > %LOGFILE%
set IP="192.168.1.60"
REM set CHECK=Z:\Recorded TV\HTPC.mcerunning
REM echo %IP%
REM pause
GOTO STEP1

:STEP1
REM echo "STEP 1"
REM pause

REM CHECK if BEDROOM is up
ping -n 1 192.168.1.50 > NUL
IF ERRORLEVEL 0 (echo HTPC is up, continue >> %LOGFILE%) ELSE (echo HTPC is NOT up, ENDING >> %LOGFILE% && goto END)

REM CHECK MCEBuddy Run Status
"C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=query --action=enginestate --server=192.168.1.50 --port=23332 --quiet > %statusFileHTPC%
"C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=query --action=enginestate --server=192.168.1.60 --port=23332 --quiet > %statusFileBEDROOM%

SET /P statusHTPC= < %statusFileHTPC%
SET /P statusBEDROOM= < %statusFileBEDROOM%

del /Q /F %statusFileHTPC%
del /Q /F %statusFileBEDROOM%

echo MCEBuddy HTPC: %statusHTPC% >> %LOGFILE%
echo MCEBuddy Bedroom: %statusBEDROOM% >> %LOGFILE%

REM echo %statusHTPC%
REM echo %statusBEDROOM%
REM if %statusHTPC% == started (echo "HTPC STARTED")
REM if %statusHTPC% == stopped (echo "HTPC STOPPED")
REM if %statusBEDROOM% == started (echo "BEDROOM STARTED")
REM if %statusBEDROOM% == stopped (echo "BEDROOM STOPPED")
REM pause
GOTO STEP2


:STEP2
REM echo "STEP 2"
REM pause
REM CHECK IF KODI or MediaCenter is Running

FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE1%"') DO IF %%x == %EXE1% goto ProcessFound
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE2%"') DO IF %%x == %EXE2% goto ProcessFound

goto ProcessNotFound

:ProcessFound
echo Kodi or MediaCenter is Running  >> %LOGFILE%
REM pause
REM echo %EXE% is running
"C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=127.0.0.1 --port=23332 --quiet
"C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=127.0.0.1 --port=23332 --quiet
goto END

:ProcessNotFound
echo Kodi or MediaCenter NOT Running  >> %LOGFILE%
REM pause
REM echo %EXE% is not running
IF "%SERVER%"=="HTPC-PC" GOTO CHECKHTPC
IF "%SERVER%"=="HTPC-BEDROOM" GOTO CHECKBEDROOM
goto END

:CHECKHTPC
echo Running MCEBuddy Check for HTPC  >> %LOGFILE%
REM pause
SetLocal EnableDelayedExpansion
if %statusHTPC% == started (
    echo MCEBuddy: HTPC Running  >> %LOGFILE%
    echo MCEBuddy Already Running on HTPC  >> %LOGFILE%
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.50 --port=23332 --quiet
    REM pause
)
EndLocal
SetLocal EnableDelayedExpansion
if %statusHTPC% == conversion_in_progress (
    echo MCEBuddy: HTPC Running  >> %LOGFILE%
    echo MCEBuddy Already Running on HTPC  >> %LOGFILE%
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.50 --port=23332 --quiet
    REM pause
)
EndLocal
SetLocal EnableDelayedExpansion
if %statusHTPC% == stopped (
    echo MCEBuddy: HTPC Stopped  >> %LOGFILE%
    echo Starting MCEBuddy on HTPC  >> %LOGFILE%
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.50 --port=23332 --quiet
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=start --server=192.168.1.50 --port=23332 --quiet
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=start --server=192.168.1.50 --port=23332 --quiet
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.50 --port=23332 --quiet
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.50 --port=23332 --quiet
    REM schtasks /Run /TN "\HTPC\UnlockScreen"
    REM pause
)
EndLocal
REM Stop Bedroom if started
if %statusBEDROOM% == started ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
if %statusBEDROOM% == started ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
if %statusBEDROOM% == conversion_in_progress ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
if %statusBEDROOM% == conversion_in_progress ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
goto END

:CHECKBEDROOM
echo Running MCEBuddy Check for BEDROOM  >> %LOGFILE%
REM pause
SetLocal EnableDelayedExpansion
if %statusHTPC% == started (
    echo MCEBuddy: HTPC Running  >> %LOGFILE%
    echo MCEBuddy Already Running on HTPC  >> %LOGFILE%
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
    if %statusBEDROOM% == started ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
    if %statusBEDROOM% == started ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
    if %statusBEDROOM% == conversion_in_progress ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
    if %statusBEDROOM% == conversion_in_progress ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
    REM pause
)
EndLocal
SetLocal EnableDelayedExpansion
if %statusHTPC% == conversion_in_progress (
    echo MCEBuddy: HTPC Running  >> %LOGFILE%
    echo MCEBuddy Already Running on HTPC  >> %LOGFILE%
    "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
    if %statusBEDROOM% == started ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
    if %statusBEDROOM% == started ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
    if %statusBEDROOM% == conversion_in_progress ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
    if %statusBEDROOM% == conversion_in_progress ("C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=stop --server=192.168.1.60 --port=23332 --quiet)
    REM pause
)
EndLocal
SetLocal EnableDelayedExpansion
if %statusHTPC% == stopped (
    if %statusBEDROOM% == started (
        echo MCEBuddy: Bedroom Running  >> %LOGFILE%
        echo MCEBuddy Already Running on Bedroom  >> %LOGFILE%
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
        REM pause
    ) ELSE IF %statusBEDROOM% == conversion_in_progress (
        echo MCEBuddy: Bedroom Running  >> %LOGFILE%
        echo MCEBuddy Already Running on Bedroom  >> %LOGFILE%
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
        REM pause
    ) else (
        echo MCEBuddy: Bedroom Stopped  >> %LOGFILE%
        echo Starting MCEBuddy on Bedroom >> %LOGFILE%
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=start --server=192.168.1.60 --port=23332 --quiet
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=start --server=192.168.1.60 --port=23332 --quiet
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
        "C:\PROGRA~1\MCEBuddy2x\MCEBuddy.UserCLI.exe" --command=engine --action=rescan --server=192.168.1.60 --port=23332 --quiet
        REM schtasks /Run /TN "\HTPC\UnlockScreen"
        REM pause
    )
)
EndLocal
goto END

:END
:: Exit code 0
Ver > nul
REM pause
EXIT
Marked as answer by rboy1 on 12/1/2016 at 7:50 AM