2

I'm desperate.

I need to extract the .aac stream from ~1749 .m4a files with ffmpeg, but I can't get a batch file working for me and it would take years to do it manually.

This is what I use for single files:

ffmpeg -i example.m4a -vn -c:a copy example.acc

I don't want to convert the files - I only want to extract the .aac audio stream (don't wanna lose more quality).

ffmpeg -i *.m4a -vn -c:a copy *.acc isn't working and I don't know how to use for in loops since I'm not a programmer. All loops I found on the internet aren't working for me.

OS: Windows 7 Professional.

I appreciate any help.

4
  • I meant to write ".aac" not ".acc". Commented Dec 29, 2015 at 13:48
  • Try something like this and report back your results. Just plug in your source path and the output path accordingly. FOR %A IN ("C:\SourcePath\*.m4a") DO ffmpeg -i "%~A" -vn -c:a copy "C:\OutputPath\%~NA.acc". Do this from a command line manually too, not from a batch script and TEST it first too, do not run it against critical files until TESTING is complete. Commented Dec 29, 2015 at 13:58
  • Dude, I LOVE YOU. You saved my day. // FOR %A IN ("*.m4a") DO ffmpeg -i "%~A" -vn -c:a copy "%~NA.aac" // Was the thing. ffmpeg.exe is in the same folder as the files. :) Commented Dec 29, 2015 at 14:05
  • This is why people should always learn some basic programming skills. It's almost 2016 :)
    – jiggunjer
    Commented Dec 30, 2015 at 3:10

2 Answers 2

1

Use the below examples and just plug in your source path and output path accordingly—I have both implicit and explicit examples below to run as batch or manually from command prompt.

As usual be sure to test this with test files first though to ensure it works as expected.


Explicit

Manual from command line copy and paste

FOR %A IN ("C:\SourcePath\*.m4a") DO ffmpeg -i "%~A" -vn -c:a copy "C:\OutputPath\%~NA.aac"

Run from a batch script

FOR %%A IN ("C:\SourcePath\*.m4a") DO ffmpeg -i "%%~A" -vn -c:a copy "C:\OutputPath\%%~NA.aac"

Implicit

Manual from command line copy and paste

FOR %A IN ("*.m4a") DO ffmpeg -i "%~A" -vn -c:a copy "%~NA.aac"

Run from a batch script

FOR %%A IN ("*.m4a") DO ffmpeg -i "%%~A" -vn -c:a copy "%%~NA.aac"
2

Method 1: open cmd and type:

FOR %A IN ("C:\SourcePath\*.m4a") DO ffmpeg -i "%~A" -vn -c:a copy "C:\OutputPath\%~NA.aac"

Method 2: open cmd and type:

FOR %A IN ("C:\SourcePath\*.m4a") DO ffmpeg -i "%~A" -vn -acodec copy "C:\OutputPath\%~NA.aac"

Both of them work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .