0

I when i download movies, sometimes they are downloaded in the wrong audio format (my player cant play it) i would like to create a script that is ran on a schedule that would loop through all my movies, fetching the Audio codec and checking to see if its DTS (or any variation of), if found, use FFMPEG to re encode the audio only to something else (AAC/AA3)

I did this to start with, but had to use other means to find the audio codec, then put all the movies in a folder and run the script from there. below is what i ran (on Windows 8.1 machine):

set mypath=S:\Blu Ray\New folder\New folder\%f

FOR %f IN (*.mkv) DO ffmpeg -i “%f” -vcodec copy -scodec copy -acodec ac3 -b:a 640k “%mypath%"

Any help would be great!!!

BD

  • Adapt my answer in [Is there a way to use ffmpeg to determine the encoding of a file before transcoding?](https://stackoverflow.com/a/35280871/1109017) to get the format name (change `-select_streams v:0` to `-select_streams a:0`), then use if/then to process it. I'm a Linux user so I can't provide a turnkey Windows example. Note that it will output the format for the first audio stream. If you want to list all audio streams in case of multiples, use `-select_streams a`. – llogan Sep 24 '17 at 02:32
  • Your example is displaying “smart quotes”. Change them to regular double quotes if your actual command contains these troublesome quotes. – llogan Sep 24 '17 at 02:42

0 Answers0