File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,7 +134,23 @@ ffmpeg -i input.mp4 -map 0 -vf "scale=1920:1080:force_original_aspect_ratio=decr
134134
135135### Batch encode
136136
137- Bulk conversion using Windows batch scripting. Should probably use something better like PowerShell
137+ Single line bulk file encoding commands.
138+
139+ #### PowerShell
140+
141+ ``` powershell
142+ Get-ChildItem -Recurse -Filter *.mp3 | ForEach-Object { ffmpeg -i $_.FullName -b:a 48k (Join-Path $_.DirectoryName "$($_.BaseName).opus") }
143+ ```
144+
145+ Or to preserve the original last modified date:
146+
147+ ``` powershell
148+ Get-ChildItem -Recurse -Filter *.mp3 | ForEach-Object { $out = (Join-Path $_.DirectoryName "$($_.BaseName).opus"); ffmpeg -i $_.FullName -b:a 48k $out; (Get-Item $out).LastWriteTime = $_.LastWriteTime }
149+ ```
150+
151+ #### Batch script
152+
153+ Bulk Opus encoding using Windows batch scripting. Should probably use something better like PowerShell.
138154
139155``` batch
140156FOR /F "tokens=*" %G IN ('dir /b *.mp3') DO ffmpeg -i "%G" -b:a 48k "%~nG.opus"
You can’t perform that action at this time.
0 commit comments