It's been a while since I've been back, mostly because I haven't been scripting much. But now I find myself trying to convert quite a few movies and I finally decided to script a process to save some time. The problem I find myself in, is that I try to do the conversion using FFMPEG but I get errors while trying to run the commands using RUNWAIT and COMSPEC.
The line of code that's giving me a hard time is:
Code: Select all
audioLn:=RunWait %comspec% /c ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "F:\Audio.mp3"
The code outside of AHK is:
Code: Select all
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "F:\Audio.mp3"
What this code do is retrieve the Length of a media file in seconds, and store it in the audioLn variable. For example 1253.78. I need that number so I can either straight mux the video and audio OR, if needed, stretch or shrink the audio to match the video length.
I either get errors at the : or at the =1
I tried to use ":" but the I get error at =1, if I try "=1" I still get errors. How do I escape those characters or is there any other way to run that code and get the time?