INTERACT FORUM

More => Old Versions => JRiver Media Center 26 for Windows => Topic started by: glynor on May 18, 2020, 09:35:24 am

Title: Request: Analyze Audio From the Command Line
Post by: glynor on May 18, 2020, 09:35:24 am
I'd like to request a new command line option which would allow me to provide a TREEPATH and have MC run Analyze Audio on it, optionally closing the dialog when complete.

I think the why is somewhat obvious, but the long and short of it is: I have a huge backlog of un-analyzed files. I don't keep the Analyze Audio option enabled for Auto Import because it can be resource intensive (and slows down imports) and since my server does multiple things, I can't have it randomly pegging the CPUs as it imports files. But that means analysis has to be held for "later" and as we all know, later usually never comes.

But, I have a very nice Smartlist which finds the files. I'd like to set up a new list that divides that "master to-do list" into manageable hunks that will process in a few hours, and set up a Scheduled Task which runs the analysis overnight. After a few weeks, I'll have the whole backlog processed, and the task will just take care of new imports for me as I go.

I can't though, as there doesn't seem to be a way to trigger it to run and accept my Smartlist as input. Soooo... <flutters eyelashes>
Title: Re: Request: Analyze Audio From the Command Line
Post by: Matt on May 18, 2020, 09:43:57 am
As a start, you could fire select all:
mc26.exe /MCC 21002

Then analyze:
mc26.exe /MCC 23005

We could probably add an auto-start to the analyze command if you needed it.
Title: Re: Request: Analyze Audio From the Command Line
Post by: glynor on May 18, 2020, 09:53:04 am
But then I'd need to have MC visible and automate it going to the proper playlist... Possible, I believe, but non-ideal.

I suppose I could, but considering this is intended to run on the headless server in the rack with no user input while I'm sleeping, and where I might not look at the server's screen for days-on-end, I'm loathe to write scripts which rely on UI automation where it can be avoided.

Since the Analyze Audio tool clearly takes a Playlist-style item internally, I'd hoped it wouldn't be too much of an ask to expose this via a command line. Am I wrong?
Title: Re: Request: Analyze Audio From the Command Line
Post by: glynor on May 18, 2020, 10:02:16 am
PS. A MCWS command would be fine too, so long as it can take a TREEPATH (and I don't have to manually build the playlist and POST it in my script).
Title: Re: Request: Analyze Audio From the Command Line
Post by: mwillems on May 18, 2020, 01:43:28 pm
Not a direct solution to your problem, but have you thought about redesigning your import process to address this problem?

So instead of importing files at random times and deferring analysis for a scheduled time (during down times?), why not enable analysis on import but put files in a "holding directory" and then move the files over to the watched directory at a scheduled time?  Scripting a file transfer is trivial.  That way you can take advantage of analysis on import but control the timing so that it happens at a safe time.

I only mention it because that's basically how I have mine setup (albeit for different reasons) and it would allow you to control when analysis happens without GUI automation.
Title: Re: Request: Analyze Audio From the Command Line
Post by: Matt on May 19, 2020, 09:04:46 am
Just for you, next build:
NEW: Added the MCWS function Control/AnalyzeAudio that takes a tree path and analyzes the files.

Please let us know how it works once it ships.  Thanks.
Title: Re: Request: Analyze Audio From the Command Line
Post by: glynor on May 19, 2020, 10:02:48 am
Just for you, next build:
NEW: Added the MCWS function Control/AnalyzeAudio that takes a tree path and analyzes the files.

Please let us know how it works once it ships.  Thanks.

Aww shucks, Matt. Thanks.
(https://i.imgur.com/HHcOQ91.gif)