Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal EnableDelayedExpansion
- rem Input and output folder are in same directory as batch file.
- set "InputFolder=%~dp0input"
- set "OutputFolder=%~dp0output"
- echo Input folder is: %InputFolder%
- echo Output folder is: %OutputFolder%
- echo.
- rem Search in input folder and all subfolders for the specified types
- rem of audio files and output what is found with the output file name
- rem in output folder. Delayed environment variable expansion is needed
- rem for all variables set or modified within the body of the FOR loop.
- for /R in dir/*.mp4; do ffmpeg -i -acodec copy "$f" ... "./output/"$(echo "${f%.yml}.mp3"|tr / _); done
- endlocal
- echo.
- pause
- rem Exit batch processing and return to command process.
- exit /B
- rem Subroutine to get last folder name from first argument and append an
- rem underscore, the file name of the input file without file extension
- rem passed as second argument and the file extension MP3. But if the path
- rem to the file is identical with input folder path, get just name of file
- rem with different file extension.
- :GetOutputFileName
- if "%~1" == "%InputFolder%" (
- set "OutputFileName=%~2.mp3"
- ) else (
- set "OutputFileName=%~nx1_%~2.mp3"
- )
- rem Exit subroutine.
- exit /B
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement