Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. @echo off
  2. setlocal EnableDelayedExpansion
  3.  
  4. rem Input and output folder are in same directory as batch file.
  5. set "InputFolder=%~dp0input"
  6. set "OutputFolder=%~dp0output"
  7. echo Input folder is: %InputFolder%
  8. echo Output folder is: %OutputFolder%
  9. echo.
  10.  
  11. rem Search in input folder and all subfolders for the specified types
  12. rem of audio files and output what is found with the output file name
  13. rem in output folder. Delayed environment variable expansion is needed
  14. rem for all variables set or modified within the body of the FOR loop.
  15.  
  16. for /R in dir/*.mp4; do ffmpeg -i -acodec copy "$f" ... "./output/"$(echo "${f%.yml}.mp3"|tr / _); done
  17.  
  18. endlocal
  19. echo.
  20. pause
  21. rem Exit batch processing and return to command process.
  22. exit /B
  23.  
  24. rem Subroutine to get last folder name from first argument and append an
  25. rem underscore, the file name of the input file without file extension
  26. rem passed as second argument and the file extension MP3. But if the path
  27. rem to the file is identical with input folder path, get just name of file
  28. rem with different file extension.
  29.  
  30. :GetOutputFileName
  31. if "%~1" == "%InputFolder%" (
  32. set "OutputFileName=%~2.mp3"
  33. ) else (
  34. set "OutputFileName=%~nx1_%~2.mp3"
  35. )
  36. rem Exit subroutine.
  37. exit /B
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement