Jump to content

Check for AAC track in Batch


ginjaninja

Recommended Posts

ginjaninja

Does anyone know a way to use mkvinfo, ffmpeg, mediainfo or some such to check for existing of a audio stream type (eg aac, stereo) and use in an if statement in Batch/Command Line.

 

ive seen some programs use error levels as outputs of the programs to inject a variable into batch......

 

any ideas ....thank you..

Link to comment
Share on other sites

ginjaninja

Should be easy to do.  Use ffmpeg to get audio info and drop to file or whatever you're gunna do.

checking for text in a file is currently beyond me..could you give me some further pointers..

is it possible to pipe the output of ffmpeg into memory..so check files dont clog filesystem whilst strings are searched for..

have you got any example batch code that checks the output of ffmpeg media info to make decisions...presumably its not as simple as checking for strings as the information is nested in the output of ffmpeg.

Link to comment
Share on other sites

CBers

@@ginjaninja - have you tried "PopCorn MKV AudioConverter"?

 

It can scan a folder at a time and then convert what you want.

 

I use it to convert my DTS movies to AC3, but make it keep both audio tracks.

 

See here for information:

 

http://www.hack7mc.com/2009/12/audio-conversion-using-popcorn-audio-converter.html

Link to comment
Share on other sites

ginjaninja

@@ginjaninja - have you tried "PopCorn MKV AudioConverter"?

 

It can scan a folder at a time and then convert what you want.

 

I use it to convert my DTS movies to AC3, but make it keep both audio tracks.

 

See here for information:

 

http://www.hack7mc.com/2009/12/audio-conversion-using-popcorn-audio-converter.html

thanks yes i did have a look at it..it creates an ac3 track from dts which im not sure is roku directplay compatible 

and doesn't have the capability to skip if converted track exists

Link to comment
Share on other sites

CBers

Does it only convert to AC3 then? That's all I use, but I thought it did AAC conversion as well.

 

Sorry if I wasted your time :)

Link to comment
Share on other sites

ginjaninja

Does it only convert to AC3 then? That's all I use, but I thought it did AAC conversion as well.

 

Sorry if I wasted your time :)

It can convert aac tracks to other formats..but for dts only to ac3 is my understanding..

no wasted  time at all, thanks for ideas...

Link to comment
Share on other sites

ginjaninja
E:\CONVERT\MEDIAINFO --inform="General;%%Audio_Format_List%%" "%file%" > "%~dpn1".chk
set /p STRING=<"%~dpn1".chk
IF EXIST "%~dpn1".chk del "%~dpn1".chk
ECHO %STRING% | FINDSTR /C:"AAC" >nul & IF ERRORLEVEL 1 (CALL :ADDAACTOMKV %%1) else (echo ACC already Exists)

The command line for mediainfo is capable but hardwork to get variables out of to action...for some reason writing them to a file works but i could not get a for do loop with delimeters to parse the output on one line.

Link to comment
Share on other sites

chessdragon136

If i were you I'd look at using mkvmerge to identify the audio tracks - the command line has an option -i that identifies the video / audio / subtitle tracks, and I'm sure some work will let you identify aac - look at the accepted answer at this link, i use it to batch remove subtitles. You look like you only want the identify bit in the for statement. 

 

http://superuser.com/questions/599405/find-all-mkv-files-and-remove-all-subtitles

Edited by chessdragon136
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...