ginjaninja 573 Posted February 25, 2015 Posted February 25, 2015 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..
spootdev 56 Posted February 25, 2015 Posted February 25, 2015 Should be easy to do. Use ffmpeg to get audio info and drop to file or whatever you're gunna do.
ginjaninja 573 Posted February 26, 2015 Author Posted February 26, 2015 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.
Carlo 4552 Posted February 26, 2015 Posted February 26, 2015 What is it your trying to accomplish at a high level?
ginjaninja 573 Posted February 26, 2015 Author Posted February 26, 2015 thanks i would like to add some logic into my script (which creates an aac track) to skip files which already have an aac track.. http://mediabrowser.tv/community/index.php?/topic/18713-batch-create-2-channel-aac-for-mkvs-for-roku-direct-play/
CBers 7114 Posted February 26, 2015 Posted February 26, 2015 @@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
ginjaninja 573 Posted February 26, 2015 Author Posted February 26, 2015 @@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
CBers 7114 Posted February 26, 2015 Posted February 26, 2015 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
ginjaninja 573 Posted February 26, 2015 Author Posted February 26, 2015 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...
ginjaninja 573 Posted February 28, 2015 Author Posted February 28, 2015 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.
chessdragon136 677 Posted February 28, 2015 Posted February 28, 2015 (edited) 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 February 28, 2015 by chessdragon136 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now