INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Request: Analyze Audio From the Command Line  (Read 750 times)

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Request: Analyze Audio From the Command Line
« 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>
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: Request: Analyze Audio From the Command Line
« Reply #1 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.
Logged
Matt Ashland, JRiver Media Center

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Request: Analyze Audio From the Command Line
« Reply #2 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?
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Request: Analyze Audio From the Command Line
« Reply #3 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).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient
Re: Request: Analyze Audio From the Command Line
« Reply #4 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.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: Request: Analyze Audio From the Command Line
« Reply #5 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.
Logged
Matt Ashland, JRiver Media Center

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Request: Analyze Audio From the Command Line
« Reply #6 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.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/
Pages: [1]   Go Up