VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. How do I make FFMPEG extract audio out of all clips in a folder? The following failed
    Code:
    for %%i do "M:\ffmpeg.exe" -i "%%1" -acodec pcm_s16le "M:\%%~ni.wav"
    Thanks.
    Quote Quote  
  2. Code:
    for "%%i"
    but
    Code:
    -i "%%1"
    .
    Should both be the same letter.

    If it still fails post complete ffmpeg log/terminal output.
    Quote Quote  
  3. 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:\>
    Quote Quote  
  4. If you type directly into terminal instead of running a .bat file you need to use single % instead of double %%.
    Quote Quote  
  5. Well I have to use it in a terminal otherwise the window will close. Either way, with single % it complained "do" was not expected.
    Quote Quote  
  6. You need something like
    Code:
    for %i in (*.mkv) do "M:\ffmpeg.exe" -i "%~i" -acodec pcm_s16le "M:\%~ni.wav"
    (.mkv extension)

    Code:
    for %i in (*.*) do "M:\ffmpeg.exe" -i "%~i" -acodec pcm_s16le "M:\%~ni.wav"
    (Any file extension)


    https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/for
    Quote Quote  
  7. 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.
    Quote Quote  



Similar Threads