I
I
ImVeryStupid2021-02-04 17:44:58
Windows
ImVeryStupid, 2021-02-04 17:44:58

How to recursively convert files in all folders and subfolders?

How to execute this code in Windows (not 10) cmd

find . -type f -iname "*.webm" -exec bash -c 'FILE="$1"; ffmpeg -i "${FILE}" -vn -ab 128k -ar 44100 -y "${FILE%.webm}.mp3";' _ '{}' \;

???
source

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2021-02-05
@ImVeryStupid

By default, do nothing. There is no find command in Windows - this is a purely nix command.
But you can install some ported set of Linux utilities (for example, msys2 or something else) and run this command from under it.
In general, this is not difficult to rewrite for cmd:

@echo off
for /f "tokens=* delims=" %%a in ('dir /b /s *.webm') do ffmpeg -i "%%a" -vn -ab 128k -ar 44100 -y "%%~dpna.mp3"

Save the code in a batch file in the directory with files and run.
ffmpeg must be available to run from the command line, if not available, then you need to specify the full path to it.
The code has not been tested.

I
ImVeryStupid, 2021-10-30
@ImVeryStupid

Through powershell:

$files = Get-ChildItem -Recurse -Include *.webm
foreach ($f in $files){
   $inFile = '"' + $f.Fullname + '"'
   $outFile = $infile.replace('.webm','.webm.mp3')
   ffmpeg -i $inFile -vn -ab 128k -ar 44100 -y $outFile
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question