How do I make FFMPEG extract audio out of all clips in a folder? The following failed
Thanks.Code:for %%i do "M:\ffmpeg.exe" -i "%%1" -acodec pcm_s16le "M:\%%~ni.wav"
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 7 of 7
Thread
-
-
Code:
for "%%i"
Code:-i "%%1"
Should both be the same letter.
If it still fails post complete ffmpeg log/terminal output. -
Good catch, but
Code:Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Admin>N: N:\>for %%i do "M:\ffmpeg.exe" -i "%%i" -acodec pcm_s16le "M:\%%~ni.wav" %%i was unexpected at this time. N:\>
-
If you type directly into terminal instead of running a .bat file you need to use single % instead of double %%.
-
Well I have to use it in a terminal otherwise the window will close. Either way, with single % it complained "do" was not expected.
-
You need something like
Code:for %i in (*.mkv) do "M:\ffmpeg.exe" -i "%~i" -acodec pcm_s16le "M:\%~ni.wav"
Code:for %i in (*.*) do "M:\ffmpeg.exe" -i "%~i" -acodec pcm_s16le "M:\%~ni.wav"
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/for -
Thanks mang. I didn't realize in was needed if I already cd'd to the directory which means this would've worked the first time if I just used it inside the .bat.
Similar Threads
-
Batch Mkvmerge change default audio, subitle + delete audio
By alloar in forum Newbie / General discussionsReplies: 2Last Post: 8th Jan 2018, 15:38 -
Help for Batch Code MkvToolNix & Extract
By alloar in forum Newbie / General discussionsReplies: 3Last Post: 5th Jan 2018, 15:42 -
MKVmerge/MKVextract batch extract/muxing subtitles
By BuSHari in forum Newbie / General discussionsReplies: 2Last Post: 20th Oct 2017, 10:29 -
How to extract only forced subtitles with a batch muxing using mkvmerge?
By davboc in forum EditingReplies: 1Last Post: 1st Jul 2016, 13:28 -
How to extract 7.1 ch (8) DTS audio to each separate audio and it names it?
By Fractals in forum AudioReplies: 11Last Post: 18th Feb 2015, 10:20